Commit bbba5871c35a02618b0918519ae68e06b512b211
1 parent
14bad0d6e7
Exists in
master
and in
1 other branch
- Cambios de estilo para mobile.
- Agregué tareas al gulp.
Showing
2 changed files
with
13 additions
and
9 deletions
Show diff stats
gulpfile.js
1 | const templateCache = require('gulp-angular-templatecache'); | 1 | const templateCache = require('gulp-angular-templatecache'); |
2 | const concat = require('gulp-concat'); | 2 | const concat = require('gulp-concat'); |
3 | const htmlmin = require('gulp-htmlmin'); | 3 | const htmlmin = require('gulp-htmlmin'); |
4 | const rename = require('gulp-rename'); | 4 | const rename = require('gulp-rename'); |
5 | const uglify = require('gulp-uglify'); | 5 | const uglify = require('gulp-uglify'); |
6 | const gulp = require('gulp'); | 6 | const gulp = require('gulp'); |
7 | const pump = require('pump'); | 7 | const pump = require('pump'); |
8 | const jshint = require('gulp-jshint'); | 8 | const jshint = require('gulp-jshint'); |
9 | const replace = require('gulp-replace'); | 9 | const replace = require('gulp-replace'); |
10 | const connect = require('gulp-connect'); | 10 | const connect = require('gulp-connect'); |
11 | const clean = require('gulp-clean'); | 11 | const clean = require('gulp-clean'); |
12 | 12 | ||
13 | var paths = { | 13 | var paths = { |
14 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', |
15 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', |
16 | tmp: 'tmp', | 16 | tmp: 'tmp', |
17 | dist: 'dist/' | 17 | dist: 'dist/' |
18 | }; | 18 | }; |
19 | 19 | ||
20 | gulp.task('templates', function() { | 20 | gulp.task('templates', function() { |
21 | return pump( | 21 | return pump( |
22 | [ | 22 | [ |
23 | gulp.src(paths.srcViews), | 23 | gulp.src(paths.srcViews), |
24 | htmlmin(), | 24 | htmlmin(), |
25 | templateCache('views.js', { | 25 | templateCache('views.js', { |
26 | module: 'focaModalDomicilio', | 26 | module: 'focaModalDomicilio', |
27 | root: '' | 27 | root: '' |
28 | }), | 28 | }), |
29 | gulp.dest(paths.tmp) | 29 | gulp.dest(paths.tmp) |
30 | ] | 30 | ] |
31 | ); | 31 | ); |
32 | }); | 32 | }); |
33 | 33 | ||
34 | gulp.task('uglify', ['templates'], function() { | 34 | gulp.task('uglify', ['templates'], function() { |
35 | return pump( | 35 | return pump( |
36 | [ | 36 | [ |
37 | gulp.src([ | 37 | gulp.src([ |
38 | paths.srcJS, | 38 | paths.srcJS, |
39 | 'tmp/views.js' | 39 | 'tmp/views.js' |
40 | ]), | 40 | ]), |
41 | concat('foca-modal-domicilios.js'), | 41 | concat('foca-modal-domicilios.js'), |
42 | replace('src/views/', ''), | 42 | replace('src/views/', ''), |
43 | replace("['ui.bootstrap', 'focaDirectivas']", '[]'), | 43 | replace("['ui.bootstrap', 'focaDirectivas']", '[]'), |
44 | gulp.dest(paths.tmp), | 44 | gulp.dest(paths.tmp), |
45 | rename('foca-modal-domicilios.min.js'), | 45 | rename('foca-modal-domicilios.min.js'), |
46 | uglify(), | 46 | uglify(), |
47 | gulp.dest(paths.dist) | 47 | gulp.dest(paths.dist) |
48 | ] | 48 | ] |
49 | ); | 49 | ); |
50 | }); | 50 | }); |
51 | 51 | ||
52 | gulp.task('pre-commit', function() { | 52 | gulp.task('pre-commit', function() { |
53 | return pump( | 53 | return pump( |
54 | [ | 54 | [ |
55 | gulp.src(paths.srcJS), | 55 | gulp.src(paths.srcJS), |
56 | jshint('.jshintrc'), | 56 | jshint('.jshintrc'), |
57 | jshint.reporter('default'), | 57 | jshint.reporter('default'), |
58 | jshint.reporter('fail') | 58 | jshint.reporter('fail') |
59 | ] | 59 | ] |
60 | ); | 60 | ); |
61 | 61 | ||
62 | gulp.start('uglify'); | 62 | gulp.start('uglify'); |
63 | }); | 63 | }); |
64 | 64 | ||
65 | gulp.task('webserver', function() { | 65 | gulp.task('webserver', function() { |
66 | pump [ | 66 | pump [ |
67 | connect.server({port: 3000}) | 67 | connect.server({port: 3000}) |
68 | ] | 68 | ] |
69 | }); | 69 | }); |
70 | 70 | ||
71 | gulp.task('clean-post-install', function(){ | 71 | gulp.task('clean-post-install', function(){ |
72 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 72 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
73 | 'index.html'], {read: false}) | 73 | 'index.html'], {read: false}) |
74 | .pipe(clean()); | 74 | .pipe(clean()); |
75 | }); | 75 | }); |
76 | 76 | ||
77 | gulp.task('default', ['webserver']); | 77 | gulp.task('default', ['webserver']); |
78 | |||
79 | gulp.task('watch', function() { | ||
80 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']) | ||
81 | }); | ||
78 | 82 |
src/views/modal-domicilio.html
1 | <div class="modal-header"> | 1 | <div class="modal-header py-1"> |
2 | <h3 class="modal-title">Busqueda de Domicilios</h3> | 2 | <h5 class="modal-title">Busqueda de Domicilios</h5> |
3 | </div> | 3 | </div> |
4 | <div class="modal-body" id="modal-body"> | 4 | <div class="modal-body" id="modal-body"> |
5 | <div class="input-group mb-3" ng-show="!ingreso"> | 5 | <div class="input-group" ng-show="!ingreso"> |
6 | <input | 6 | <input |
7 | type="text" | 7 | type="text" |
8 | class="form-control" | 8 | class="form-control form-control-sm" |
9 | placeholder="Busqueda" | 9 | placeholder="Busqueda" |
10 | ng-model="filters" | 10 | ng-model="filters" |
11 | ng-change="search()" | 11 | ng-change="search()" |
12 | ng-keydown="busquedaDown($event.keyCode)" | 12 | ng-keydown="busquedaDown($event.keyCode)" |
13 | ng-keypress="busquedaPress($event.keyCode)" | 13 | ng-keypress="busquedaPress($event.keyCode)" |
14 | foca-focus="selectedDomicilio == -1" | 14 | foca-focus="selectedDomicilio == -1" |
15 | ng-focus="selectedDomicilio = -1" | 15 | ng-focus="selectedDomicilio = -1" |
16 | teclado-virtual | 16 | teclado-virtual |
17 | > | 17 | > |
18 | <table ng-show="!ingreso" class="table table-striped table-sm"> | 18 | <table ng-show="!ingreso" class="table table-striped table-sm"> |
19 | <thead> | 19 | <thead> |
20 | <tr> | 20 | <tr> |
21 | <th>Titulo</th> | 21 | <th>Titulo</th> |
22 | <th>Calle</th> | 22 | <th>Calle</th> |
23 | <th>Localidad</th> | 23 | <th>Localidad</th> |
24 | <th>Provincia</th> | 24 | <th>Provincia</th> |
25 | <th></th> | 25 | <th></th> |
26 | </tr> | 26 | </tr> |
27 | </thead> | 27 | </thead> |
28 | <tbody> | 28 | <tbody> |
29 | <tr ng-show="currentPageDomicilios.length == 0 && primerBusqueda"> | 29 | <tr ng-show="currentPageDomicilios.length == 0 && primerBusqueda"> |
30 | <td colspan="5"> | 30 | <td colspan="5"> |
31 | No se encontraron resultados. | 31 | No se encontraron resultados. |
32 | </td> | 32 | </td> |
33 | </tr> | 33 | </tr> |
34 | <tr> | 34 | <tr> |
35 | <td colspan="4" ng-show="!ingreso"> | 35 | <td colspan="4" ng-show="!ingreso"> |
36 | <input | 36 | <input |
37 | class="form-control form-control-sm" | 37 | class="form-control form-control-sm" |
38 | type="text" | 38 | type="text" |
39 | placeholder="Selección manual" | 39 | placeholder="Selección manual" |
40 | readonly | 40 | readonly |
41 | ng-click="ingreso = !ingreso" | 41 | ng-click="ingreso = !ingreso" |
42 | /> | 42 | /> |
43 | </td> | 43 | </td> |
44 | <td colspan="1" ng-show="!ingreso"> | 44 | <td colspan="1" ng-show="!ingreso"> |
45 | <button | 45 | <button |
46 | type="button" | 46 | type="button" |
47 | class="btn btn-sm p-1 float-right" | 47 | class="btn btn-sm p-1 float-right" |
48 | ng-class="{ | 48 | ng-class="{ |
49 | 'btn-secondary': selectedDomicilio != 0, | 49 | 'btn-secondary': selectedDomicilio != 0, |
50 | 'btn-primary': selectedDomicilio == 0 | 50 | 'btn-primary': selectedDomicilio == 0 |
51 | }" | 51 | }" |
52 | foca-focus="selectedDomicilio == 0" | 52 | foca-focus="selectedDomicilio == 0" |
53 | ng-keydown="itemDomicilio($event.keyCode)" | 53 | ng-keydown="itemDomicilio($event.keyCode)" |
54 | ng-click="ingreso = !ingreso" | 54 | ng-click="ingreso = !ingreso" |
55 | > | 55 | > |
56 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 56 | <i class="fa fa-arrow-right" aria-hidden="true"></i> |
57 | </button> | 57 | </button> |
58 | </td> | 58 | </td> |
59 | </tr> | 59 | </tr> |
60 | <tr class="selectable" | 60 | <tr class="selectable" |
61 | ng-repeat="(key,domicilio) in currentPageDomicilios" | 61 | ng-repeat="(key,domicilio) in currentPageDomicilios" |
62 | ng-click="select(domicilio)"> | 62 | ng-click="select(domicilio)"> |
63 | <td ng-bind="domicilio.titulo"></td> | 63 | <td ng-bind="domicilio.titulo"></td> |
64 | <td ng-bind="domicilio.Calle + ' ' + domicilio.Numero"></td> | 64 | <td ng-bind="domicilio.Calle + ' ' + domicilio.Numero"></td> |
65 | <td ng-bind="domicilio.Localidad"></td> | 65 | <td ng-bind="domicilio.Localidad"></td> |
66 | <td ng-bind="domicilio.Provincia"></td> | 66 | <td ng-bind="domicilio.Provincia"></td> |
67 | <td> | 67 | <td> |
68 | <button | 68 | <button |
69 | type="button" | 69 | type="button" |
70 | class="btn p-2 float-right" | 70 | class="btn btn-sm p-1 float-right" |
71 | ng-class="{ | 71 | ng-class="{ |
72 | 'btn-secondary': selectedDomicilio != key + 1, | 72 | 'btn-secondary': selectedDomicilio != key + 1, |
73 | 'btn-primary': selectedDomicilio == key + 1 | 73 | 'btn-primary': selectedDomicilio == key + 1 |
74 | }" | 74 | }" |
75 | foca-focus="selectedDomicilio == {{key + 1}}" | 75 | foca-focus="selectedDomicilio == {{key + 1}}" |
76 | ng-keydown="itemDomicilio($event.keyCode)" | 76 | ng-keydown="itemDomicilio($event.keyCode)" |
77 | > | 77 | > |
78 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 78 | <i class="fa fa-arrow-right" aria-hidden="true"></i> |
79 | </button> | 79 | </button> |
80 | </td> | 80 | </td> |
81 | </tr> | 81 | </tr> |
82 | </tbody> | 82 | </tbody> |
83 | </table> | 83 | </table> |
84 | <nav ng-show="currentPageDomicilios.length > 0 && !ingreso"> | 84 | <nav ng-show="currentPageDomicilios.length > 0 && !ingreso"> |
85 | <ul class="pagination justify-content-end"> | 85 | <ul class="pagination pagination-sm mb-0 justify-content-end"> |
86 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 86 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
87 | <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> | 87 | <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> |
88 | <span aria-hidden="true">«</span> | 88 | <span aria-hidden="true">«</span> |
89 | <span class="sr-only">Anterior</span> | 89 | <span class="sr-only">Anterior</span> |
90 | </a> | 90 | </a> |
91 | </li> | 91 | </li> |
92 | <li | 92 | <li |
93 | class="page-item" | 93 | class="page-item" |
94 | ng-repeat="pagina in paginas" | 94 | ng-repeat="pagina in paginas" |
95 | ng-class="{'active': pagina == currentPage}" | 95 | ng-class="{'active': pagina == currentPage}" |
96 | > | 96 | > |
97 | <a | 97 | <a |
98 | class="page-link" | 98 | class="page-link" |
99 | href="#" | 99 | href="#" |
100 | ng-click="selectPage(pagina)" | 100 | ng-click="selectPage(pagina)" |
101 | ng-bind="pagina" | 101 | ng-bind="pagina" |
102 | ></a> | 102 | ></a> |
103 | </li> | 103 | </li> |
104 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 104 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
105 | <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> | 105 | <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> |
106 | <span aria-hidden="true">»</span> | 106 | <span aria-hidden="true">»</span> |
107 | <span class="sr-only">Siguiente</span> | 107 | <span class="sr-only">Siguiente</span> |
108 | </a> | 108 | </a> |
109 | </li> | 109 | </li> |
110 | </ul> | 110 | </ul> |
111 | </nav> | 111 | </nav> |
112 | </div> | 112 | </div> |
113 | <form name="formDomicilio" ng-show="ingreso"> | 113 | <form name="formDomicilio" ng-show="ingreso"> |
114 | <div class="row"> | 114 | <div class="row"> |
115 | <div class="col-4"> | 115 | <div class="col-4"> |
116 | <label>Tipo</label> | 116 | <label>Tipo</label> |
117 | <select | 117 | <select |
118 | class="form-control" | 118 | class="form-control" |
119 | ng-disabled="true" | 119 | ng-disabled="true" |
120 | > | 120 | > |
121 | <option ng-value="2">Entrega</option> | 121 | <option ng-value="2">Entrega</option> |
122 | </select> | 122 | </select> |
123 | </div> | 123 | </div> |
124 | <div class="col-8"> | 124 | <div class="col-8"> |
125 | <label>Titulo</label> | 125 | <label>Titulo</label> |
126 | <input | 126 | <input |
127 | type="text" | 127 | type="text" |
128 | foca-focus="ingreso" | 128 | foca-focus="ingreso" |
129 | class="form-control" | 129 | class="form-control" |
130 | ng-model="domicilio.titulo" | 130 | ng-model="domicilio.titulo" |
131 | placeholder="Ingrese título" | 131 | placeholder="Ingrese título" |
132 | ng-required="true" | 132 | ng-required="true" |
133 | teclado-virtual | 133 | teclado-virtual |
134 | /> | 134 | /> |
135 | </div> | 135 | </div> |
136 | <div class="col-9"> | 136 | <div class="col-9"> |
137 | <label>Calle</label> | 137 | <label>Calle</label> |
138 | <input | 138 | <input |
139 | type="text" | 139 | type="text" |
140 | class="form-control" | 140 | class="form-control" |
141 | ng-model="domicilio.calle" | 141 | ng-model="domicilio.calle" |
142 | placeholder="Ingrese calle" | 142 | placeholder="Ingrese calle" |
143 | ng-required="true" | 143 | ng-required="true" |
144 | /> | 144 | /> |
145 | </div> | 145 | </div> |
146 | <div class="col-3"> | 146 | <div class="col-3"> |
147 | <label>Nº</label> | 147 | <label>Nº</label> |
148 | <input | 148 | <input |
149 | type="text" | 149 | type="text" |
150 | class="form-control" | 150 | class="form-control" |
151 | ng-model="domicilio.numeroCalle" | 151 | ng-model="domicilio.numeroCalle" |
152 | placeholder="Ingrese Numero" | 152 | placeholder="Ingrese Numero" |
153 | ng-required="true" | 153 | ng-required="true" |
154 | teclado-virtual | 154 | teclado-virtual |
155 | /> | 155 | /> |
156 | </div> | 156 | </div> |
157 | <div class="col-6"> | 157 | <div class="col-6"> |
158 | <label>Localidad</label> | 158 | <label>Localidad</label> |
159 | <input | 159 | <input |
160 | type="text" | 160 | type="text" |
161 | class="form-control" | 161 | class="form-control" |
162 | ng-model="domicilio.localidad" | 162 | ng-model="domicilio.localidad" |
163 | placeholder="Ingrese localidad" | 163 | placeholder="Ingrese localidad" |
164 | ng-required="true" | 164 | ng-required="true" |
165 | teclado-virtual | 165 | teclado-virtual |
166 | /> | 166 | /> |
167 | </div> | 167 | </div> |
168 | <div class="col-6"> | 168 | <div class="col-6"> |
169 | <label>Provincia</label> | 169 | <label>Provincia</label> |
170 | <input | 170 | <input |
171 | type="text" | 171 | type="text" |
172 | class="form-control" | 172 | class="form-control" |
173 | ng-model="domicilio.provincia" | 173 | ng-model="domicilio.provincia" |
174 | placeholder="Ingrese provincia" | 174 | placeholder="Ingrese provincia" |
175 | ng-required="true" | 175 | ng-required="true" |
176 | /> | 176 | /> |
177 | </div> | 177 | </div> |
178 | </div> | 178 | </div> |
179 | </form> | 179 | </form> |
180 | </div> | 180 | </div> |
181 | <div class="modal-footer"> | 181 | <div class="modal-footer"> |
182 | <button | 182 | <button |
183 | ng-show="!ingreso" | 183 | ng-show="!ingreso" |
184 | class="btn btn-secondary" | 184 | class="btn btn-sm btn-secondary" |
185 | type="button" | 185 | type="button" |
186 | ng-click="cancel()" | 186 | ng-click="cancel()" |
187 | >Seleccionar otro cliente | 187 | >Seleccionar otro cliente |
188 | </button> | 188 | </button> |
189 | <button | 189 | <button |
190 | ng-show="ingreso" | 190 | ng-show="ingreso" |
191 | class="btn btn-secondary" | 191 | class="btn btn-secondary btn-sm" |
192 | type="button" | 192 | type="button" |
193 | ng-click="ingreso = !ingreso; domicilio = {}; contactos = [{}]" | 193 | ng-click="ingreso = !ingreso; domicilio = {}; contactos = [{}]" |
194 | >Cancelar | 194 | >Cancelar |
195 | </button> | 195 | </button> |
196 | <button | 196 | <button |
197 | ng-show="ingreso" | 197 | ng-show="ingreso" |
198 | class="btn btn-primary" | 198 | class="btn btn-sm btn-primary" |
199 | type="button" | 199 | type="button" |
200 | ng-click="agregarDomicilio()" | 200 | ng-click="agregarDomicilio()" |
201 | ng-disabled="!formDomicilio.$valid" | 201 | ng-disabled="!formDomicilio.$valid" |
202 | >Agregar domicilio | 202 | >Agregar domicilio |
203 | </button> | 203 | </button> |
204 | </div> | 204 | </div> |
205 | 205 |