Compare View
Commits (20)
-
# Conflicts: # src/views/foca-botonera-principal.html
-
Master(mpuebla) See merge request !8
-
Master(mpuebla) Este cambio no afecta a distribuidor. See merge request !9
-
Master(benjamin) See merge request !12
-
Master(benjamin) See merge request !13
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 | "refresh": "gulp uglify && cp tmp/foca-botonera-principal.js ../wrapper-demo/node_modules/foca-botonera-principal/dist/foca-botonera-principal.min.js", | 8 | "test": "echo \"Error: no test specified\" && exit 1", |
| 7 | "frefresh": "gulp uglify && cp tmp/foca-botonera-principal.js ../wrapper-facturador/node_modules/foca-botonera-principal/dist/foca-botonera-principal.min.js", | 9 | "gulp-pre-commit": "gulp pre-commit", |
| 8 | "test": "echo \"Error: no test specified\" && exit 1", | 10 | "compile": "gulp uglify", |
| 9 | "gulp-pre-commit": "gulp pre-commit", | 11 | "postinstall": "npm run compile && gulp clean-post-install", |
| 10 | "compile": "gulp uglify", | 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 | "postinstall": "npm run compile && gulp clean-post-install", | 13 | }, |
| 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" | 14 | "pre-commit": [ |
| 13 | }, | 15 | "gulp-pre-commit" |
| 14 | "pre-commit": [ | 16 | ], |
| 15 | "gulp-pre-commit" | 17 | "repository": { |
| 16 | ], | 18 | "type": "git", |
| 17 | "repository": { | 19 | "url": "https://debo.suite.repo/modulos-npm/foca-botonera-principal" |
| 18 | "type": "git", | 20 | }, |
| 19 | "url": "https://debo.suite.repo/modulos-npm/foca-botonera-principal" | 21 | "author": "Foca Software", |
| 20 | }, | 22 | "license": "ISC", |
| 21 | "author": "Foca Software", | 23 | "peerDependencies": { |
| 22 | "license": "ISC", | 24 | "angular": "^1.7.4", |
| 23 | "peerDependencies": { | 25 | "bootstrap": "^4.1.3", |
| 24 | "angular": "^1.7.4", | 26 | "font-awesome": "^4.7.0", |
| 25 | "bootstrap": "^4.1.3", | 27 | "ui-bootstrap4": "^3.0.4", |
| 26 | "font-awesome": "^4.7.0", | 28 | "gulp": "^3.9.1", |
| 27 | "ui-bootstrap4": "^3.0.4", | 29 | "gulp-angular-templatecache": "^2.2.1", |
| 28 | "gulp": "^3.9.1", | 30 | "gulp-concat": "^2.6.1", |
| 29 | "gulp-angular-templatecache": "^2.2.1", | 31 | "gulp-connect": "^5.6.1", |
| 30 | "gulp-concat": "^2.6.1", | 32 | "gulp-htmlmin": "^5.0.1", |
| 31 | "gulp-connect": "^5.6.1", | 33 | "gulp-rename": "^1.4.0", |
| 32 | "gulp-htmlmin": "^5.0.1", | 34 | "gulp-replace": "^1.0.0", |
| 33 | "gulp-rename": "^1.4.0", | 35 | "gulp-uglify": "^3.0.1", |
| 34 | "gulp-replace": "^1.0.0", | 36 | "jquery": "^3.3.1", |
| 35 | "gulp-uglify": "^3.0.1", | 37 | "pump": "^3.0.0", |
| 36 | "jquery": "^3.3.1", | 38 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git" |
| 37 | "pump": "^3.0.0", | 39 | }, |
| 38 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git" | 40 | "devDependencies": { |
| 39 | }, | 41 | "angular": "^1.7.5", |
| 40 | "devDependencies": { | 42 | "bootstrap": "^4.1.3", |
| 41 | "angular": "^1.7.5", | 43 | "font-awesome": "^4.7.0", |
| 42 | "bootstrap": "^4.1.3", | 44 | "gulp": "^3.9.1", |
| 43 | "font-awesome": "^4.7.0", | 45 | "gulp-angular-templatecache": "^2.2.2", |
| 44 | "gulp": "^3.9.1", | 46 | "gulp-clean": "^0.4.0", |
| 45 | "gulp-angular-templatecache": "^2.2.2", | 47 | "gulp-concat": "^2.6.1", |
| 46 | "gulp-clean": "^0.4.0", | 48 | "gulp-connect": "^5.6.1", |
| 47 | "gulp-concat": "^2.6.1", | 49 | "gulp-htmlmin": "^5.0.1", |
| 48 | "gulp-connect": "^5.6.1", | 50 | "gulp-jshint": "^2.1.0", |
| 49 | "gulp-htmlmin": "^5.0.1", | 51 | "gulp-rename": "^1.4.0", |
| 50 | "gulp-jshint": "^2.1.0", | 52 | "gulp-replace": "^1.0.0", |
| 51 | "gulp-rename": "^1.4.0", | 53 | "gulp-uglify": "^3.0.1", |
| 52 | "gulp-replace": "^1.0.0", | 54 | "jasmine-core": "^3.3.0", |
| 53 | "gulp-uglify": "^3.0.1", | 55 | "jquery": "^3.3.1", |
| 54 | "jasmine-core": "^3.3.0", | 56 | "jshint": "^2.9.6", |
| 55 | "jquery": "^3.3.1", | 57 | "pre-commit": "^1.2.2", |
| 56 | "jshint": "^2.9.6", | 58 | "pump": "^3.0.0", |
| 57 | "pre-commit": "^1.2.2", | 59 | "ui-bootstrap4": "^3.0.5", |
| 58 | "pump": "^3.0.0", | 60 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git" |
| 59 | "ui-bootstrap4": "^3.0.5", | 61 | } |
| 60 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git" | 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.showPagar(false); | ||
| 17 | focaBotoneraLateralService.showPagar(false); | 18 | focaBotoneraLateralService.showPausar(false); |
| 18 | focaBotoneraLateralService.showPausar(false); | 19 | focaBotoneraLateralService.showSalir(false); |
| 19 | focaBotoneraLateralService.showSalir(false); | 20 | focaBotoneraLateralService.showCancelar(false); |
| 20 | focaBotoneraLateralService.showCancelar(false); | 21 | |
| 21 | 22 | $scope.rutas = $localStorage.rutas ? JSON.parse($localStorage.rutas) : []; | |
| 23 | |||
| 24 | $scope.irA = function (accion) { | ||
| 22 | $scope.irA = function(accion) { | 25 | $location.path(accion); |
| 23 | $location.path(accion); | 26 | }; |
| 24 | }; | 27 | |
| 25 | 28 | $scope.logout = function () { | |
| 26 | $scope.logout = function() { | 29 | $location.path('/logout'); |
| 27 | $location.path('/logout'); | 30 | }; |
| 28 | }; | 31 | |
| 29 | 32 | $scope.showTerminal = function () { | |
| 30 | $scope.showTerminal = function() { | 33 | var key = $localStorage.terminalKey; |
| 31 | var key = $localStorage.terminalKey; | 34 | focaModalService.info('Su terminal es: ' + key); |
| 32 | focaModalService.alert('SU TERMINAL ES: ' + key); | 35 | }; |
| 36 | |||
| 33 | }; | 37 | } |
| 34 | } | 38 | ]); |
| 35 | ]); | 39 |
src/views/foca-botonera-principal.html
| 1 | <div class="botonera-principal"> | 1 | <div class="botonera-principal"> |
| 2 | <div class="row"> | 2 | <div class="d-flex"> |
| 3 | <div class=" col-6"> | 3 | <div ng-if="rutas.length > 0" class="ml-auto dropdown"> |
| 4 | <img class="botonera-principal-logo" src="./img/logoMapa.png"/> | 4 | <button |
| 5 | class="m-0 btn-tareas-pausadas dropdown-toggle" | ||
| 6 | type="button" | ||
| 7 | id="dropdownMenuButton" | ||
| 8 | data-toggle="dropdown" | ||
| 9 | aria-haspopup="true" | ||
| 10 | aria-expanded="false" | ||
| 11 | > | ||
| 12 | Tareas Pausadas | ||
| 13 | </button> | ||
| 14 | <div class="dropdown-tareas-pausadas dropdown-menu" aria-labelledby="dropdownMenuButton"> | ||
| 15 | <a | ||
| 16 | ng-click="irA(ruta)" | ||
| 17 | ng-repeat="ruta in rutas track by $index" | ||
| 18 | class="items-dropdown dropdown-item m-1"> | ||
| 19 | Volver a: {{ruta}} | ||
| 20 | </a> | ||
| 21 | </div> | ||
| 22 | </div> | ||
| 23 | </div> | ||
| 24 | <div class="row mt-3 justify-content-center"> | ||
| 25 | <div class="col-auto p-0"> | ||
| 26 | <img src="./img/logoMapa.png" /> | ||
| 5 | </div> | 27 | </div> |
| 6 | </div> | 28 | </div> |
| 7 | <div class="row"> | 29 | <div class="row"> |
| 8 | <div class="col-12 mb-3"> | 30 | <div class="col-12 mb-3"> |
| 9 | <swiper on-init="inicioSwiper"> | 31 | <swiper on-init="inicioSwiper"> |
| 10 | <slides> | 32 | <slides> |
| 11 | <slide ng-repeat="pagina in paginas"> | 33 | <slide ng-repeat="(keyPagina, pagina) in paginas"> |
| 12 | <menu class="botonera-principal-menu"> | 34 | <menu class="botonera-principal-menu"> |
| 13 | <menuitem ng-class="boton.clase" ng-repeat="boton in pagina" ng-show="boton.accion != '/venta-hoja-ruta/lista'"> | 35 | <menuitem |
| 14 | <button ng-click="irA(boton.accion)"> | 36 | ng-class="boton.clase" |
| 37 | ng-repeat="(keyBoton, boton) in pagina" | ||
| 38 | ng-show="boton.accion != '/venta-hoja-ruta/lista'" | ||
| 39 | > | ||
| 40 | <button | ||
| 41 | foca-focus="keyPagina === 0 && keyBoton === 0" | ||
| 42 | ng-click="irA(boton.accion)" | ||
| 43 | > | ||
| 15 | <span ng-bind="boton.texto"></span> | 44 | <span ng-bind="boton.texto"></span> |
| 16 | </button> | 45 | </button> |
| 17 | </menuitem> | 46 | </menuitem> |
| 18 | </menu> | 47 | </menu> |
| 19 | </slide> | 48 | </slide> |
| 20 | </slides> | 49 | </slides> |
| 21 | <prev></prev> | 50 | <prev></prev> |
| 22 | <next></next> | 51 | <next></next> |
| 23 | <pagination></pagination> | 52 | <pagination></pagination> |
| 24 | </swiper> | 53 | </swiper> |
| 25 | <div class="d-none d-sm-block"> | 54 | <div class="d-none d-sm-block"> |
| 26 | <a | 55 | <a |
| 27 | class="btn btn-outline-dark mt-5 btn-lg" | 56 | class="btn btn-outline-dark mt-5 btn-lg" |
| 28 | href="javascript:void()" | 57 | href="javascript:void()" |
| 29 | ng-click="showTerminal()" | 58 | ng-click="showTerminal()" |
| 30 | > | 59 | > |
| 31 | <i class="fa fa-info-circle" aria-hidden="true"></i> | 60 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
| 32 | </a> | 61 | </a> |
| 33 | <a class="btn btn-outline-dark mt-5 btn-lg" | 62 | <a |
| 34 | href="javascript:void()" | 63 | class="btn btn-outline-dark mt-5 btn-lg" |
| 35 | ng-click="logout()" | 64 | href="javascript:void()" |
| 36 | > | 65 | ng-click="logout()"> |
| 37 | <i class="fa fa-power-off" aria-hidden="true"></i> | 66 | <i class="fa fa-power-off" aria-hidden="true"></i> |
| 38 | </a> | 67 | </a> |
| 39 | </div> | 68 | </div> |
| 40 | </div> | 69 | </div> |
| 41 | </div> | 70 | </div> |
| 42 | <div class="row d-md-none fixed-bottom"> | 71 | <div class="row d-md-none fixed-bottom"> |
| 43 | <div class="w-100 d-flex px-3 acciones-mobile"> | 72 | <div class="w-100 d-flex px-3 acciones-mobile"> |
| 44 | <a | 73 | <a |
| 45 | class="btn btn-outline-dark btn-lg mr-2" | 74 | class="btn btn-outline-dark btn-lg mr-2" |
| 46 | href="javascript:void()" | 75 | href="javascript:void()" |
| 47 | ng-click="showTerminal()" | 76 | ng-click="showTerminal()"> |
| 48 | > | ||
| 49 | <i class="fa fa-info-circle" aria-hidden="true"></i> | 77 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
| 50 | </a> | 78 | </a> |
| 51 | <a class="btn btn-outline-dark btn-lg" | 79 | <a |
| 80 | class="btn btn-outline-dark btn-lg" | ||
| 52 | href="javascript:void()" | 81 | href="javascript:void()" |
| 53 | ng-click="logout()" | 82 | ng-click="logout()"> |
| 54 | > | ||
| 55 | <i class="fa fa-power-off" aria-hidden="true"></i> | 83 | <i class="fa fa-power-off" aria-hidden="true"></i> |
| 56 | </a> | 84 | </a> |
| 57 | </div> | 85 | </div> |
| 58 | </div> | 86 | </div> |