Commit 172046c934d2f939a414a0f801aa1305cb65fa23
1 parent
a7f982c80c
Exists in
master
and in
1 other branch
buscador en header, paginado en footer, cambio icons
Showing
2 changed files
with
67 additions
and
47 deletions
Show diff stats
package.json
1 | { | 1 | { |
2 | "name": "foca-modal-domicilio", | 2 | "name": "foca-modal-domicilio", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "Modal para busqueda de domicilios", | 4 | "description": "Modal para busqueda de domicilios", |
5 | "scripts": { | 5 | "scripts": { |
6 | "test": "echo \"Error: no test specified\" && exit 1", | 6 | "test": "echo \"Error: no test specified\" && exit 1", |
7 | "gulp-pre-commit": "gulp pre-commit", | 7 | "gulp-pre-commit": "gulp pre-commit", |
8 | "compile": "gulp uglify", | 8 | "compile": "gulp uglify", |
9 | "postinstall": "npm run compile && gulp clean-post-install", | 9 | "postinstall": "npm run compile && gulp clean-post-install", |
10 | "install-dev": "npm install -D angular bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+https://debo.suite.repo/modulos-npm/foca-directivas" | 10 | "install-dev": "npm install -D angular bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+ssh://git@git.focasoftware.com:npm/foca-directivas" |
11 | }, | 11 | }, |
12 | "pre-commit": [ | 12 | "pre-commit": [ |
13 | "gulp-pre-commit" | 13 | "gulp-pre-commit" |
14 | ], | 14 | ], |
15 | "repository": { | 15 | "repository": { |
16 | "type": "git", | 16 | "type": "git", |
17 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git" | 17 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-domicilio.git" |
18 | }, | 18 | }, |
19 | "author": "Foca Software", | 19 | "author": "Foca Software", |
20 | "license": "ISC", | 20 | "license": "ISC", |
21 | "peerDependencies": { | 21 | "peerDependencies": { |
22 | "angular": "^1.7.4", | 22 | "angular": "^1.7.4", |
23 | "bootstrap": "^4.1.3", | 23 | "bootstrap": "^4.1.3", |
24 | "font-awesome": "^4.7.0", | 24 | "font-awesome": "^4.7.0", |
25 | "ui-bootstrap4": "^3.0.4", | 25 | "ui-bootstrap4": "^3.0.4", |
26 | "gulp": "^3.9.1", | 26 | "gulp": "^3.9.1", |
27 | "gulp-angular-templatecache": "^2.2.1", | 27 | "gulp-angular-templatecache": "^2.2.1", |
28 | "gulp-concat": "^2.6.1", | 28 | "gulp-concat": "^2.6.1", |
29 | "gulp-connect": "^5.6.1", | 29 | "gulp-connect": "^5.6.1", |
30 | "gulp-htmlmin": "^5.0.1", | 30 | "gulp-htmlmin": "^5.0.1", |
31 | "gulp-rename": "^1.4.0", | 31 | "gulp-rename": "^1.4.0", |
32 | "gulp-replace": "^1.0.0", | 32 | "gulp-replace": "^1.0.0", |
33 | "gulp-uglify": "^3.0.1", | 33 | "gulp-uglify": "^3.0.1", |
34 | "jquery": "^3.3.1", | 34 | "jquery": "^3.3.1", |
35 | "pump": "^3.0.0", | 35 | "pump": "^3.0.0", |
36 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas" | 36 | "foca-directivas": "git+ssh://git@git.focasoftware.com:npm/foca-directivas" |
37 | }, | 37 | }, |
38 | "devDependencies": { | 38 | "devDependencies": { |
39 | "angular": "^1.7.5", | 39 | "angular": "^1.7.5", |
40 | "bootstrap": "^4.1.3", | 40 | "bootstrap": "^4.1.3", |
41 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas", | 41 | "foca-directivas": "git+ssh://git@git.focasoftware.com:npm/foca-directivas", |
42 | "font-awesome": "^4.7.0", | 42 | "font-awesome": "^4.7.0", |
43 | "gulp": "^3.9.1", | 43 | "gulp": "^3.9.1", |
44 | "gulp-angular-templatecache": "^2.2.3", | 44 | "gulp-angular-templatecache": "^2.2.3", |
45 | "gulp-clean": "^0.4.0", | 45 | "gulp-clean": "^0.4.0", |
46 | "gulp-concat": "^2.6.1", | 46 | "gulp-concat": "^2.6.1", |
47 | "gulp-connect": "^5.6.1", | 47 | "gulp-connect": "^5.6.1", |
48 | "gulp-htmlmin": "^5.0.1", | 48 | "gulp-htmlmin": "^5.0.1", |
49 | "gulp-jshint": "^2.1.0", | 49 | "gulp-jshint": "^2.1.0", |
50 | "gulp-rename": "^1.4.0", | 50 | "gulp-rename": "^1.4.0", |
51 | "gulp-replace": "^1.0.0", | 51 | "gulp-replace": "^1.0.0", |
52 | "gulp-uglify": "^3.0.1", | 52 | "gulp-uglify": "^3.0.1", |
53 | "jasmine-core": "^3.3.0", | 53 | "jasmine-core": "^3.3.0", |
54 | "jquery": "^3.3.1", | 54 | "jquery": "^3.3.1", |
55 | "jshint": "^2.9.6", | 55 | "jshint": "^2.9.6", |
56 | "pre-commit": "^1.2.2", | 56 | "pre-commit": "^1.2.2", |
57 | "pump": "^3.0.0", | 57 | "pump": "^3.0.0", |
58 | "ui-bootstrap4": "^3.0.5" | 58 | "ui-bootstrap4": "^3.0.5" |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 |
src/views/modal-domicilio.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <h5 class="modal-title">Busqueda de Domicilios</h5> | 2 | <div class="row w-100"> |
3 | <div class="col-lg-6"> | ||
4 | <h5 class="modal-title my-1">Búsqueda de Domicilios</h5> | ||
5 | </div> | ||
6 | <div class="input-group col-lg-6 pr-0 my-2"> | ||
7 | <input | ||
8 | type="text" | ||
9 | class="form-control form-control-sm" | ||
10 | placeholder="Búsqueda" | ||
11 | ng-model="filters" | ||
12 | ng-change="search()" | ||
13 | ng-keydown="busquedaDown($event.keyCode)" | ||
14 | ng-keypress="busquedaPress($event.keyCode)" | ||
15 | foca-focus="selectedDomicilio == -1" | ||
16 | ng-focus="selectedDomicilio = -1" | ||
17 | teclado-virtual | ||
18 | > | ||
19 | <div class="input-group-append"> | ||
20 | <button | ||
21 | ladda="searchLoading" | ||
22 | class="btn btn-outline-secondary" | ||
23 | type="button" | ||
24 | > | ||
25 | <i class="fa fa-search" aria-hidden="true"></i> | ||
26 | </button> | ||
27 | </div> | ||
28 | </div> | ||
29 | </div> | ||
3 | </div> | 30 | </div> |
4 | <div class="modal-body" id="modal-body"> | 31 | <div class="modal-body" id="modal-body"> |
5 | <div class="input-group" ng-show="!ingreso"> | 32 | |
6 | <input | 33 | <div ng-show="!primerBusqueda"> |
7 | type="text" | 34 | Debe realizar una primer búsqueda. |
8 | class="form-control form-control-sm" | 35 | </div> |
9 | placeholder="Busqueda" | 36 | |
10 | ng-model="filters" | 37 | <div ng-show="!ingreso"> |
11 | ng-change="search()" | ||
12 | ng-keydown="busquedaDown($event.keyCode)" | ||
13 | ng-keypress="busquedaPress($event.keyCode)" | ||
14 | foca-focus="selectedDomicilio == -1" | ||
15 | ng-focus="selectedDomicilio = -1" | ||
16 | teclado-virtual | ||
17 | > | ||
18 | <table ng-show="!ingreso" class="table table-striped table-sm"> | 38 | <table ng-show="!ingreso" class="table table-striped table-sm"> |
19 | <thead> | 39 | <thead> |
20 | <tr> | 40 | <tr> |
21 | <th>Titulo</th> | 41 | <th>Titulo</th> |
22 | <th>Calle</th> | 42 | <th>Calle</th> |
23 | <th>Localidad</th> | 43 | <th>Localidad</th> |
24 | <th>Provincia</th> | 44 | <th>Provincia</th> |
25 | <th></th> | 45 | <th></th> |
26 | </tr> | 46 | </tr> |
27 | </thead> | 47 | </thead> |
28 | <tbody> | 48 | <tbody> |
29 | <tr ng-show="currentPageDomicilios.length == 0 && primerBusqueda"> | 49 | <tr ng-show="currentPageDomicilios.length == 0 && primerBusqueda"> |
30 | <td colspan="5"> | 50 | <td colspan="5"> |
31 | No se encontraron resultados. | 51 | No se encontraron resultados. |
32 | </td> | 52 | </td> |
33 | </tr> | 53 | </tr> |
34 | <tr> | 54 | <tr> |
35 | <td colspan="4" ng-show="!ingreso"> | 55 | <td colspan="4" ng-show="!ingreso"> |
36 | <input | 56 | <input |
37 | class="form-control form-control-sm" | 57 | class="form-control form-control-sm" |
38 | type="text" | 58 | type="text" |
39 | placeholder="Nuevo domicilio" | 59 | placeholder="Nuevo domicilio" |
40 | readonly | 60 | readonly |
41 | ng-click="ingreso = !ingreso" | 61 | ng-click="ingreso = !ingreso" |
42 | /> | 62 | /> |
43 | </td> | 63 | </td> |
44 | <td colspan="1" ng-show="!ingreso"> | 64 | <td colspan="1" ng-show="!ingreso"> |
45 | <button | 65 | <button |
46 | type="button" | 66 | type="button" |
47 | class="btn btn-sm p-1 float-right" | 67 | class="btn btn-sm p-1 float-right" |
48 | ng-class="{ | 68 | ng-class="{ |
49 | 'btn-secondary': selectedDomicilio != 0, | 69 | 'btn-secondary': selectedDomicilio != 0, |
50 | 'btn-primary': selectedDomicilio == 0 | 70 | 'btn-primary': selectedDomicilio == 0 |
51 | }" | 71 | }" |
52 | foca-focus="selectedDomicilio == 0" | 72 | foca-focus="selectedDomicilio == 0" |
53 | ng-keydown="itemDomicilio($event.keyCode)" | 73 | ng-keydown="itemDomicilio($event.keyCode)" |
54 | ng-click="ingreso = !ingreso" | 74 | ng-click="ingreso = !ingreso" |
55 | > | 75 | > |
56 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 76 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
57 | </button> | 77 | </button> |
58 | </td> | 78 | </td> |
59 | </tr> | 79 | </tr> |
60 | <tr class="selectable" | 80 | <tr class="selectable" |
61 | ng-repeat="(key,domicilio) in currentPageDomicilios" | 81 | ng-repeat="(key,domicilio) in currentPageDomicilios" |
62 | ng-click="select(domicilio)"> | 82 | ng-click="select(domicilio)"> |
63 | <td ng-bind="domicilio.titulo"></td> | 83 | <td ng-bind="domicilio.titulo"></td> |
64 | <td ng-bind="domicilio.Calle + ' ' + domicilio.Numero"></td> | 84 | <td ng-bind="domicilio.Calle + ' ' + domicilio.Numero"></td> |
65 | <td ng-bind="domicilio.Localidad"></td> | 85 | <td ng-bind="domicilio.Localidad"></td> |
66 | <td ng-bind="domicilio.Provincia"></td> | 86 | <td ng-bind="domicilio.Provincia"></td> |
67 | <td> | 87 | <td> |
68 | <button | 88 | <button |
69 | type="button" | 89 | type="button" |
70 | class="btn btn-sm p-1 float-right" | 90 | class="btn btn-sm p-1 float-right" |
71 | ng-class="{ | 91 | ng-class="{ |
72 | 'btn-secondary': selectedDomicilio != key + 1, | 92 | 'btn-secondary': selectedDomicilio != key + 1, |
73 | 'btn-primary': selectedDomicilio == key + 1 | 93 | 'btn-primary': selectedDomicilio == key + 1 |
74 | }" | 94 | }" |
75 | foca-focus="selectedDomicilio == {{key + 1}}" | 95 | foca-focus="selectedDomicilio == {{key + 1}}" |
76 | ng-keydown="itemDomicilio($event.keyCode)" | 96 | ng-keydown="itemDomicilio($event.keyCode)" |
77 | > | 97 | > |
78 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 98 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
79 | </button> | 99 | </button> |
80 | </td> | 100 | </td> |
81 | </tr> | 101 | </tr> |
82 | </tbody> | 102 | </tbody> |
83 | </table> | 103 | </table> |
84 | <nav ng-show="currentPageDomicilios.length > 0 && !ingreso"> | ||
85 | <ul class="pagination pagination-sm mb-0 justify-content-end"> | ||
86 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | ||
87 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | ||
88 | <span aria-hidden="true">«</span> | ||
89 | <span class="sr-only">Anterior</span> | ||
90 | </a> | ||
91 | </li> | ||
92 | <li | ||
93 | class="page-item" | ||
94 | ng-repeat="pagina in paginas" | ||
95 | ng-class="{'active': pagina == currentPage}" | ||
96 | > | ||
97 | <a | ||
98 | class="page-link" | ||
99 | href="javascript:void();" | ||
100 | ng-click="selectPage(pagina)" | ||
101 | ng-bind="pagina" | ||
102 | ></a> | ||
103 | </li> | ||
104 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | ||
105 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> | ||
106 | <span aria-hidden="true">»</span> | ||
107 | <span class="sr-only">Siguiente</span> | ||
108 | </a> | ||
109 | </li> | ||
110 | </ul> | ||
111 | </nav> | ||
112 | </div> | 104 | </div> |
113 | <form name="formDomicilio" ng-show="ingreso"> | 105 | <form name="formDomicilio" ng-show="ingreso"> |
114 | <div class="row"> | 106 | <div class="row"> |
115 | <div class="col-4"> | 107 | <div class="col-4"> |
116 | <label>Tipo</label> | 108 | <label>Tipo</label> |
117 | <select | 109 | <select |
118 | class="form-control" | 110 | class="form-control" |
119 | ng-disabled="true" | 111 | ng-disabled="true" |
120 | > | 112 | > |
121 | <option ng-value="2">Entrega</option> | 113 | <option ng-value="2">Entrega</option> |
122 | </select> | 114 | </select> |
123 | </div> | 115 | </div> |
124 | <div class="col-8"> | 116 | <div class="col-8"> |
125 | <label>Titulo</label> | 117 | <label>Titulo</label> |
126 | <input | 118 | <input |
127 | type="text" | 119 | type="text" |
128 | foca-focus="ingreso" | 120 | foca-focus="ingreso" |
129 | class="form-control" | 121 | class="form-control" |
130 | ng-model="domicilio.titulo" | 122 | ng-model="domicilio.titulo" |
131 | placeholder="Ingrese título" | 123 | placeholder="Ingrese título" |
132 | ng-required="true" | 124 | ng-required="true" |
133 | teclado-virtual | 125 | teclado-virtual |
134 | /> | 126 | /> |
135 | </div> | 127 | </div> |
136 | <div class="col-9"> | 128 | <div class="col-9"> |
137 | <label>Calle</label> | 129 | <label>Calle</label> |
138 | <input | 130 | <input |
139 | type="text" | 131 | type="text" |
140 | class="form-control" | 132 | class="form-control" |
141 | ng-model="domicilio.calle" | 133 | ng-model="domicilio.calle" |
142 | placeholder="Ingrese calle" | 134 | placeholder="Ingrese calle" |
143 | ng-required="true" | 135 | ng-required="true" |
144 | /> | 136 | /> |
145 | </div> | 137 | </div> |
146 | <div class="col-3"> | 138 | <div class="col-3"> |
147 | <label>Nº</label> | 139 | <label>Nº</label> |
148 | <input | 140 | <input |
149 | type="text" | 141 | type="text" |
150 | class="form-control" | 142 | class="form-control" |
151 | ng-model="domicilio.numeroCalle" | 143 | ng-model="domicilio.numeroCalle" |
152 | placeholder="Ingrese Numero" | 144 | placeholder="Ingrese Numero" |
153 | ng-required="true" | 145 | ng-required="true" |
154 | teclado-virtual | 146 | teclado-virtual |
155 | /> | 147 | /> |
156 | </div> | 148 | </div> |
157 | <div class="col-6"> | 149 | <div class="col-6"> |
158 | <label>Localidad</label> | 150 | <label>Localidad</label> |
159 | <input | 151 | <input |
160 | type="text" | 152 | type="text" |
161 | class="form-control" | 153 | class="form-control" |
162 | ng-model="domicilio.localidad" | 154 | ng-model="domicilio.localidad" |
163 | placeholder="Ingrese localidad" | 155 | placeholder="Ingrese localidad" |
164 | ng-required="true" | 156 | ng-required="true" |
165 | teclado-virtual | 157 | teclado-virtual |
166 | /> | 158 | /> |
167 | </div> | 159 | </div> |
168 | <div class="col-6"> | 160 | <div class="col-6"> |
169 | <label>Provincia</label> | 161 | <label>Provincia</label> |
170 | <input | 162 | <input |
171 | type="text" | 163 | type="text" |
172 | class="form-control" | 164 | class="form-control" |
173 | ng-model="domicilio.provincia" | 165 | ng-model="domicilio.provincia" |
174 | placeholder="Ingrese provincia" | 166 | placeholder="Ingrese provincia" |
175 | ng-required="true" | 167 | ng-required="true" |
176 | /> | 168 | /> |
177 | </div> | 169 | </div> |
178 | </div> | 170 | </div> |
179 | </form> | 171 | </form> |
180 | </div> | 172 | </div> |
181 | <div class="modal-footer"> | 173 | <div class="modal-footer"> |
174 | <nav ng-show="currentPageDomicilios.length > 0 && !ingreso" class="mr-auto"> | ||
175 | <ul class="pagination pagination-sm mb-0 justify-content-end"> | ||
176 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | ||
177 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | ||
178 | <span aria-hidden="true">«</span> | ||
179 | <span class="sr-only">Anterior</span> | ||
180 | </a> | ||
181 | </li> | ||
182 | <li | ||
183 | class="page-item" | ||
184 | ng-repeat="pagina in paginas" | ||
185 | ng-class="{'active': pagina == currentPage}" | ||
186 | > | ||
187 | <a | ||
188 | class="page-link" | ||
189 | href="javascript:void();" | ||
190 | ng-click="selectPage(pagina)" |