Commit e07e2f505bc938795bdb1a08c97ba3c2c28a00e8

Authored by Pablo Marco del Pont
Exists in master

Merge branch 'master' into 'master'

botones de logout y mostrar terminal

See merge request modulos-npm/foca-botonera-principal!4
1 <html ng-app="focaBotoneraPrincipal"> 1 <html ng-app="focaBotoneraPrincipal">
2 <head> 2 <head>
3 <meta charset="UTF-8"/> 3 <meta charset="UTF-8"/>
4 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> 4 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
5 5
6 <!--CSS--> 6 <!--CSS-->
7 <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> 7 <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/>
8 <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> 8 <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
9 9
10 <!--VENDOR JS--> 10 <!--VENDOR JS-->
11 <script src="node_modules/jquery/dist/jquery.min.js"></script> 11 <script src="node_modules/jquery/dist/jquery.min.js"></script>
12 <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> 12 <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
13 <script src="node_modules/angular/angular.min.js"></script> 13 <script src="node_modules/angular/angular.min.js"></script>
14 <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> 14 <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script>
15 15
16 <!-- BUILD --> 16 <!-- BUILD -->
17 <script src="src/js/app.js"></script> 17 <script src="src/js/app.js"></script>
18 <script src="src/js/controller.js"></script> 18 <script src="src/js/controller.js"></script>
19 <script src="src/js/service.js"></script> 19 <!--<script src="src/js/service.js"></script>-->
20 20
21 <!-- /BUILD --> 21 <!-- /BUILD -->
22 22
23 <!-- CONFIG PARA DEVELOP --> 23 <!-- CONFIG PARA DEVELOP -->
24 <script src="src/etc/develop.js"></script> 24 <!--<script src="src/etc/develop.js"></script>-->
25 </head> 25 </head>
26 <body ng-controller="controller"> 26 <body ng-controller="focaBotoneraPrincipalController">
27 </body> 27 </body>
28 </html> 28 </html>
29 29
1 { 1 {
2 "name": "foca-botonera-principal", 2 "name": "foca-botonera-principal",
3 "version": "0.0.1", 3 "version": "0.0.1",
4 "description": "Botonera principal", 4 "description": "Botonera principal",
5 "scripts": { 5 "scripts": {
6 "test": "echo \"Error: no test specified\" && exit 1", 6 "test": "echo \"Error: no test specified\" && exit 1",
7 "gulp-pre-commit": "gulp pre-commit", 7 "gulp-pre-commit": "gulp pre-commit",
8 "compile": "gulp uglify", 8 "compile": "gulp uglify",
9 "postinstall": "npm run compile && gulp clean-post-install", 9 "postinstall": "npm run compile && gulp clean-post-install",
10 "install-dev": "npm install -D angular bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4" 10 "install-dev": "npm install -D angular bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4"
11 }, 11 },
12 "pre-commit": [ 12 "pre-commit": [
13 "gulp-pre-commit" 13 "gulp-pre-commit"
14 ], 14 ],
15 "repository": { 15 "repository": {
16 "type": "git", 16 "type": "git",
17 "url": "https://debo.suite.repo/modulos-npm/foca-botonera-principal" 17 "url": "https://debo.suite.repo/modulos-npm/foca-botonera-principal"
18 }, 18 },
19 "author": "Foca Software", 19 "author": "Foca Software",
20 "license": "ISC", 20 "license": "ISC",
21 "peerDependencies": { 21 "peerDependencies": {
22 "angular": "^1.7.4", 22 "angular": "^1.7.4",
23 "bootstrap": "^4.1.3", 23 "bootstrap": "^4.1.3",
24 "font-awesome": "^4.7.0", 24 "font-awesome": "^4.7.0",
25 "ui-bootstrap4": "^3.0.4", 25 "ui-bootstrap4": "^3.0.4",
26 "gulp": "^3.9.1", 26 "gulp": "^3.9.1",
27 "gulp-angular-templatecache": "^2.2.1", 27 "gulp-angular-templatecache": "^2.2.1",
28 "gulp-concat": "^2.6.1", 28 "gulp-concat": "^2.6.1",
29 "gulp-connect": "^5.6.1", 29 "gulp-connect": "^5.6.1",
30 "gulp-htmlmin": "^5.0.1", 30 "gulp-htmlmin": "^5.0.1",
31 "gulp-rename": "^1.4.0", 31 "gulp-rename": "^1.4.0",
32 "gulp-replace": "^1.0.0", 32 "gulp-replace": "^1.0.0",
33 "gulp-uglify": "^3.0.1", 33 "gulp-uglify": "^3.0.1",
34 "jquery": "^3.3.1", 34 "jquery": "^3.3.1",
35 "pump": "^3.0.0" 35 "pump": "^3.0.0",
36 "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git"
36 }, 37 },
37 "devDependencies": { 38 "devDependencies": {
38 "angular": "^1.7.4", 39 "angular": "^1.7.5",
39 "bootstrap": "^4.1.3", 40 "bootstrap": "^4.1.3",
40 "font-awesome": "^4.7.0", 41 "font-awesome": "^4.7.0",
41 "gulp": "3.9.1", 42 "gulp": "^3.9.1",
42 "gulp-angular-templatecache": "2.2.2", 43 "gulp-angular-templatecache": "^2.2.2",
43 "gulp-clean": "0.4.0", 44 "gulp-clean": "^0.4.0",
44 "gulp-concat": "2.6.1", 45 "gulp-concat": "^2.6.1",
45 "gulp-connect": "5.6.1", 46 "gulp-connect": "^5.6.1",
46 "gulp-htmlmin": "5.0.1", 47 "gulp-htmlmin": "^5.0.1",
47 "gulp-jshint": "2.1.0", 48 "gulp-jshint": "^2.1.0",
48 "gulp-rename": "1.4.0", 49 "gulp-rename": "^1.4.0",
49 "gulp-replace": "1.0.0", 50 "gulp-replace": "^1.0.0",
50 "gulp-uglify": "3.0.1", 51 "gulp-uglify": "^3.0.1",
51 "jasmine-core": "^3.2.1", 52 "jasmine-core": "^3.3.0",
52 "jquery": "^3.3.1", 53 "jquery": "^3.3.1",
53 "jshint": "2.9.6", 54 "jshint": "^2.9.6",
54 "pre-commit": "^1.2.2", 55 "pre-commit": "^1.2.2",
55 "pump": "3.0.0", 56 "pump": "^3.0.0",
56 "ui-bootstrap4": "^3.0.4" 57 "ui-bootstrap4": "^3.0.5",
58 "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git"
57 } 59 }
58 } 60 }
59 61
src/js/controller.js
1 angular.module('focaBotoneraPrincipal') 1 angular.module('focaBotoneraPrincipal')
2 .controller('focaBotoneraPrincipalController', [ 2 .controller('focaBotoneraPrincipalController', [
3 '$scope', '$location', 3 '$scope', '$location', '$cookies', 'focaModalService',
4 function($scope, $location) { 4 function($scope, $location, $cookies, focaModalService) {
5 // TODO: Tomar estos datos desde el servicio 5 // TODO: Tomar estos datos desde el servicio
6 $scope.botones = [ 6 $scope.botones = [
7 { 7 {
8 texto: 'Abrir Turno', 8 texto: 'Abrir Turno',
9 clase: 'botonera-principal-abrir-turno', 9 clase: 'botonera-principal-abrir-turno',
10 accion: '/turno-apertura' 10 accion: '/turno-apertura'
11 }, 11 },
12 { 12 {
13 texto: 'Cerrar Turno', 13 texto: 'Cerrar Turno',
14 clase: 'botonera-principal-cerrar-turno', 14 clase: 'botonera-principal-cerrar-turno',
15 accion: '/turno-cierre' 15 accion: '/turno-cierre'
16 }, 16 },
17 { 17 {
18 texto: 'Nota Pedido', 18 texto: 'Nota Pedido',
19 clase: 'botonera-principal-nota-pedido', 19 clase: 'botonera-principal-nota-pedido',
20 accion: '/venta-nota-pedido/crear' 20 accion: '/venta-nota-pedido/crear'
21 }, 21 },
22 { 22 {
23 texto: 'Seguimiento GPS', 23 texto: 'Seguimiento GPS',
24 clase: 'botonera-principal-seguimiento', 24 clase: 'botonera-principal-seguimiento',
25 accion: '/admin-seguimiento' 25 accion: '/admin-seguimiento'
26 }, 26 },
27 { 27 {
28 texto: '', 28 texto: '',
29 clase: 'botonera-principal-vacio', 29 clase: 'botonera-principal-vacio',
30 accion: '/' 30 accion: '/'
31 }, 31 },
32 { 32 {
33 texto: '', 33 texto: '',
34 clase: 'botonera-principal-vacio', 34 clase: 'botonera-principal-vacio',
35 accion: '/' 35 accion: '/'
36 }, 36 },
37 { 37 {
38 texto: '', 38 texto: '',
39 clase: 'botonera-principal-vacio', 39 clase: 'botonera-principal-vacio',
40 accion: '/' 40 accion: '/'
41 }, 41 },
42 { 42 {
43 texto: '', 43 texto: '',
44 clase: 'botonera-principal-vacio', 44 clase: 'botonera-principal-vacio',
45 accion: '/' 45 accion: '/'
46 }, 46 },
47 { 47 {
48 texto: '', 48 texto: '',
49 clase: 'botonera-principal-vacio', 49 clase: 'botonera-principal-vacio',
50 accion: '/' 50 accion: '/'
51 }, 51 },
52 { 52 {
53 texto: '', 53 texto: '',
54 clase: 'botonera-principal-vacio', 54 clase: 'botonera-principal-vacio',
55 accion: '/' 55 accion: '/'
56 }, 56 },
57 { 57 {
58 texto: '', 58 texto: '',
59 clase: 'botonera-principal-vacio', 59 clase: 'botonera-principal-vacio',
60 accion: '/' 60 accion: '/'
61 }, 61 },
62 { 62 {
63 texto: '', 63 texto: '',
64 clase: 'botonera-principal-vacio', 64 clase: 'botonera-principal-vacio',
65 accion: '/' 65 accion: '/'
66 }, 66 },
67 { 67 {
68 texto: '', 68 texto: '',
69 clase: 'botonera-principal-vacio', 69 clase: 'botonera-principal-vacio',
70 accion: '/' 70 accion: '/'
71 }, 71 },
72 { 72 {
73 texto: '', 73 texto: '',
74 clase: 'botonera-principal-vacio', 74 clase: 'botonera-principal-vacio',
75 accion: '/' 75 accion: '/'
76 }, 76 },
77 { 77 {
78 texto: '', 78 texto: '',
79 clase: 'botonera-principal-vacio', 79 clase: 'botonera-principal-vacio',
80 accion: '/' 80 accion: '/'
81 }, 81 },
82 { 82 {
83 texto: '', 83 texto: '',
84 clase: 'botonera-principal-vacio', 84 clase: 'botonera-principal-vacio',
85 accion: '/' 85 accion: '/'
86 }, 86 },
87 { 87 {
88 texto: '', 88 texto: '',
89 clase: 'botonera-principal-vacio', 89 clase: 'botonera-principal-vacio',
90 accion: '/' 90 accion: '/'
91 }, 91 },
92 { 92 {
93 texto: '', 93 texto: '',
94 clase: 'botonera-principal-vacio', 94 clase: 'botonera-principal-vacio',
95 accion: '/' 95 accion: '/'
96 }, 96 },
97 { 97 {
98 texto: '', 98 texto: '',
99 clase: 'botonera-principal-vacio', 99 clase: 'botonera-principal-vacio',
100 accion: '/' 100 accion: '/'
101 }, 101 },
102 { 102 {
103 texto: '', 103 texto: '',
104 clase: 'botonera-principal-vacio', 104 clase: 'botonera-principal-vacio',
105 accion: '/' 105 accion: '/'
106 }, 106 },
107 { 107 {
108 texto: '', 108 texto: '',
109 clase: 'botonera-principal-vacio', 109 clase: 'botonera-principal-vacio',
110 accion: '/' 110 accion: '/'
111 } 111 }
112 ]; 112 ];
113 113
114 $scope.paginas = []; 114 $scope.paginas = [];
115 $scope.paginas.push($scope.botones.slice(0, 15)); 115 $scope.paginas.push($scope.botones.slice(0, 15));
116 $scope.paginas.push($scope.botones.slice(15, 30)); 116 $scope.paginas.push($scope.botones.slice(15, 30));
117 117
118 $scope.irA = function(accion) { 118 $scope.irA = function(accion) {
119 $location.path(accion); 119 $location.path(accion);
120 }; 120 };
121 121
122 $scope.logout = function() { 122 $scope.logout = function() {
123 $location.path('/logout'); 123 $location.path('/logout');
124 }; 124 };
125
126 $scope.showTerminal = function() {
127 var key = $cookies.get('terminalKey');
128 focaModalService.alert('SU TERMINAL ES: ' + key);
129 };
125 } 130 }
126 ]); 131 ]);
127 132
src/views/foca-botonera-principal.html
1 <div class="botonera-principal"> 1 <div class="botonera-principal">
2 <div class="row"> 2 <div class="row">
3 <div class="offset-2 offset-sm-4 col-8 col-sm-4 py-2"> 3 <div class="offset-2 offset-sm-4 col-8 col-sm-4 py-2">
4 <img class="botonera-principal-logo" src="./img/logo.png"/> 4 <img class="botonera-principal-logo" src="./img/logo.png"/>
5 </div> 5 </div>
6 </div> 6 </div>
7 <div class="row"> 7 <div class="row">
8 <div class="col-12"> 8 <div class="col-12 mb-3">
9 <swiper on-init="inicioSwiper"> 9 <swiper on-init="inicioSwiper">
10 <slides> 10 <slides>
11 <slide ng-repeat="pagina in paginas"> 11 <slide ng-repeat="pagina in paginas">
12 <menu class="botonera-principal-menu"> 12 <menu class="botonera-principal-menu">
13 <menuitem ng-class="boton.clase" ng-repeat="boton in pagina"> 13 <menuitem ng-class="boton.clase" ng-repeat="boton in pagina">
14 <button ng-click="irA(boton.accion)"> 14 <button ng-click="irA(boton.accion)">
15 <span ng-bind="boton.texto"></span> 15 <span ng-bind="boton.texto"></span>
16 </button> 16 </button>
17 </menuitem> 17 </menuitem>
18 </menu> 18 </menu>
19 </slide> 19 </slide>
20 </slides> 20 </slides>
21 <prev></prev> 21 <prev></prev>
22 <next></next> 22 <next></next>
23 <pagination></pagination> 23 <pagination></pagination>
24 </swiper> 24 </swiper>
25 <a
26 class="btn btn-outline-dark mt-5 btn-lg"
27 href="javascript:void()"
28 ng-click="showTerminal()"
29 >
30 <i class="fa fa-info-circle" aria-hidden="true"></i>
31 </a>
32 <a class="btn btn-outline-dark mt-5 btn-lg float-right"
33 href="javascript:void()"
34 ng-click="logout()"
35 >
36 <i class="fa fa-power-off" aria-hidden="true"></i>
37 </a>
25 </div> 38 </div>
26 </div> 39 </div>
27 </div> 40 </div>
28 41