Commit 2f75519a7add4d79fe58022192a9976f0d22400f

Authored by Eric Fernandez
Exists in master

Merge branch 'master' of https://debo.suite.repo/modulos-npm/foca-modal-vendedores

# Conflicts:
#	src/views/modal-vendedores.html
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('templates', function() {
21 return pump( 21 return pump(
22 [ 22 [
23 gulp.src(paths.srcViews), 23 gulp.src(paths.srcViews),
24 replace('views/', ''), 24 replace('views/', ''),
25 htmlmin(), 25 htmlmin(),
26 templateCache('views.js', { 26 templateCache('views.js', {
27 module: 'focaModalVendedores', 27 module: 'focaModalVendedores',
28 root: '' 28 root: ''
29 }), 29 }),
30 gulp.dest(paths.tmp) 30 gulp.dest(paths.tmp)
31 ] 31 ]
32 ); 32 );
33 }); 33 });
34 34
35 gulp.task('uglify', ['templates'], function() { 35 gulp.task('uglify', ['templates'], function() {
36 return pump( 36 return pump(
37 [ 37 [
38 gulp.src([ 38 gulp.src([
39 paths.srcJS, 39 paths.srcJS,
40 'tmp/views.js' 40 'tmp/views.js'
41 ]), 41 ]),
42 concat('foca-modal-vendedores.js'), 42 concat('foca-modal-vendedores.js'),
43 replace('src/views/', ''), 43 replace('src/views/', ''),
44 replace("['ui.bootstrap', 'focaDirectivas']", '[]'), 44 replace("['ui.bootstrap', 'focaDirectivas']", '[]'),
45 gulp.dest(paths.tmp), 45 gulp.dest(paths.tmp),
46 rename('foca-modal-vendedores.min.js'), 46 rename('foca-modal-vendedores.min.js'),
47 uglify(), 47 uglify(),
48 gulp.dest(paths.dist) 48 gulp.dest(paths.dist)
49 ] 49 ]
50 ); 50 );
51 }); 51 });
52 52
53 gulp.task('pre-commit', function() { 53 gulp.task('pre-commit', function() {
54 return pump( 54 return pump(
55 [ 55 [
56 gulp.src(paths.srcJS), 56 gulp.src(paths.srcJS),
57 jshint('.jshintrc'), 57 jshint('.jshintrc'),
58 jshint.reporter('default'), 58 jshint.reporter('default'),
59 jshint.reporter('fail') 59 jshint.reporter('fail')
60 ] 60 ]
61 ); 61 );
62 62
63 gulp.start('uglify'); 63 gulp.start('uglify');
64 }); 64 });
65 65
66 gulp.task('webserver', function() { 66 gulp.task('webserver', function() {
67 pump [ 67 pump [
68 connect.server({port: 3000}) 68 connect.server({port: 3000})
69 ] 69 ]
70 }); 70 });
71 71
72 gulp.task('clean-post-install', function(){ 72 gulp.task('clean-post-install', function(){
73 return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', 73 return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js',
74 'index.html'], {read: false}) 74 'index.html'], {read: false})
75 .pipe(clean()); 75 .pipe(clean());
76 }); 76 });
77 77
78 gulp.task('default', ['webserver']); 78 gulp.task('default', ['webserver']);
79
80 gulp.task('watch', function() {
81 gulp.watch([paths.srcJS, paths.srcViews], ['uglify'])
82 });
79 83
src/views/modal-vendedores.html
1 <div class="modal-header"> 1 <div class="modal-header py-1">
2 <h3 class="modal-title">Búsqueda de vendedores</h3> 2 <h5 class="modal-title">Búsqueda de vendedores</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="selectedVendedor == -1" 14 foca-focus="selectedVendedor == -1"
15 ng-focus="selectedVendedor = -1" 15 ng-focus="selectedVendedor = -1"
16 > 16 >
17 <div class="input-group-append"> 17 <div class="input-group-append">
18 <button class="btn btn-outline-secondary" type="button" ng-click="busquedaPress(13)"> 18 <button class="btn btn-outline-secondary" type="button" ng-click="busquedaPress(13)">
19 <i class="fa fa-search" aria-hidden="true"></i> 19 <i class="fa fa-search" aria-hidden="true"></i>
20 </button> 20 </button>
21 </div> 21 </div>
22 <table ng-show="conResultados" class="table table-striped table-sm"> 22 <table ng-show="conResultados" class="table table-striped table-sm">
23 <thead> 23 <thead>
24 <tr> 24 <tr>
25 <th>Código</th> 25 <th>Código</th>
26 <th>Nombre</th> 26 <th>Nombre</th>
27 <th></th> 27 <th></th>
28 </tr> 28 </tr>
29 </thead> 29 </thead>
30 <tbody> 30 <tbody>
31 <tr class="selected" 31 <tr class="selected"
32 ng-repeat="(key, vendedor) in currentPageVendedores" 32 ng-repeat="(key, vendedor) in currentPageVendedores"
33 ng-click="select(vendedor)"> 33 ng-click="select(vendedor)">
34 <td ng-bind="vendedor.CodVen"></td> 34 <td ng-bind="vendedor.CodVen"></td>
35 <td ng-bind="vendedor.NomVen"></td> 35 <td ng-bind="vendedor.NomVen"></td>
36 <td> 36 <td>
37 <button 37 <button
38 type="button" 38 type="button"
39 class="btn p-2 float-right" 39 class="btn btn-xs p-1 float-right"
40 ng-class="{ 40 ng-class="{
41 'btn-secondary': selectedVendedor != key, 41 'btn-secondary': selectedVendedor != key,
42 'btn-primary': selectedVendedor == key 42 'btn-primary': selectedVendedor == key
43 }" 43 }"
44 foca-focus="selectedVendedor == {{key}}" 44 foca-focus="selectedVendedor == {{key}}"
45 ng-keydown="itemVendedor($event.keyCode)"> 45 ng-keydown="itemVendedor($event.keyCode)">
46 <i class="fa fa-arrow-right" aria-hidden="true"></i> 46 <i class="fa fa-arrow-right" aria-hidden="true"></i>
47 </button> 47 </button>
48 </td> 48 </td>
49 </tr> 49 </tr>
50 </tbody> 50 </tbody>
51 </table> 51 </table>
52 <nav ng-show="conResultados"> 52 <nav ng-show="conResultados">
53 <ul class="pagination justify-content-end"> 53 <ul class="pagination pagination-sm justify-content-end mb-0">
54 <li class="page-item" ng-class="{'disabled': currentPage == 1}"> 54 <li class="page-item" ng-class="{'disabled': currentPage == 1}">
55 <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> 55 <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)">
56 <span aria-hidden="true">&laquo;</span> 56 <span aria-hidden="true">&laquo;</span>
57 <span class="sr-only">Anterior</span> 57 <span class="sr-only">Anterior</span>
58 </a> 58 </a>
59 </li> 59 </li>
60 <li 60 <li
61 class="page-item" 61 class="page-item"
62 ng-repeat="pagina in paginas" 62 ng-repeat="pagina in paginas"
63 ng-class="{'active': pagina == currentPage}" 63 ng-class="{'active': pagina == currentPage}"
64 > 64 >
65 <a 65 <a
66 class="page-link" 66 class="page-link"
67 href="#" 67 href="#"
68 ng-click="selectPage(pagina)" 68 ng-click="selectPage(pagina)"
69 ng-bind="pagina" 69 ng-bind="pagina"
70 ></a> 70 ></a>
71 </li> 71 </li>
72 <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> 72 <li class="page-item" ng-class="{'disabled': currentPage == lastPage}">
73 <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> 73 <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)">
74 <span aria-hidden="true">&raquo;</span> 74 <span aria-hidden="true">&raquo;</span>
75 <span class="sr-only">Siguiente</span> 75 <span class="sr-only">Siguiente</span>
76 </a> 76 </a>
77 </li>
78 </ul>
79 </nav>
80 </div> 77 </li>
78 </ul>
79 </nav>
80 </div>
81 <div ng-show="sinResultados"> 81 <div ng-show="sinResultados">
82 <i class="fa fa-minus"></i> No se encontraron resultados. 82 <i class="fa fa-minus"></i> No se encontraron resultados.
83 </div> 83 </div>
84 </div> 84 </div>
85 <div class="modal-footer"> 85 <div class="modal-footer py-1">