Commit bf67f0746bc7bd95aabde99ed39411147d01b226
Exists in
master
Merge branch 'develop' of http://git.focasoftware.com/brodriguez/foca-botonera-principal
Showing
3 changed files
Show diff stats
package.json
1 | { | 1 | { |
2 | "name": "foca-botonera-principal", | 2 | "name": "foca-botonera-principal", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "Botonera principal", | 4 | "description": "Botonera principal", |
5 | "scripts": { | 5 | "scripts": { |
6 | "frefresh": "gulp uglify && cp tmp/foca-botonera-principal.js ../wrapper-facturador/node_modules/foca-botonera-principal/dist/foca-botonera-principal.min.js", | ||
7 | "refresh": "gulp uglify && cp tmp/foca-botonera-principal.js ../wrapper-demo/node_modules/foca-botonera-principal/dist/foca-botonera-principal.min.js", | ||
6 | "test": "echo \"Error: no test specified\" && exit 1", | 8 | "test": "echo \"Error: no test specified\" && exit 1", |
7 | "gulp-pre-commit": "gulp pre-commit", | 9 | "gulp-pre-commit": "gulp pre-commit", |
8 | "compile": "gulp uglify", | 10 | "compile": "gulp uglify", |
9 | "postinstall": "npm run compile && gulp clean-post-install", | 11 | "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" | 12 | "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" |
11 | }, | 13 | }, |
12 | "pre-commit": [ | 14 | "pre-commit": [ |
13 | "gulp-pre-commit" | 15 | "gulp-pre-commit" |
14 | ], | 16 | ], |
15 | "repository": { | 17 | "repository": { |
16 | "type": "git", | 18 | "type": "git", |
17 | "url": "https://debo.suite.repo/modulos-npm/foca-botonera-principal" | 19 | "url": "https://debo.suite.repo/modulos-npm/foca-botonera-principal" |
18 | }, | 20 | }, |
19 | "author": "Foca Software", | 21 | "author": "Foca Software", |
20 | "license": "ISC", | 22 | "license": "ISC", |
21 | "peerDependencies": { | 23 | "peerDependencies": { |
22 | "angular": "^1.7.4", | 24 | "angular": "^1.7.4", |
23 | "bootstrap": "^4.1.3", | 25 | "bootstrap": "^4.1.3", |
24 | "font-awesome": "^4.7.0", | 26 | "font-awesome": "^4.7.0", |
25 | "ui-bootstrap4": "^3.0.4", | 27 | "ui-bootstrap4": "^3.0.4", |
26 | "gulp": "^3.9.1", | 28 | "gulp": "^3.9.1", |
27 | "gulp-angular-templatecache": "^2.2.1", | 29 | "gulp-angular-templatecache": "^2.2.1", |
28 | "gulp-concat": "^2.6.1", | 30 | "gulp-concat": "^2.6.1", |
29 | "gulp-connect": "^5.6.1", | 31 | "gulp-connect": "^5.6.1", |
30 | "gulp-htmlmin": "^5.0.1", | 32 | "gulp-htmlmin": "^5.0.1", |
31 | "gulp-rename": "^1.4.0", | 33 | "gulp-rename": "^1.4.0", |
32 | "gulp-replace": "^1.0.0", | 34 | "gulp-replace": "^1.0.0", |
33 | "gulp-uglify": "^3.0.1", | 35 | "gulp-uglify": "^3.0.1", |
34 | "jquery": "^3.3.1", | 36 | "jquery": "^3.3.1", |
35 | "pump": "^3.0.0", | 37 | "pump": "^3.0.0", |
36 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git" | 38 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git" |
37 | }, | 39 | }, |
38 | "devDependencies": { | 40 | "devDependencies": { |
39 | "angular": "^1.7.5", | 41 | "angular": "^1.7.5", |
40 | "bootstrap": "^4.1.3", | 42 | "bootstrap": "^4.1.3", |
41 | "font-awesome": "^4.7.0", | 43 | "font-awesome": "^4.7.0", |
42 | "gulp": "^3.9.1", | 44 | "gulp": "^3.9.1", |
43 | "gulp-angular-templatecache": "^2.2.2", | 45 | "gulp-angular-templatecache": "^2.2.2", |
44 | "gulp-clean": "^0.4.0", | 46 | "gulp-clean": "^0.4.0", |
45 | "gulp-concat": "^2.6.1", | 47 | "gulp-concat": "^2.6.1", |
46 | "gulp-connect": "^5.6.1", | 48 | "gulp-connect": "^5.6.1", |
47 | "gulp-htmlmin": "^5.0.1", | 49 | "gulp-htmlmin": "^5.0.1", |
48 | "gulp-jshint": "^2.1.0", | 50 | "gulp-jshint": "^2.1.0", |
49 | "gulp-rename": "^1.4.0", | 51 | "gulp-rename": "^1.4.0", |
50 | "gulp-replace": "^1.0.0", | 52 | "gulp-replace": "^1.0.0", |
51 | "gulp-uglify": "^3.0.1", | 53 | "gulp-uglify": "^3.0.1", |
52 | "jasmine-core": "^3.3.0", | 54 | "jasmine-core": "^3.3.0", |
53 | "jquery": "^3.3.1", | 55 | "jquery": "^3.3.1", |
54 | "jshint": "^2.9.6", | 56 | "jshint": "^2.9.6", |
55 | "pre-commit": "^1.2.2", | 57 | "pre-commit": "^1.2.2", |
56 | "pump": "^3.0.0", | 58 | "pump": "^3.0.0", |
57 | "ui-bootstrap4": "^3.0.5", | 59 | "ui-bootstrap4": "^3.0.5", |
58 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git" | 60 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git" |
59 | } | 61 | } |
60 | } | 62 | } |
61 | 63 |
src/js/controller.js
1 | angular.module('focaBotoneraPrincipal') | 1 | angular.module('focaBotoneraPrincipal') |
2 | .controller('focaBotoneraPrincipalController', [ | 2 | .controller('focaBotoneraPrincipalController', [ |
3 | '$scope', '$rootScope', '$timeout', '$location', '$localStorage', | 3 | '$scope', '$rootScope', '$timeout', '$location', '$localStorage', |
4 | 'botones', 'focaModalService', 'APP', 'focaBotoneraLateralService', | 4 | 'botones', 'focaModalService', 'APP', 'focaBotoneraLateralService', |
5 | function($scope, $rootScope, $timeout, $location, $localStorage, | 5 | function($scope, $rootScope, $timeout, $location, $localStorage, |
6 | botones, focaModalService, APP, focaBotoneraLateralService) { | 6 | botones, focaModalService, APP, focaBotoneraLateralService) { |
7 | $scope.paginas = []; | 7 | $scope.paginas = []; |
8 | var botonesPorPagina = 10; | 8 | var botonesPorPagina = 10; |
9 | if(APP === 'distribuidor' || APP === 'transportista') { | 9 | if(APP === 'distribuidor' || APP === 'transportista') { |
10 | botonesPorPagina = 3; | 10 | botonesPorPagina = 3; |
11 | } | 11 | } |
12 | for(var i = 0; i < botones.data.length; i += botonesPorPagina){ | 12 | for(var i = 0; i < botones.data.length; i += botonesPorPagina) { |
13 | $scope.paginas.push(botones.data.slice(i, i + botonesPorPagina)); | 13 | $scope.paginas.push(botones.data.slice(i, i + botonesPorPagina)); |
14 | } | 14 | } |
15 | 15 | ||
16 | focaBotoneraLateralService.showGuardar(false); | 16 | focaBotoneraLateralService.showGuardar(false); |
17 | focaBotoneraLateralService.showPausar(false); | 17 | focaBotoneraLateralService.showPausar(false); |
18 | focaBotoneraLateralService.showSalir(false); | 18 | focaBotoneraLateralService.showSalir(false); |
19 | focaBotoneraLateralService.showCancelar(false); | 19 | focaBotoneraLateralService.showCancelar(false); |
20 | 20 | ||
21 | $scope.irA = function(accion) { | 21 | $scope.irA = function(accion) { |
22 | $location.path(accion); | 22 | $location.path(accion); |
23 | }; | 23 | }; |
24 | 24 | ||
25 | $scope.logout = function() { | 25 | $scope.logout = function() { |
26 | $location.path('/logout'); | 26 | $location.path('/logout'); |
27 | }; | 27 | }; |
28 | 28 | ||
29 | $scope.showTerminal = function() { | 29 | $scope.showTerminal = function() { |
30 | var key = $localStorage.terminalKey; | 30 | var key = $localStorage.terminalKey; |
31 | focaModalService.alert('SU TERMINAL ES: ' + key); | 31 | focaModalService.alert('SU TERMINAL ES: ' + key); |
32 | }; | 32 | }; |
33 | } | 33 | } |
34 | ]); | 34 | ]); |
35 | 35 |
src/views/foca-botonera-principal.html
1 | <div class="botonera-principal"> | 1 | <div class="botonera-principal"> |
2 | <div class="row"> | 2 | <div class="row mt-3 justify-content-center"> |
3 | <div class=" col-6"> | 3 | <div class="col-auto p-0"> |
4 | <img class="botonera-principal-logo" src="./img/logoMapa.png"/> | 4 | <img src="./img/logoMapa.png"/> |
5 | </div> | 5 | </div> |
6 | </div> | 6 | </div> |
7 | <div class="row"> | 7 | <div class="row"> |
8 | <div class="col-12 mb-3"> | 8 | <div class="col-12 mb-3"> |
9 | <swiper on-init="inicioSwiper"> | 9 | <swiper on-init="inicioSwiper"> |
10 | <slides> | 10 | <slides> |
11 | <slide ng-repeat="pagina in paginas"> | 11 | <slide ng-repeat="(keyPagina, pagina) in paginas"> |
12 | <menu class="botonera-principal-menu"> | 12 | <menu class="botonera-principal-menu"> |
13 | <menuitem ng-class="boton.clase" ng-repeat="boton in pagina" ng-show="boton.accion != '/venta-hoja-ruta/lista'"> | 13 | <menuitem |
14 | <button ng-click="irA(boton.accion)"> | 14 | ng-class="boton.clase" |
15 | ng-repeat="(keyBoton, boton) in pagina" | ||
16 | ng-show="boton.accion != '/venta-hoja-ruta/lista'"> | ||
17 | <button | ||
18 | foca-focus="keyPagina === 0 && keyBoton === 0" | ||
19 | ng-click="irA(boton.accion)"> | ||
15 | <span ng-bind="boton.texto"></span> | 20 | <span ng-bind="boton.texto"></span> |
16 | </button> | 21 | </button> |
17 | </menuitem> | 22 | </menuitem> |
18 | </menu> | 23 | </menu> |
19 | </slide> | 24 | </slide> |
20 | </slides> | 25 | </slides> |
21 | <prev></prev> | 26 | <prev></prev> |
22 | <next></next> | 27 | <next></next> |
23 | <pagination></pagination> | 28 | <pagination></pagination> |
24 | </swiper> | 29 | </swiper> |
25 | <div class="d-none d-sm-block"> | 30 | <div class="d-none d-sm-block"> |
26 | <a | 31 | <a |
27 | class="btn btn-outline-dark mt-5 btn-lg" | 32 | class="btn btn-outline-dark mt-5 btn-lg" |
28 | href="javascript:void()" | 33 | href="javascript:void()" |
29 | ng-click="showTerminal()" | 34 | ng-click="showTerminal()" |
30 | > | 35 | > |
31 | <i class="fa fa-info-circle" aria-hidden="true"></i> | 36 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
32 | </a> | 37 | </a> |
33 | <a class="btn btn-outline-dark mt-5 btn-lg" | 38 | <a class="btn btn-outline-dark mt-5 btn-lg" |
34 | href="javascript:void()" | 39 | href="javascript:void()" |
35 | ng-click="logout()" | 40 | ng-click="logout()" |
36 | > | 41 | > |
37 | <i class="fa fa-power-off" aria-hidden="true"></i> | 42 | <i class="fa fa-power-off" aria-hidden="true"></i> |
38 | </a> | 43 | </a> |
39 | </div> | 44 | </div> |
40 | </div> | 45 | </div> |
41 | </div> | 46 | </div> |
42 | <div class="row d-md-none fixed-bottom"> | 47 | <div class="row d-md-none fixed-bottom"> |
43 | <div class="w-100 d-flex px-3 acciones-mobile"> | 48 | <div class="w-100 d-flex px-3 acciones-mobile"> |
44 | <a | 49 | <a |
45 | class="btn btn-outline-dark btn-lg mr-2" | 50 | class="btn btn-outline-dark btn-lg mr-2" |
46 | href="javascript:void()" | 51 | href="javascript:void()" |
47 | ng-click="showTerminal()" | 52 | ng-click="showTerminal()" |
48 | > | 53 | > |
49 | <i class="fa fa-info-circle" aria-hidden="true"></i> | 54 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
50 | </a> | 55 | </a> |
51 | <a class="btn btn-outline-dark btn-lg" | 56 | <a class="btn btn-outline-dark btn-lg" |
52 | href="javascript:void()" | 57 | href="javascript:void()" |
53 | ng-click="logout()" | 58 | ng-click="logout()" |
54 | > | 59 | > |
55 | <i class="fa fa-power-off" aria-hidden="true"></i> | 60 | <i class="fa fa-power-off" aria-hidden="true"></i> |
56 | </a> | 61 | </a> |
57 | </div> | 62 | </div> |
58 | </div> | 63 | </div> |
59 | </div> | 64 | </div> |
60 | 65 |