Commit 389106120f97798221d7d911477793d34976f984
1 parent
7de7716f
Exists in
master
and in
7 other branches
Inclusão de filtro na página de cadastro de operações
Showing
4 changed files
with
32 additions
and
22 deletions
Show diff stats
admin1/dicionario/core.js
| @@ -351,8 +351,8 @@ i3GEOadmin.core.dicionario = { | @@ -351,8 +351,8 @@ i3GEOadmin.core.dicionario = { | ||
| 351 | en : "", | 351 | en : "", |
| 352 | es : "" | 352 | es : "" |
| 353 | } ], | 353 | } ], |
| 354 | - '' : [ { | ||
| 355 | - pt : "", | 354 | + 'filtro' : [ { |
| 355 | + pt : "Filtro", | ||
| 356 | en : "", | 356 | en : "", |
| 357 | es : "" | 357 | es : "" |
| 358 | } ], | 358 | } ], |
admin1/usuarios/operacoes/index.js
| @@ -88,13 +88,13 @@ function pegaOperacoes(){ | @@ -88,13 +88,13 @@ function pegaOperacoes(){ | ||
| 88 | } | 88 | } |
| 89 | ); | 89 | ); |
| 90 | ondeListaOperacoes.html(html); | 90 | ondeListaOperacoes.html(html); |
| 91 | - //indice | 91 | + //filtro |
| 92 | html = Mustache.to_html( | 92 | html = Mustache.to_html( |
| 93 | - "{{#data}}" + $("#indiceTpl").html() + "{{/data}}", | 93 | + "{{#data}}" + $("#templateFiltro").html() + "{{/data}}", |
| 94 | {"data":json["operacoes"]} | 94 | {"data":json["operacoes"]} |
| 95 | ); | 95 | ); |
| 96 | - //indice lateral | ||
| 97 | - $("#indice").html(html); | 96 | + $("#filtro").html("<option value='' >---</option>" + html); |
| 97 | + | ||
| 98 | //monta um template para o modal de inclusao de nova operacao | 98 | //monta um template para o modal de inclusao de nova operacao |
| 99 | html = Mustache.to_html( | 99 | html = Mustache.to_html( |
| 100 | $("#templateOperacoes").html(), | 100 | $("#templateOperacoes").html(), |
| @@ -220,3 +220,18 @@ function salvarOperacao(id_operacao){ | @@ -220,3 +220,18 @@ function salvarOperacao(id_operacao){ | ||
| 220 | } | 220 | } |
| 221 | ); | 221 | ); |
| 222 | } | 222 | } |
| 223 | +function filtra(obj,id){ | ||
| 224 | + $("#" + id + " .panel").each( | ||
| 225 | + function(i,el){ | ||
| 226 | + if(obj.value == ""){ | ||
| 227 | + $(el).show(); | ||
| 228 | + } | ||
| 229 | + else { | ||
| 230 | + $(el).hide(); | ||
| 231 | + } | ||
| 232 | + } | ||
| 233 | + ); | ||
| 234 | + if(obj.value != ""){ | ||
| 235 | + $("#"+obj.value).show(); | ||
| 236 | + } | ||
| 237 | +} |
admin1/usuarios/operacoes/index.php
| @@ -16,7 +16,7 @@ include "../../head.php"; | @@ -16,7 +16,7 @@ include "../../head.php"; | ||
| 16 | </div> | 16 | </div> |
| 17 | <div class="container"> | 17 | <div class="container"> |
| 18 | <div class="row center-block"> | 18 | <div class="row center-block"> |
| 19 | - <div class="col-sm-12 col-md-10"> | 19 | + <div class="col-md-12"> |
| 20 | <div class="well hidden" id="titulo"> | 20 | <div class="well hidden" id="titulo"> |
| 21 | <button data-toggle="modal" data-target="#ajudaPrincipal" | 21 | <button data-toggle="modal" data-target="#ajudaPrincipal" |
| 22 | class="btn btn-primary btn-fab btn-fab-mini pull-right"> | 22 | class="btn btn-primary btn-fab btn-fab-mini pull-right"> |
| @@ -24,6 +24,12 @@ include "../../head.php"; | @@ -24,6 +24,12 @@ include "../../head.php"; | ||
| 24 | </button> | 24 | </button> |
| 25 | <h3>{{{operacoes}}}</h3> | 25 | <h3>{{{operacoes}}}</h3> |
| 26 | <h4>{{{txtAjuda}}}</h4> | 26 | <h4>{{{txtAjuda}}}</h4> |
| 27 | + <!-- aqui entra o filtro --> | ||
| 28 | + <div class="form-group"> | ||
| 29 | + <label class="control-label">{{{filtro}}}</label> | ||
| 30 | + <select onchange="filtra(this,'corpo')" id="filtro" class="form-control input-lg"> | ||
| 31 | + </select> | ||
| 32 | + </div> | ||
| 27 | <div class="row pull-right"> | 33 | <div class="row pull-right"> |
| 28 | <a onclick="adicionaOperacaoDialogo();" href="javascript:void(0)" class="btn btn-primary" role="button">{{{adicionar}}}</a> | 34 | <a onclick="adicionaOperacaoDialogo();" href="javascript:void(0)" class="btn btn-primary" role="button">{{{adicionar}}}</a> |
| 29 | </div> | 35 | </div> |
| @@ -44,22 +50,10 @@ include "../../head.php"; | @@ -44,22 +50,10 @@ include "../../head.php"; | ||
| 44 | </div> | 50 | </div> |
| 45 | </div> | 51 | </div> |
| 46 | </div> | 52 | </div> |
| 47 | - <!-- lateral--> | ||
| 48 | - <div class="col-md-2 hidden-sm hidden"> | ||
| 49 | - <nav class="bs-docs-sidebar affix-top" style="" id="indiceSpy"> | ||
| 50 | - <ul class="nav nav-pills nav-stacked" role="tablist"> | ||
| 51 | - <li><a onclick="$('.panel').show();" href="#">Links <i class="material-icons">visibility</i></a></li> | ||
| 52 | - </ul> | ||
| 53 | - <ul class="nav nav-pills nav-stacked" role="tablist" id="indice"> | ||
| 54 | - </ul> | ||
| 55 | - </nav> | ||
| 56 | - </div> | ||
| 57 | - | ||
| 58 | </div> | 53 | </div> |
| 59 | </div> | 54 | </div> |
| 60 | -<!-- li do indice lateral--> | ||
| 61 | -<script id="indiceTpl" type="x-tmpl-mustache"> | ||
| 62 | -<li id="link-{{id_operacao}}"><a onclick="$('.panel').hide();$('#form-{{id_operacao}}').show();" href="#">{{{codigo}}}</a></li> | 55 | +<script id="templateFiltro" type="x-tmpl-mustache"> |
| 56 | +<option value="form-{{id_operacao}}">{{{codigo}}}</option> | ||
| 63 | </script> | 57 | </script> |
| 64 | <script id="templateOperacoes" type="x-tmpl-mustache"> | 58 | <script id="templateOperacoes" type="x-tmpl-mustache"> |
| 65 | <div class="panel panel-default" id="form-{{id_operacao}}"> | 59 | <div class="panel panel-default" id="form-{{id_operacao}}"> |
| @@ -118,6 +112,7 @@ include "../../head.php"; | @@ -118,6 +112,7 @@ include "../../head.php"; | ||
| 118 | var t = $("#titulo"); | 112 | var t = $("#titulo"); |
| 119 | //complementa dicionario | 113 | //complementa dicionario |
| 120 | i3GEOadmin.operacoes.dicionario.adicionar = i3GEOadmin.core.dicionario.adicionar; | 114 | i3GEOadmin.operacoes.dicionario.adicionar = i3GEOadmin.core.dicionario.adicionar; |
| 115 | + i3GEOadmin.operacoes.dicionario.filtro = i3GEOadmin.core.dicionario.filtro; | ||
| 121 | t.html( | 116 | t.html( |
| 122 | Mustache.to_html( | 117 | Mustache.to_html( |
| 123 | t.html(), | 118 | t.html(), |
init/index.js
| @@ -103,7 +103,7 @@ botoesIni = [ | @@ -103,7 +103,7 @@ botoesIni = [ | ||
| 103 | "titulo":$trad(3,g_traducao_init), | 103 | "titulo":$trad(3,g_traducao_init), |
| 104 | "subtitulo": $trad("3a",g_traducao_init), | 104 | "subtitulo": $trad("3a",g_traducao_init), |
| 105 | "fa": "cogs", | 105 | "fa": "cogs", |
| 106 | - "target": "_blank" | 106 | + "target": "_self" |
| 107 | },{ | 107 | },{ |
| 108 | "img":"folder-image.png", | 108 | "img":"folder-image.png", |
| 109 | "href": "../exemplos/index.php", | 109 | "href": "../exemplos/index.php", |