Commit 5a7851ca0d19a08fee2db0a9f6b4679518bf9767
1 parent
f1caad73db
Exists in
master
correciones en identacion
Showing
2 changed files
with
48 additions
and
53 deletions
Show diff stats
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.rutas = $localStorage.rutas? JSON.parse($localStorage.rutas) : []; | 21 | $scope.rutas = $localStorage.rutas? JSON.parse($localStorage.rutas) : []; |
| 22 | 22 | ||
| 23 | |||
| 24 | $scope.irA = function (accion) { | 23 | $scope.irA = function (accion) { |
| 25 | $location.path(accion); | 24 | $location.path(accion); |
| 26 | }; | 25 | }; |
| 27 | 26 | ||
| 28 | $scope.logout = function () { | 27 | $scope.logout = function () { |
| 29 | $location.path('/logout'); | 28 | $location.path('/logout'); |
| 30 | }; | 29 | }; |
| 31 | 30 | ||
| 32 | $scope.showTerminal = function () { | 31 | $scope.showTerminal = function () { |
| 33 | var key = $localStorage.terminalKey; | 32 | var key = $localStorage.terminalKey; |
| 34 | focaModalService.info('Su terminal es: ' + key); | 33 | focaModalService.info('Su terminal es: ' + key); |
| 35 | }; | 34 | }; |
| 36 | 35 | ||
| 37 | init(); | ||
| 38 | |||
| 39 | function init() { | ||
| 40 | |||
| 41 | console.log($localStorage); | ||
| 42 | } | ||
| 43 | } | 36 | } |
| 44 | ]); | 37 | ]); |
| 45 | 38 |
src/views/foca-botonera-principal.html
| 1 | <div class="botonera-principal"> | 1 | <div class="botonera-principal"> |
| 2 | <div class="d-flex"> | 2 | <div class="d-flex"> |
| 3 | 3 | <div ng-if="rutas.length > 0" class="ml-auto dropdown"> | |
| 4 | <!-- <div class="dropdown"> | 4 | <button |
| 5 | <button class="btn btn-secondary dropdown-toggle" | 5 | class="m-0 btn-tareas-pausadas dropdown-toggle" |
| 6 | type="button" | 6 | type="button" |
| 7 | id="dropdownMenuButton" | 7 | id="dropdownMenuButton" |
| 8 | data-toggle="dropdown" | 8 | data-toggle="dropdown" |
| 9 | aria-haspopup="true" | 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" | 10 | aria-expanded="false" |
| 28 | > | 11 | > |
| 29 | Tareas Pausadas | 12 | Tareas Pausadas |
| 30 | </button> | 13 | </button> |
| 31 | <div class="dropdown-tareas-pausadas dropdown-menu" aria-labelledby="dropdownMenuButton"> | 14 | <div class="dropdown-tareas-pausadas dropdown-menu" aria-labelledby="dropdownMenuButton"> |
| 32 | <a | 15 | <a |
| 33 | ng-click="irA(ruta)" | 16 | ng-click="irA(ruta)" |
| 34 | ng-repeat="ruta in rutas track by $index" | 17 | ng-repeat="ruta in rutas track by $index" |
| 35 | class="items-dropdown dropdown-item m-1"> | 18 | class="items-dropdown dropdown-item m-1"> |
| 36 | Volver a: {{ruta}} | 19 | Volver a: {{ruta}} |
| 37 | </a> | 20 | </a> |
| 38 | </div> | ||
| 39 | </div> | 21 | </div> |
| 40 | </div> | 22 | </div> |
| 23 | </div> | ||
| 41 | <div class="row mt-3 justify-content-center"> | 24 | <div class="row mt-3 justify-content-center"> |
| 42 | <div class="col-auto p-0"> | 25 | <div class="col-auto p-0"> |
| 43 | <img src="./img/logoMapa.png" /> | 26 | <img src="./img/logoMapa.png" /> |
| 44 | </div> | 27 | </div> |
| 45 | </div> | 28 | </div> |
| 46 | <div class="row"> | 29 | <div class="row"> |
| 47 | <div class="col-12 mb-3"> | 30 | <div class="col-12 mb-3"> |
| 48 | <swiper on-init="inicioSwiper"> | 31 | <swiper on-init="inicioSwiper"> |
| 49 | <slides> | 32 | <slides> |
| 50 | <slide ng-repeat="(keyPagina, pagina) in paginas"> | 33 | <slide ng-repeat="(keyPagina, pagina) in paginas"> |
| 51 | <menu class="botonera-principal-menu"> | 34 | <menu class="botonera-principal-menu"> |
| 52 | <menuitem ng-class="boton.clase" ng-repeat="(keyBoton, boton) in pagina" | 35 | <menuitem |
| 53 | ng-show="boton.accion != '/venta-hoja-ruta/lista'"> | 36 | ng-class="boton.clase" |
| 54 | <button foca-focus="keyPagina === 0 && keyBoton === 0" ng-click="irA(boton.accion)"> | 37 | ng-repeat="(keyBoton, boton) in pagina" |
| 55 | <span ng-bind="boton.texto"></span> | 38 | ng-show="boton.accion != '/venta-hoja-ruta/lista'" |
| 56 | </button> | 39 | > |
| 40 | <button | ||
| 41 | foca-focus="keyPagina === 0 && keyBoton === 0" | ||
| 42 | ng-click="irA(boton.accion)" | ||
| 43 | > | ||
| 44 | <span ng-bind="boton.texto"></span> | ||
| 45 | </button> | ||
| 57 | </menuitem> | 46 | </menuitem> |
| 58 | </menu> | 47 | </menu> |
| 59 | </slide> | 48 | </slide> |
| 60 | </slides> | 49 | </slides> |
| 61 | <prev></prev> | 50 | <prev></prev> |
| 62 | <next></next> | 51 | <next></next> |
| 63 | <pagination></pagination> | 52 | <pagination></pagination> |
| 64 | </swiper> | 53 | </swiper> |
| 65 | <div class="d-none d-sm-block"> | 54 | <div class="d-none d-sm-block"> |
| 66 | <a class="btn btn-outline-dark mt-5 btn-lg" href="javascript:void()" ng-click="showTerminal()"> | 55 | <a |
| 56 | class="btn btn-outline-dark mt-5 btn-lg" | ||
| 57 | href="javascript:void()" | ||
| 58 | ng-click="showTerminal()" | ||
| 59 | > | ||
| 67 | <i class="fa fa-info-circle" aria-hidden="true"></i> | 60 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
| 68 | </a> | 61 | </a> |
| 69 | <a class="btn btn-outline-dark mt-5 btn-lg" href="javascript:void()" ng-click="logout()"> | 62 | <a |
| 63 | class="btn btn-outline-dark mt-5 btn-lg" | ||
| 64 | href="javascript:void()" | ||
| 65 | ng-click="logout()"> | ||
| 70 | <i class="fa fa-power-off" aria-hidden="true"></i> | 66 | <i class="fa fa-power-off" aria-hidden="true"></i> |
| 71 | </a> | 67 | </a> |
| 72 | </div> | 68 | </div> |
| 73 | </div> | 69 | </div> |
| 74 | </div> | 70 | </div> |