Commit e6339c992fd3979a8c1ac1c322b6c42a91a32c97
1 parent
e5e74aaba4
Exists in
master
- Modifiqué los estilos para achicar los elementos.
- Agregué tareas clean y watch al gulp.
Showing
2 changed files
with
18 additions
and
9 deletions
Show diff stats
gulpfile.js
| 1 | const templateCache = require('gulp-angular-templatecache'); | 1 | const templateCache = require('gulp-angular-templatecache'); |
| 2 | const concat = require('gulp-concat'); | 2 | const concat = require('gulp-concat'); |
| 3 | const htmlmin = require('gulp-htmlmin'); | 3 | const htmlmin = require('gulp-htmlmin'); |
| 4 | const rename = require('gulp-rename'); | 4 | const rename = require('gulp-rename'); |
| 5 | const uglify = require('gulp-uglify'); | 5 | const uglify = require('gulp-uglify'); |
| 6 | const gulp = require('gulp'); | 6 | const gulp = require('gulp'); |
| 7 | const pump = require('pump'); | 7 | const pump = require('pump'); |
| 8 | const jshint = require('gulp-jshint'); | 8 | const jshint = require('gulp-jshint'); |
| 9 | const replace = require('gulp-replace'); | 9 | const replace = require('gulp-replace'); |
| 10 | const connect = require('gulp-connect'); | 10 | const connect = require('gulp-connect'); |
| 11 | const clean = require('gulp-clean'); | 11 | const clean = require('gulp-clean'); |
| 12 | 12 | ||
| 13 | var paths = { | 13 | var paths = { |
| 14 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', |
| 15 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', |
| 16 | tmp: 'tmp', | 16 | tmp: 'tmp', |
| 17 | dist: 'dist/' | 17 | dist: 'dist/' |
| 18 | }; | 18 | }; |
| 19 | 19 | ||
| 20 | gulp.task('templates', function() { | 20 | gulp.task('clean', function() { |
| 21 | return gulp.src(['tmp', 'dist'], {read: false}) | ||
| 22 | .pipe(clean()); | ||
| 23 | }); | ||
| 24 | |||
| 25 | gulp.task('templates', ['clean'], function() { | ||
| 21 | return pump( | 26 | return pump( |
| 22 | [ | 27 | [ |
| 23 | gulp.src(paths.srcViews), | 28 | gulp.src(paths.srcViews), |
| 24 | htmlmin(), | 29 | htmlmin(), |
| 25 | templateCache('views.js', { | 30 | templateCache('views.js', { |
| 26 | module: 'focaModalMoneda', | 31 | module: 'focaModalMoneda', |
| 27 | root: '' | 32 | root: '' |
| 28 | }), | 33 | }), |
| 29 | gulp.dest(paths.tmp) | 34 | gulp.dest(paths.tmp) |
| 30 | ] | 35 | ] |
| 31 | ); | 36 | ); |
| 32 | }); | 37 | }); |
| 33 | 38 | ||
| 34 | gulp.task('uglify', ['templates'], function() { | 39 | gulp.task('uglify', ['templates'], function() { |
| 35 | return pump( | 40 | return pump( |
| 36 | [ | 41 | [ |
| 37 | gulp.src([ | 42 | gulp.src([ |
| 38 | paths.srcJS, | 43 | paths.srcJS, |
| 39 | 'tmp/views.js' | 44 | 'tmp/views.js' |
| 40 | ]), | 45 | ]), |
| 41 | concat('foca-modal-moneda.js'), | 46 | concat('foca-modal-moneda.js'), |
| 42 | replace('src/views/', ''), | 47 | replace('src/views/', ''), |
| 43 | replace("['ui.bootstrap', 'focaDirectivas']", '[]'), | 48 | replace("['ui.bootstrap', 'focaDirectivas']", '[]'), |
| 44 | gulp.dest(paths.tmp), | 49 | gulp.dest(paths.tmp), |
| 45 | rename('foca-modal-moneda.min.js'), | 50 | rename('foca-modal-moneda.min.js'), |
| 46 | uglify(), | 51 | uglify(), |
| 47 | gulp.dest(paths.dist) | 52 | gulp.dest(paths.dist) |
| 48 | ] | 53 | ] |
| 49 | ); | 54 | ); |
| 50 | }); | 55 | }); |
| 51 | 56 | ||
| 52 | gulp.task('pre-commit', function() { | 57 | gulp.task('pre-commit', function() { |
| 53 | return pump( | 58 | return pump( |
| 54 | [ | 59 | [ |
| 55 | gulp.src(paths.srcJS), | 60 | gulp.src(paths.srcJS), |
| 56 | jshint('.jshintrc'), | 61 | jshint('.jshintrc'), |
| 57 | jshint.reporter('default'), | 62 | jshint.reporter('default'), |
| 58 | jshint.reporter('fail') | 63 | jshint.reporter('fail') |
| 59 | ] | 64 | ] |
| 60 | ); | 65 | ); |
| 61 | }); | 66 | }); |
| 62 | 67 | ||
| 63 | gulp.task('webserver', function() { | 68 | gulp.task('webserver', function() { |
| 64 | pump [ | 69 | pump [ |
| 65 | connect.server({port: 3000}) | 70 | connect.server({port: 3000}) |
| 66 | ] | 71 | ] |
| 67 | }); | 72 | }); |
| 68 | 73 | ||
| 69 | gulp.task('clean-post-install', function(){ | 74 | gulp.task('clean-post-install', function(){ |
| 70 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 75 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
| 71 | 'index.html'], {read: false}) | 76 | 'index.html'], {read: false}) |
| 72 | .pipe(clean()); | 77 | .pipe(clean()); |
| 73 | }); | 78 | }); |
| 74 | 79 | ||
| 75 | gulp.task('default', ['webserver']); | 80 | gulp.task('default', ['webserver']); |
| 81 | |||
| 82 | gulp.task('watch', function() { | ||
| 83 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | ||
| 84 | }); | ||
| 76 | 85 |
src/views/modal-moneda.html
| 1 | <div class="modal-header"> | 1 | <div class="modal-header py-1"> |
| 2 | <h3 class="modal-title">Busqueda de Moneda</h3> | 2 | <h5 class="modal-title">Busqueda de Moneda</h5> |
| 3 | </div> | 3 | </div> |
| 4 | <div class="modal-body" id="modal-body"> | 4 | <div class="modal-body" id="modal-body"> |
| 5 | <div class="input-group mb-3"> | 5 | <div class="input-group"> |
| 6 | <input | 6 | <input |
| 7 | type="text" | 7 | type="text" |
| 8 | class="form-control" | 8 | class="form-control form-control-sm" |
| 9 | placeholder="Busqueda" | 9 | placeholder="Busqueda" |
| 10 | ng-model="filters" | 10 | ng-model="filters" |
| 11 | ng-change="search()" | 11 | ng-change="search()" |
| 12 | ng-keydown="busquedaDown($event.keyCode)" | 12 | ng-keydown="busquedaDown($event.keyCode)" |
| 13 | ng-keypress="busquedaPress($event.keyCode)" | 13 | ng-keypress="busquedaPress($event.keyCode)" |
| 14 | foca-focus="selectedMoneda == -1" | 14 | foca-focus="selectedMoneda == -1" |
| 15 | ng-focus="selectedMoneda = -1" | 15 | ng-focus="selectedMoneda = -1" |
| 16 | > | 16 | > |
| 17 | <table class="table table-striped table-sm"> | 17 | <table class="table table-striped table-sm"> |
| 18 | <thead> | 18 | <thead> |
| 19 | <tr> | 19 | <tr> |
| 20 | <th>Nombre</th> | 20 | <th>Nombre</th> |
| 21 | <th>Simbolo</th> | 21 | <th>Simbolo</th> |
| 22 | <th></th> | 22 | <th></th> |
| 23 | </tr> | 23 | </tr> |
| 24 | </thead> | 24 | </thead> |
| 25 | <tbody> | 25 | <tbody> |
| 26 | <tr | 26 | <tr |
| 27 | class="selectable" | 27 | class="selectable" |
| 28 | ng-repeat="(key,moneda) in currentPageMoneda" | 28 | ng-repeat="(key,moneda) in currentPageMoneda" |
| 29 | ng-click="select(moneda)" | 29 | ng-click="select(moneda)" |
| 30 | > | 30 | > |
| 31 | <td ng-bind="moneda.DETALLE"></td> | 31 | <td ng-bind="moneda.DETALLE"></td> |
| 32 | <td ng-bind="moneda.SIMBOLO"></td> | 32 | <td ng-bind="moneda.SIMBOLO"></td> |
| 33 | <td> | 33 | <td> |
| 34 | <button | 34 | <button |
| 35 | type="button" | 35 | type="button" |
| 36 | class="btn p-2 float-right" | 36 | class="btn btn-xs p-1 float-right" |
| 37 | ng-class="{ | 37 | ng-class="{ |
| 38 | 'btn-secondary': selectedMoneda != key, | 38 | 'btn-secondary': selectedMoneda != key, |
| 39 | 'btn-primary': selectedMoneda == key | 39 | 'btn-primary': selectedMoneda == key |
| 40 | }" | 40 | }" |
| 41 | foca-focus="selectedMoneda == {{key}}" | 41 | foca-focus="selectedMoneda == {{key}}" |
| 42 | ng-keydown="itemProducto($event.keyCode)" | 42 | ng-keydown="itemProducto($event.keyCode)" |
| 43 | > | 43 | > |
| 44 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 44 | <i class="fa fa-arrow-right" aria-hidden="true"></i> |
| 45 | </button> | 45 | </button> |
| 46 | </td> | 46 | </td> |
| 47 | </tr> | 47 | </tr> |
| 48 | </tbody> | 48 | </tbody> |
| 49 | </table> | 49 | </table> |
| 50 | <nav> | 50 | <nav> |
| 51 | <ul class="pagination justify-content-end"> | 51 | <ul class="pagination pagination-sm justify-content-end mb-0"> |
| 52 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 52 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
| 53 | <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> | 53 | <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> |
| 54 | <span aria-hidden="true">«</span> | 54 | <span aria-hidden="true">«</span> |
| 55 | <span class="sr-only">Anterior</span> | 55 | <span class="sr-only">Anterior</span> |
| 56 | </a> | 56 | </a> |
| 57 | </li> | 57 | </li> |
| 58 | <li | 58 | <li |
| 59 | class="page-item" | 59 | class="page-item" |
| 60 | ng-repeat="pagina in paginas" | 60 | ng-repeat="pagina in paginas" |
| 61 | ng-class="{'active': pagina == currentPage}" | 61 | ng-class="{'active': pagina == currentPage}" |
| 62 | > | 62 | > |
| 63 | <a | 63 | <a |
| 64 | class="page-link" | 64 | class="page-link" |
| 65 | href="#" | 65 | href="#" |
| 66 | ng-click="selectPage(pagina)" | 66 | ng-click="selectPage(pagina)" |
| 67 | ng-bind="pagina" | 67 | ng-bind="pagina" |
| 68 | ></a> | 68 | ></a> |
| 69 | </li> | 69 | </li> |
| 70 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 70 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
| 71 | <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> | 71 | <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> |
| 72 | <span aria-hidden="true">»</span> | 72 | <span aria-hidden="true">»</span> |
| 73 | <span class="sr-only">Siguiente</span> | 73 | <span class="sr-only">Siguiente</span> |
| 74 | </a> | 74 | </a> |
| 75 | </li> | 75 | </li> |
| 76 | </ul> | 76 | </ul> |
| 77 | </nav> | 77 | </nav> |
| 78 | </div> | 78 | </div> |
| 79 | </div> | 79 | </div> |
| 80 | <div class="modal-footer"> | 80 | <div class="modal-footer py-1"> |
| 81 | <button class="btn btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | 81 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
| 82 | </div> | 82 | </div> |
| 83 | 83 |