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
| ... | ... | @@ -3,6 +3,8 @@ |
| 3 | 3 | "version": "0.0.1", |
| 4 | 4 | "description": "Botonera principal", |
| 5 | 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 | 8 | "test": "echo \"Error: no test specified\" && exit 1", |
| 7 | 9 | "gulp-pre-commit": "gulp pre-commit", |
| 8 | 10 | "compile": "gulp uglify", |
src/js/controller.js
| ... | ... | @@ -2,33 +2,37 @@ angular.module('focaBotoneraPrincipal') |
| 2 | 2 | .controller('focaBotoneraPrincipalController', [ |
| 3 | 3 | '$scope', '$rootScope', '$timeout', '$location', '$localStorage', |
| 4 | 4 | 'botones', 'focaModalService', 'APP', 'focaBotoneraLateralService', |
| 5 | - function($scope, $rootScope, $timeout, $location, $localStorage, | |
| 5 | + function ($scope, $rootScope, $timeout, $location, $localStorage, | |
| 6 | 6 | botones, focaModalService, APP, focaBotoneraLateralService) { |
| 7 | 7 | $scope.paginas = []; |
| 8 | 8 | var botonesPorPagina = 10; |
| 9 | - if(APP === 'distribuidor' || APP === 'transportista') { | |
| 9 | + if (APP === 'distribuidor' || APP === 'transportista') { | |
| 10 | 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 | 13 | $scope.paginas.push(botones.data.slice(i, i + botonesPorPagina)); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | focaBotoneraLateralService.showGuardar(false); |
| 17 | + focaBotoneraLateralService.showPagar(false); | |
| 17 | 18 | focaBotoneraLateralService.showPausar(false); |
| 18 | 19 | focaBotoneraLateralService.showSalir(false); |
| 19 | 20 | focaBotoneraLateralService.showCancelar(false); |
| 20 | 21 | |
| 21 | - $scope.irA = function(accion) { | |
| 22 | + $scope.rutas = $localStorage.rutas ? JSON.parse($localStorage.rutas) : []; | |
| 23 | + | |
| 24 | + $scope.irA = function (accion) { | |
| 22 | 25 | $location.path(accion); |
| 23 | 26 | }; |
| 24 | 27 | |
| 25 | - $scope.logout = function() { | |
| 28 | + $scope.logout = function () { | |
| 26 | 29 | $location.path('/logout'); |
| 27 | 30 | }; |
| 28 | 31 | |
| 29 | - $scope.showTerminal = function() { | |
| 32 | + $scope.showTerminal = function () { | |
| 30 | 33 | var key = $localStorage.terminalKey; |
| 31 | - focaModalService.alert('SU TERMINAL ES: ' + key); | |
| 34 | + focaModalService.info('Su terminal es: ' + key); | |
| 32 | 35 | }; |
| 36 | + | |
| 33 | 37 | } |
| 34 | 38 | ]); |
src/views/foca-botonera-principal.html
| 1 | 1 | <div class="botonera-principal"> |
| 2 | - <div class="row"> | |
| 3 | - <div class=" col-6"> | |
| 4 | - <img class="botonera-principal-logo" src="./img/logoMapa.png"/> | |
| 2 | + <div class="d-flex"> | |
| 3 | + <div ng-if="rutas.length > 0" class="ml-auto dropdown"> | |
| 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 | 27 | </div> |
| 6 | 28 | </div> |
| 7 | 29 | <div class="row"> |
| 8 | 30 | <div class="col-12 mb-3"> |
| 9 | 31 | <swiper on-init="inicioSwiper"> |
| 10 | 32 | <slides> |
| 11 | - <slide ng-repeat="pagina in paginas"> | |
| 33 | + <slide ng-repeat="(keyPagina, pagina) in paginas"> | |
| 12 | 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'"> | |
| 14 | - <button ng-click="irA(boton.accion)"> | |
| 35 | + <menuitem | |
| 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 | 44 | <span ng-bind="boton.texto"></span> |
| 16 | 45 | </button> |
| 17 | 46 | </menuitem> |
| ... | ... | @@ -23,17 +52,17 @@ |
| 23 | 52 | <pagination></pagination> |
| 24 | 53 | </swiper> |
| 25 | 54 | <div class="d-none d-sm-block"> |
| 26 | - <a | |
| 27 | - class="btn btn-outline-dark mt-5 btn-lg" | |
| 28 | - href="javascript:void()" | |
| 29 | - ng-click="showTerminal()" | |
| 30 | - > | |
| 55 | + <a | |
| 56 | + class="btn btn-outline-dark mt-5 btn-lg" | |
| 57 | + href="javascript:void()" | |
| 58 | + ng-click="showTerminal()" | |
| 59 | + > | |
| 31 | 60 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
| 32 | - </a> | |
| 33 | - <a class="btn btn-outline-dark mt-5 btn-lg" | |
| 34 | - href="javascript:void()" | |
| 35 | - ng-click="logout()" | |
| 36 | - > | |
| 61 | + </a> | |
| 62 | + <a | |
| 63 | + class="btn btn-outline-dark mt-5 btn-lg" | |
| 64 | + href="javascript:void()" | |
| 65 | + ng-click="logout()"> | |
| 37 | 66 | <i class="fa fa-power-off" aria-hidden="true"></i> |
| 38 | 67 | </a> |
| 39 | 68 | </div> |
| ... | ... | @@ -44,14 +73,13 @@ |
| 44 | 73 | <a |
| 45 | 74 | class="btn btn-outline-dark btn-lg mr-2" |
| 46 | 75 | href="javascript:void()" |
| 47 | - ng-click="showTerminal()" | |
| 48 | - > | |
| 76 | + ng-click="showTerminal()"> | |
| 49 | 77 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
| 50 | 78 | </a> |
| 51 | - <a class="btn btn-outline-dark btn-lg" | |
| 79 | + <a | |
| 80 | + class="btn btn-outline-dark btn-lg" | |
| 52 | 81 | href="javascript:void()" |
| 53 | - ng-click="logout()" | |
| 54 | - > | |
| 82 | + ng-click="logout()"> | |
| 55 | 83 | <i class="fa fa-power-off" aria-hidden="true"></i> |
| 56 | 84 | </a> |
| 57 | 85 | </div> |