Commit 014f467867e2ad6ee38c80bde50948926260a230
1 parent
ad4ad9b64d
Exists in
master
10 elementos en swiper, agrego componente botonera
Showing
4 changed files
with
16 additions
and
7 deletions
Show diff stats
package.json
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 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git" |
37 | }, | 37 | }, |
38 | "devDependencies": { | 38 | "devDependencies": { |
39 | "angular": "^1.7.5", | 39 | "angular": "^1.7.5", |
40 | "bootstrap": "^4.1.3", | 40 | "bootstrap": "^4.1.3", |
41 | "font-awesome": "^4.7.0", | 41 | "font-awesome": "^4.7.0", |
42 | "gulp": "^3.9.1", | 42 | "gulp": "^3.9.1", |
43 | "gulp-angular-templatecache": "^2.2.2", | 43 | "gulp-angular-templatecache": "^2.2.2", |
44 | "gulp-clean": "^0.4.0", | 44 | "gulp-clean": "^0.4.0", |
45 | "gulp-concat": "^2.6.1", | 45 | "gulp-concat": "^2.6.1", |
46 | "gulp-connect": "^5.6.1", | 46 | "gulp-connect": "^5.6.1", |
47 | "gulp-htmlmin": "^5.0.1", | 47 | "gulp-htmlmin": "^5.0.1", |
48 | "gulp-jshint": "^2.1.0", | 48 | "gulp-jshint": "^2.1.0", |
49 | "gulp-rename": "^1.4.0", | 49 | "gulp-rename": "^1.4.0", |
50 | "gulp-replace": "^1.0.0", | 50 | "gulp-replace": "^1.0.0", |
51 | "gulp-uglify": "^3.0.1", | 51 | "gulp-uglify": "^3.0.1", |
52 | "jasmine-core": "^3.3.0", | 52 | "jasmine-core": "^3.3.0", |
53 | "jquery": "^3.3.1", | 53 | "jquery": "^3.3.1", |
54 | "jshint": "^2.9.6", | 54 | "jshint": "^2.9.6", |
55 | "pre-commit": "^1.2.2", | 55 | "pre-commit": "^1.2.2", |
56 | "pump": "^3.0.0", | 56 | "pump": "^3.0.0", |
57 | "ui-bootstrap4": "^3.0.5", | 57 | "ui-bootstrap4": "^3.0.5", |
58 | "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git" | 58 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git" |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 |
src/js/app.js
1 | angular.module('focaBotoneraPrincipal', []); | 1 | angular.module('focaBotoneraPrincipal', [ |
2 | 'focaBotoneraLateral' | ||
3 | ]); | ||
2 | 4 |
src/js/controller.js
1 | angular.module('focaBotoneraPrincipal') | 1 | angular.module('focaBotoneraPrincipal') |
2 | .controller('focaBotoneraPrincipalController', [ | 2 | .controller('focaBotoneraPrincipalController', [ |
3 | '$scope', '$location', '$localStorage', 'botones', 'focaModalService', 'APP', | 3 | '$scope', '$rootScope', '$timeout', '$location', '$localStorage', |
4 | function($scope, $location, $localStorage, botones, focaModalService, APP) { | 4 | 'botones', 'focaModalService', 'APP', 'focaBotoneraLateralService', |
5 | function($scope, $rootScope, $timeout, $location, $localStorage, | ||
6 | botones, focaModalService, APP, focaBotoneraLateralService) { | ||
7 | |||
5 | $scope.paginas = []; | 8 | $scope.paginas = []; |
6 | var botonesPorPagina = 12; | 9 | var botonesPorPagina = 10; |
7 | if(APP === 'distribuidor' || APP === 'transportista') { | 10 | if(APP === 'distribuidor' || APP === 'transportista') { |
8 | botonesPorPagina = 3; | 11 | botonesPorPagina = 3; |
9 | } | 12 | } |
10 | for(var i = 0; i < botones.data.length; i += botonesPorPagina){ | 13 | for(var i = 0; i < botones.data.length; i += botonesPorPagina){ |
11 | $scope.paginas.push(botones.data.slice(i, i + botonesPorPagina)); | 14 | $scope.paginas.push(botones.data.slice(i, i + botonesPorPagina)); |
12 | } | 15 | } |
13 | 16 | ||
17 | focaBotoneraLateralService.showGuardar(false); | ||
18 | focaBotoneraLateralService.showPausar(false); | ||
19 | focaBotoneraLateralService.showSalir(false); | ||
20 | |||
14 | $scope.irA = function(accion) { | 21 | $scope.irA = function(accion) { |
15 | $location.path(accion); | 22 | $location.path(accion); |
16 | }; | 23 | }; |
17 | 24 | ||
18 | $scope.logout = function() { | 25 | $scope.logout = function() { |
19 | $location.path('/logout'); | 26 | $location.path('/logout'); |
20 | }; | 27 | }; |
21 | 28 | ||
22 | $scope.showTerminal = function() { | 29 | $scope.showTerminal = function() { |
23 | var key = $localStorage.terminalKey; | 30 | var key = $localStorage.terminalKey; |
24 | focaModalService.alert('SU TERMINAL ES: ' + key); | 31 | focaModalService.alert('SU TERMINAL ES: ' + key); |
25 | }; | 32 | }; |
26 | } | 33 | } |
27 | ]); | 34 | ]); |
28 | 35 |
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 mb-3"> | 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 | 25 | <a |
26 | class="btn btn-outline-dark mt-5 btn-lg" | 26 | class="btn btn-outline-dark mt-5 btn-lg" |
27 | href="javascript:void()" | 27 | href="javascript:void()" |
28 | ng-click="showTerminal()" | 28 | ng-click="showTerminal()" |
29 | > | 29 | > |
30 | <i class="fa fa-info-circle" aria-hidden="true"></i> | 30 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
31 | </a> | 31 | </a> |
32 | <a class="btn btn-outline-dark mt-5 btn-lg float-right" | 32 | <a class="btn btn-outline-dark mt-5 btn-lg" |
33 | href="javascript:void()" | 33 | href="javascript:void()" |
34 | ng-click="logout()" | 34 | ng-click="logout()" |
35 | > | 35 | > |
36 | <i class="fa fa-power-off" aria-hidden="true"></i> | 36 | <i class="fa fa-power-off" aria-hidden="true"></i> |
37 | </a> | 37 | </a> |
38 | </div> | 38 | </div> |
39 | </div> | 39 | </div> |
40 | </div> | 40 | </div> |
41 | 41 |