Commit 41194bea65363c9cb9d0ef3523e3592f4ae56524
1 parent
0ece424641
Exists in
facturador
Arreglo en html y cantidad de botones por pagina.
Showing
2 changed files
with
10 additions
and
10 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' || APP === 'facturador') { |
10 | botonesPorPagina = 3; | 10 | botonesPorPagina = 6; |
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.irA = function(accion) { | 21 | $scope.irA = function(accion) { |
22 | $location.path(accion); | 22 | $location.path(accion); |
23 | }; | 23 | }; |
24 | 24 | ||
25 | $scope.logout = function() { | 25 | $scope.logout = function() { |
26 | $location.path('/logout'); | 26 | $location.path('/logout'); |
27 | }; | 27 | }; |
28 | 28 | ||
29 | $scope.showTerminal = function() { | 29 | $scope.showTerminal = function() { |
30 | var key = $localStorage.terminalKey; | 30 | var key = $localStorage.terminalKey; |
31 | focaModalService.alert('SU TERMINAL ES: ' + key); | 31 | focaModalService.alert('SU TERMINAL ES: ' + key); |
32 | }; | 32 | }; |
33 | } | 33 | } |
34 | ]); | 34 | ]); |
35 | 35 |
src/views/foca-botonera-principal.html
1 | <div class="botonera-principal"> | 1 | <div class="botonera-principal h-75"> |
2 | <div class="row mt-3 justify-content-center d-none d-sm-flex"> | 2 | <div class="row mt-3 justify-content-center d-none d-sm-flex"> |
3 | <div class="col-auto p-0"> | 3 | <div class="col-auto p-0"> |
4 | <img src="./img/logoMapa.png"/> | 4 | <img src="./img/logoMapa.png"/> |
5 | </div> | 5 | </div> |
6 | </div> | 6 | </div> |
7 | <div class="row"> | 7 | <div class="row h-100 mt-4"> |
8 | <div class="col-12 mb-3"> | 8 | <div class="col-12"> |
9 | <swiper on-init="inicioSwiper"> | 9 | <swiper on-init="inicioSwiper"> |
10 | <slides> | 10 | <slides class="d-flex align-items-center"> |
11 | <slide ng-repeat="(keyPagina, pagina) in paginas"> | 11 | <slide ng-repeat="(keyPagina, pagina) in paginas"> |
12 | <menu class="botonera-principal-menu"> | 12 | <menu class="botonera-principal-menu"> |
13 | <menuitem | 13 | <menuitem |
14 | ng-class="boton.clase" | 14 | ng-class="boton.clase" |
15 | ng-repeat="(keyBoton, boton) in pagina" | 15 | ng-repeat="(keyBoton, boton) in pagina" |
16 | ng-show="boton.accion != '/venta-hoja-ruta/lista'"> | 16 | ng-show="boton.accion != '/venta-hoja-ruta/lista'"> |
17 | <button | 17 | <button |
18 | foca-focus="keyPagina === 0 && keyBoton === 0" | 18 | foca-focus="keyPagina === 0 && keyBoton === 0" |
19 | ng-click="irA(boton.accion)"> | 19 | ng-click="irA(boton.accion)"> |
20 | <span ng-bind="boton.texto"></span> | 20 | <span ng-bind="boton.texto"></span> |
21 | </button> | 21 | </button> |
22 | </menuitem> | 22 | </menuitem> |
23 | </menu> | 23 | </menu> |
24 | </slide> | 24 | </slide> |
25 | </slides> | 25 | </slides> |
26 | <prev></prev> | 26 | <prev></prev> |
27 | <next></next> | 27 | <next></next> |
28 | <pagination></pagination> | 28 | <pagination></pagination> |
29 | </swiper> | 29 | </swiper> |
30 | <div class="d-none d-sm-block"> | 30 | <div class="d-none d-sm-flex"> |
31 | <a | 31 | <a |
32 | class="btn btn-outline-dark mt-5 btn-lg" | 32 | class="btn btn-outline-dark btn-lg mx-1" |
33 | href="javascript:void()" | 33 | href="javascript:void()" |
34 | ng-click="showTerminal()" | 34 | ng-click="showTerminal()" |
35 | > | 35 | > |
36 | <i class="fa fa-info-circle" aria-hidden="true"></i> | 36 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
37 | </a> | 37 | </a> |
38 | <a class="btn btn-outline-dark mt-5 btn-lg" | 38 | <a class="btn btn-outline-dark btn-lg mx-1" |
39 | href="javascript:void()" | 39 | href="javascript:void()" |
40 | ng-click="logout()" | 40 | ng-click="logout()" |
41 | > | 41 | > |
42 | <i class="fa fa-power-off" aria-hidden="true"></i> | 42 | <i class="fa fa-power-off" aria-hidden="true"></i> |
43 | </a> | 43 | </a> |
44 | </div> | 44 | </div> |
45 | </div> | 45 | </div> |
46 | </div> | 46 | </div> |
47 | <div class="row d-md-none fixed-bottom"> | 47 | <div class="row d-flex d-sm-none fixed-bottom"> |
48 | <div class="w-100 d-flex px-3 acciones-mobile"> | 48 | <div class="w-100 d-flex px-3 acciones-mobile"> |
49 | <a | 49 | <a |
50 | class="btn btn-outline-dark btn-lg mr-2" | 50 | class="btn btn-outline-dark btn-lg mr-2" |
51 | href="javascript:void()" | 51 | href="javascript:void()" |
52 | ng-click="showTerminal()" | 52 | ng-click="showTerminal()" |
53 | > | 53 | > |
54 | <i class="fa fa-info-circle" aria-hidden="true"></i> | 54 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
55 | </a> | 55 | </a> |
56 | <a class="btn btn-outline-dark btn-lg" | 56 | <a class="btn btn-outline-dark btn-lg" |
57 | href="javascript:void()" | 57 | href="javascript:void()" |
58 | ng-click="logout()" | 58 | ng-click="logout()" |
59 | > | 59 | > |
60 | <i class="fa fa-power-off" aria-hidden="true"></i> | 60 | <i class="fa fa-power-off" aria-hidden="true"></i> |
61 | </a> | 61 | </a> |
62 | </div> | 62 | </div> |
63 | </div> | 63 | </div> |
64 | </div> | 64 | </div> |
65 | 65 |