Commit 196de6fc835d0f83d7cbf6469d4f34a55179c137
Exists in
master
Merge branch 'develop' of git.focasoftware.com:npm/foca-botonera-principal
# Conflicts: # src/views/foca-botonera-principal.html
Showing
2 changed files
Show diff stats
src/js/controller.js
| ... | ... | @@ -2,14 +2,14 @@ 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 | |
| ... | ... | @@ -18,17 +18,20 @@ angular.module('focaBotoneraPrincipal') |
| 18 | 18 | focaBotoneraLateralService.showSalir(false); |
| 19 | 19 | focaBotoneraLateralService.showCancelar(false); |
| 20 | 20 | |
| 21 | - $scope.irA = function(accion) { | |
| 21 | + $scope.rutas = $localStorage.rutas ? JSON.parse($localStorage.rutas) : []; | |
| 22 | + | |
| 23 | + $scope.irA = function (accion) { | |
| 22 | 24 | $location.path(accion); |
| 23 | 25 | }; |
| 24 | 26 | |
| 25 | - $scope.logout = function() { | |
| 27 | + $scope.logout = function () { | |
| 26 | 28 | $location.path('/logout'); |
| 27 | 29 | }; |
| 28 | 30 | |
| 29 | - $scope.showTerminal = function() { | |
| 31 | + $scope.showTerminal = function () { | |
| 30 | 32 | var key = $localStorage.terminalKey; |
| 31 | - focaModalService.alert('SU TERMINAL ES: ' + key); | |
| 33 | + focaModalService.info('Su terminal es: ' + key); | |
| 32 | 34 | }; |
| 35 | + | |
| 33 | 36 | } |
| 34 | 37 | ]); |
src/views/foca-botonera-principal.html
| 1 | 1 | <div class="botonera-principal"> |
| 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> | |
| 2 | 24 | <div class="row mt-3 justify-content-center"> |
| 3 | 25 | <div class="col-auto p-0"> |
| 4 | - <img src="./img/logoMapa.png"/> | |
| 26 | + <img src="./img/logoMapa.png" /> | |
| 5 | 27 | </div> |
| 6 | 28 | </div> |
| 7 | 29 | <div class="row"> |
| ... | ... | @@ -10,13 +32,15 @@ |
| 10 | 32 | <slides> |
| 11 | 33 | <slide ng-repeat="(keyPagina, pagina) in paginas"> |
| 12 | 34 | <menu class="botonera-principal-menu"> |
| 13 | - <menuitem | |
| 35 | + <menuitem | |
| 14 | 36 | ng-class="boton.clase" |
| 15 | 37 | ng-repeat="(keyBoton, boton) in pagina" |
| 16 | - ng-show="boton.accion != '/venta-hoja-ruta/lista'"> | |
| 38 | + ng-show="boton.accion != '/venta-hoja-ruta/lista'" | |
| 39 | + > | |
| 17 | 40 | <button |
| 18 | 41 | foca-focus="keyPagina === 0 && keyBoton === 0" |
| 19 | - ng-click="irA(boton.accion)"> | |
| 42 | + ng-click="irA(boton.accion)" | |
| 43 | + > | |
| 20 | 44 | <span ng-bind="boton.texto"></span> |
| 21 | 45 | </button> |
| 22 | 46 | </menuitem> |
| ... | ... | @@ -28,17 +52,17 @@ |
| 28 | 52 | <pagination></pagination> |
| 29 | 53 | </swiper> |
| 30 | 54 | <div class="d-none d-sm-block"> |
| 31 | - <a | |
| 32 | - class="btn btn-outline-dark mt-5 btn-lg" | |
| 33 | - href="javascript:void()" | |
| 34 | - ng-click="showTerminal()" | |
| 35 | - > | |
| 55 | + <a | |
| 56 | + class="btn btn-outline-dark mt-5 btn-lg" | |
| 57 | + href="javascript:void()" | |
| 58 | + ng-click="showTerminal()" | |
| 59 | + > | |
| 36 | 60 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
| 37 | - </a> | |
| 38 | - <a class="btn btn-outline-dark mt-5 btn-lg" | |
| 39 | - href="javascript:void()" | |
| 40 | - ng-click="logout()" | |
| 41 | - > | |
| 61 | + </a> | |
| 62 | + <a | |
| 63 | + class="btn btn-outline-dark mt-5 btn-lg" | |
| 64 | + href="javascript:void()" | |
| 65 | + ng-click="logout()"> | |
| 42 | 66 | <i class="fa fa-power-off" aria-hidden="true"></i> |
| 43 | 67 | </a> |
| 44 | 68 | </div> |
| ... | ... | @@ -49,14 +73,13 @@ |
| 49 | 73 | <a |
| 50 | 74 | class="btn btn-outline-dark btn-lg mr-2" |
| 51 | 75 | href="javascript:void()" |
| 52 | - ng-click="showTerminal()" | |
| 53 | - > | |
| 76 | + ng-click="showTerminal()"> | |
| 54 | 77 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
| 55 | 78 | </a> |
| 56 | - <a class="btn btn-outline-dark btn-lg" | |
| 79 | + <a | |
| 80 | + class="btn btn-outline-dark btn-lg" | |
| 57 | 81 | href="javascript:void()" |
| 58 | - ng-click="logout()" | |
| 59 | - > | |
| 82 | + ng-click="logout()"> | |
| 60 | 83 | <i class="fa fa-power-off" aria-hidden="true"></i> |
| 61 | 84 | </a> |
| 62 | 85 | </div> |