Commit f1caad73dbd0ab6edfb3d445260ea546b8f55f02
1 parent
e86ad0a3c1
Exists in
master
and in
1 other branch
cambio botonera tareas pausadas
Showing
2 changed files
with
66 additions
and
35 deletions
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,27 @@ 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 | + | |
| 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 | 34 | focaModalService.info('Su terminal es: ' + key); |
| 32 | 35 | }; |
| 36 | + | |
| 37 | + init(); | |
| 38 | + | |
| 39 | + function init() { | |
| 40 | + | |
| 41 | + console.log($localStorage); | |
| 42 | + } | |
| 33 | 43 | } |
| 34 | 44 | ]); |
src/views/foca-botonera-principal.html
| 1 | 1 | <div class="botonera-principal"> |
| 2 | + <div class="d-flex"> | |
| 3 | + | |
| 4 | + <!-- <div class="dropdown"> | |
| 5 | + <button class="btn btn-secondary dropdown-toggle" | |
| 6 | + type="button" | |
| 7 | + id="dropdownMenuButton" | |
| 8 | + data-toggle="dropdown" | |
| 9 | + aria-haspopup="true" | |
| 10 | + aria-expanded="false"> | |
| 11 | + Dropdown button | |
| 12 | + </button> | |
| 13 | + <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> | |
| 14 | + <a class="dropdown-item" href="#">Action</a> | |
| 15 | + <a class="dropdown-item" href="#">Another action</a> | |
| 16 | + <a class="dropdown-item" href="#">Something else here</a> | |
| 17 | + </div> --> | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + <div ng-if="rutas.length > 0" class="ml-auto dropdown"> | |
| 22 | + <button class="m-0 btn-tareas-pausadas dropdown-toggle" | |
| 23 | + type="button" | |
| 24 | + id="dropdownMenuButton" | |
| 25 | + data-toggle="dropdown" | |
| 26 | + aria-haspopup="true" | |
| 27 | + aria-expanded="false" | |
| 28 | + > | |
| 29 | + Tareas Pausadas | |
| 30 | + </button> | |
| 31 | + <div class="dropdown-tareas-pausadas dropdown-menu" aria-labelledby="dropdownMenuButton"> | |
| 32 | + <a | |
| 33 | + ng-click="irA(ruta)" | |
| 34 | + ng-repeat="ruta in rutas track by $index" | |
| 35 | + class="items-dropdown dropdown-item m-1"> | |
| 36 | + Volver a: {{ruta}} | |
| 37 | + </a> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 2 | 41 | <div class="row mt-3 justify-content-center"> |
| 3 | 42 | <div class="col-auto p-0"> |
| 4 | - <img src="./img/logoMapa.png"/> | |
| 43 | + <img src="./img/logoMapa.png" /> | |
| 5 | 44 | </div> |
| 6 | 45 | </div> |
| 7 | 46 | <div class="row"> |
| ... | ... | @@ -10,15 +49,11 @@ |
| 10 | 49 | <slides> |
| 11 | 50 | <slide ng-repeat="(keyPagina, pagina) in paginas"> |
| 12 | 51 | <menu class="botonera-principal-menu"> |
| 13 | - <menuitem | |
| 14 | - ng-class="boton.clase" | |
| 15 | - ng-repeat="(keyBoton, boton) in pagina" | |
| 52 | + <menuitem ng-class="boton.clase" ng-repeat="(keyBoton, boton) in pagina" | |
| 16 | 53 | ng-show="boton.accion != '/venta-hoja-ruta/lista'"> |
| 17 | - <button | |
| 18 | - foca-focus="keyPagina === 0 && keyBoton === 0" | |
| 19 | - ng-click="irA(boton.accion)"> | |
| 20 | - <span ng-bind="boton.texto"></span> | |
| 21 | - </button> | |
| 54 | + <button foca-focus="keyPagina === 0 && keyBoton === 0" ng-click="irA(boton.accion)"> | |
| 55 | + <span ng-bind="boton.texto"></span> | |
| 56 | + </button> | |
| 22 | 57 | </menuitem> |
| 23 | 58 | </menu> |
| 24 | 59 | </slide> |
| ... | ... | @@ -28,17 +63,10 @@ |
| 28 | 63 | <pagination></pagination> |
| 29 | 64 | </swiper> |
| 30 | 65 | <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 | - > | |
| 66 | + <a class="btn btn-outline-dark mt-5 btn-lg" href="javascript:void()" ng-click="showTerminal()"> | |
| 36 | 67 | <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 | - > | |
| 68 | + </a> | |
| 69 | + <a class="btn btn-outline-dark mt-5 btn-lg" href="javascript:void()" ng-click="logout()"> | |
| 42 | 70 | <i class="fa fa-power-off" aria-hidden="true"></i> |
| 43 | 71 | </a> |
| 44 | 72 | </div> |
| ... | ... | @@ -46,19 +74,12 @@ |
| 46 | 74 | </div> |
| 47 | 75 | <div class="row d-md-none fixed-bottom"> |
| 48 | 76 | <div class="w-100 d-flex px-3 acciones-mobile"> |
| 49 | - <a | |
| 50 | - class="btn btn-outline-dark btn-lg mr-2" | |
| 51 | - href="javascript:void()" | |
| 52 | - ng-click="showTerminal()" | |
| 53 | - > | |
| 77 | + <a class="btn btn-outline-dark btn-lg mr-2" href="javascript:void()" ng-click="showTerminal()"> | |
| 54 | 78 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
| 55 | 79 | </a> |
| 56 | - <a class="btn btn-outline-dark btn-lg" | |
| 57 | - href="javascript:void()" | |
| 58 | - ng-click="logout()" | |
| 59 | - > | |
| 80 | + <a class="btn btn-outline-dark btn-lg" href="javascript:void()" ng-click="logout()"> | |
| 60 | 81 | <i class="fa fa-power-off" aria-hidden="true"></i> |
| 61 | 82 | </a> |
| 62 | 83 | </div> |
| 63 | 84 | </div> |
| 64 | 85 | -</div> |
| 86 | +</div> | |
| 65 | 87 | \ No newline at end of file |