Commit 50a5051457ebe3c387db34e8126b21825423b8a7
1 parent
ed96bfad
Exists in
master
Padronização do código e da interface da opção de listagem de mapas, conforme o …
…modelo adotado no sistema de administração
Showing
5 changed files
with
86 additions
and
40 deletions
Show diff stats
mapas/dicionario.js
@@ -10,5 +10,25 @@ g_traducao_mapas = | @@ -10,5 +10,25 @@ g_traducao_mapas = | ||
10 | pt : "Copiado", | 10 | pt : "Copiado", |
11 | en : "", | 11 | en : "", |
12 | es : "" | 12 | es : "" |
13 | + }], | ||
14 | + "outrosLinks" : [{ | ||
15 | + pt : "outros links", | ||
16 | + en : "", | ||
17 | + es : "" | ||
18 | + }], | ||
19 | + "linkDefault" : [{ | ||
20 | + pt : "abre o mapa", | ||
21 | + en : "", | ||
22 | + es : "" | ||
23 | + }], | ||
24 | + "tituloModal" : [{ | ||
25 | + pt : "O mapa pode ser aberto com diferentes interfaces, escolha abaixo", | ||
26 | + en : "", | ||
27 | + es : "" | ||
28 | + }], | ||
29 | + "txtDesc" : [{ | ||
30 | + pt : "Lista de mapas que foram elaborados previamente. Os mapas podem ser abertos com diferentes interfaces ou como foram salvos originalmente. Utilize os links principais de cada um para abrir ou a opção de links adicionais.", | ||
31 | + en : "", | ||
32 | + es : "" | ||
13 | }] | 33 | }] |
14 | }; | 34 | }; |
mapas/index.js
@@ -10,9 +10,12 @@ function mostraBotoesBT(){ | @@ -10,9 +10,12 @@ function mostraBotoesBT(){ | ||
10 | } | 10 | } |
11 | html = Mustache.to_html( | 11 | html = Mustache.to_html( |
12 | "{{#mapas}}" + $("#templateLista").html() + "{{/mapas}}", | 12 | "{{#mapas}}" + $("#templateLista").html() + "{{/mapas}}", |
13 | - d | 13 | + $.extend( |
14 | + {}, | ||
15 | + i3GEO.idioma.objetoIdioma(g_traducao_mapas), | ||
16 | + d | ||
17 | + ) | ||
14 | ); | 18 | ); |
15 | - | ||
16 | $("#corpo").html(html); | 19 | $("#corpo").html(html); |
17 | d.mapas.push({ | 20 | d.mapas.push({ |
18 | "ID_MAPA": "topo", | 21 | "ID_MAPA": "topo", |
@@ -32,6 +35,7 @@ function mostraBotoesBT(){ | @@ -32,6 +35,7 @@ function mostraBotoesBT(){ | ||
32 | //cpJSON vem de classe_php.js | 35 | //cpJSON vem de classe_php.js |
33 | cpJSON.call("../classesphp/mapa_controle.php?map_file=&funcao=pegaMapas&g_sid=", "foo", r); | 36 | cpJSON.call("../classesphp/mapa_controle.php?map_file=&funcao=pegaMapas&g_sid=", "foo", r); |
34 | } | 37 | } |
38 | +//define os links adicionais conforme o tipo de mapa | ||
35 | function verificaMapa(mapa){ | 39 | function verificaMapa(mapa){ |
36 | var link, nome, combo, links = [], html; | 40 | var link, nome, combo, links = [], html; |
37 | //imagem dinamica ou nao | 41 | //imagem dinamica ou nao |
mapas/index.php
@@ -91,19 +91,7 @@ include "../init/head.php"; | @@ -91,19 +91,7 @@ include "../init/head.php"; | ||
91 | width: 80px; | 91 | width: 80px; |
92 | } | 92 | } |
93 | </style> | 93 | </style> |
94 | -<script id="templateLinks" type="x-tmpl-mustache"> | ||
95 | -<div class="list-group"> | ||
96 | - <div class="row-content" > | ||
97 | - <h4 class="list-group-item-heading"> | ||
98 | - {{{nome}}} | ||
99 | - </h4> | ||
100 | - <p class="list-group-item-text hidden-xs hidden-sm"> | ||
101 | - <a href="{{{link}}}" target="_blank">{{{link}}}</a> | ||
102 | - </p> | ||
103 | - </div> | ||
104 | - <div class="list-group-separator"></div> | ||
105 | -</div> | ||
106 | -</script> | 94 | + |
107 | <body style="padding-top: 55px; position: relative;" > | 95 | <body style="padding-top: 55px; position: relative;" > |
108 | <nav class="navbar navbar-default navbar-fixed-top"> | 96 | <nav class="navbar navbar-default navbar-fixed-top"> |
109 | <div class="container-fluid"> | 97 | <div class="container-fluid"> |
@@ -131,6 +119,13 @@ include "../init/head.php"; | @@ -131,6 +119,13 @@ include "../init/head.php"; | ||
131 | <div class="container"> | 119 | <div class="container"> |
132 | <div class="row center-block"> | 120 | <div class="row center-block"> |
133 | <div class="col-md-12"> | 121 | <div class="col-md-12"> |
122 | + <div class="well hidden escondido" > | ||
123 | + <blockquote id="titulo"></blockquote> | ||
124 | + </div> | ||
125 | + </div> | ||
126 | + </div> | ||
127 | + <div class="row center-block"> | ||
128 | + <div class="col-md-12"> | ||
134 | <div class="well" id="corpo"> | 129 | <div class="well" id="corpo"> |
135 | <i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i> <span class="sr-only">Loading...</span> | 130 | <i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i> <span class="sr-only">Loading...</span> |
136 | </div> | 131 | </div> |
@@ -149,30 +144,10 @@ include "../init/head.php"; | @@ -149,30 +144,10 @@ include "../init/head.php"; | ||
149 | </div> | 144 | </div> |
150 | </div> | 145 | </div> |
151 | </div> | 146 | </div> |
152 | -<script id="templateLista" type="x-tmpl-mustache"> | ||
153 | -<div class="list-group-item" > | ||
154 | - <div class="row-content" > | ||
155 | - <h4 class="list-group-item-heading"> | ||
156 | - <span class="pull-right"> </span> | ||
157 | - <a onclick="mostraLinks('detalhe_{{ID_MAPA}}')" href="javascript:void(0)" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
158 | - <i class="material-icons md-18">more_horiz</i> | ||
159 | - </a> | ||
160 | - <span class="pull-right"> </span> | ||
161 | - <a title="default" href="{{{LINK}}}" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
162 | - <i class="material-icons md-18">launch</i> | ||
163 | - </a> | ||
164 | - <span class="pull-right"> </span> | ||
165 | - <a title="link" role="button" href="javascript:void(0)" data-toggle="quadroQrcode" data-url="{{{LINK}}}" class="btn btn-danger btn-fab btn-fab-mini pull-right"> | ||
166 | - <span class="glyphicon glyphicon-qrcode" aria-hidden="true"></span> | ||
167 | - </a> | ||
168 | - <a href="{{{LINK}}}"><img class="img-rounded" src="{{{IMAGEM}}}" /> {{{NOME}}}</a> | ||
169 | - </h4> | ||
170 | - </div> | ||
171 | - <div class="list-group-separator"></div> | ||
172 | -</div> | ||
173 | -<!-- dados para o modal --> | ||
174 | -<div style="display:none" id="detalhe_{{ID_MAPA}}">{{{subtitulo}}}</div> | ||
175 | -</script> | 147 | + <?php |
148 | + include("templates/templatelinks.php"); | ||
149 | + include("templates/templatelista.php"); | ||
150 | + ?> | ||
176 | <script src='../pacotes/cpaint/cpaint2_compacto.inc.js'></script> | 151 | <script src='../pacotes/cpaint/cpaint2_compacto.inc.js'></script> |
177 | <script src='../classesjs/compactados/dicionario_compacto.js'></script> | 152 | <script src='../classesjs/compactados/dicionario_compacto.js'></script> |
178 | <script src='../classesjs/compactados/classe_util_compacto.js'></script> | 153 | <script src='../classesjs/compactados/classe_util_compacto.js'></script> |
@@ -185,7 +160,13 @@ include "../init/head.php"; | @@ -185,7 +160,13 @@ include "../init/head.php"; | ||
185 | <script> | 160 | <script> |
186 | $(document).ready(function(){ | 161 | $(document).ready(function(){ |
187 | i3GEO.configura = {"locaplic" : window.location.href.split("/mapas")[0],"sid": ""}; | 162 | i3GEO.configura = {"locaplic" : window.location.href.split("/mapas")[0],"sid": ""}; |
188 | - $(".active").html($trad("mapas",g_traducao_mapas)); | 163 | + //traducoes de alguns elementos individualmente |
164 | + $(".active").html( | ||
165 | + $trad("mapas",g_traducao_mapas) | ||
166 | + ); | ||
167 | + $("#titulo").html( | ||
168 | + $trad("txtDesc",g_traducao_mapas) | ||
169 | + ); | ||
189 | mostraBotoesBT(); | 170 | mostraBotoesBT(); |
190 | $('.escondido').removeClass('hidden'); | 171 | $('.escondido').removeClass('hidden'); |
191 | $.material.init(); | 172 | $.material.init(); |
@@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||
1 | +<script id="templateLinks" type="x-tmpl-mustache"> | ||
2 | +<div class="list-group"> | ||
3 | + <div class="list-group-separator"></div> | ||
4 | + <div class="row-content" > | ||
5 | + <h4 class="list-group-item-heading"> | ||
6 | + {{{nome}}} | ||
7 | + </h4> | ||
8 | + <p class="list-group-item-text hidden-xs hidden-sm"> | ||
9 | + <a href="{{{link}}}" target="_blank">{{{link}}}</a> | ||
10 | + </p> | ||
11 | + </div> | ||
12 | + <div class="list-group-separator"></div> | ||
13 | +</div> | ||
14 | +</script> | ||
0 | \ No newline at end of file | 15 | \ No newline at end of file |
@@ -0,0 +1,27 @@ | @@ -0,0 +1,27 @@ | ||
1 | +<script id="templateLista" type="x-tmpl-mustache"> | ||
2 | +<div class="list-group-item" > | ||
3 | + <div class="row-content" > | ||
4 | + <h4 class="list-group-item-heading"> | ||
5 | + <span class="pull-right"> </span> | ||
6 | + <a title="{{{outrosLinks}}}" onclick="mostraLinks('detalhe_{{ID_MAPA}}')" href="javascript:void(0)" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
7 | + <i class="material-icons md-18">more_horiz</i> | ||
8 | + </a> | ||
9 | + <span class="pull-right"> </span> | ||
10 | + <a title="{{{linkDefault}}}" href="{{{LINK}}}" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
11 | + <i class="material-icons md-18">launch</i> | ||
12 | + </a> | ||
13 | + <span class="pull-right"> </span> | ||
14 | + <a title="link" role="button" href="javascript:void(0)" data-toggle="quadroQrcode" data-url="{{{LINK}}}" class="btn btn-danger btn-fab btn-fab-mini pull-right"> | ||
15 | + <span class="glyphicon glyphicon-qrcode" aria-hidden="true"></span> | ||
16 | + </a> | ||
17 | + <a href="{{{LINK}}}"><img class="img-rounded" src="{{{IMAGEM}}}" /> {{{NOME}}}</a> | ||
18 | + </h4> | ||
19 | + </div> | ||
20 | + <div class="list-group-separator"></div> | ||
21 | +</div> | ||
22 | +<!-- dados para o modal --> | ||
23 | +<div style="display:none" id="detalhe_{{ID_MAPA}}"> | ||
24 | +<h4>{{{tituloModal}}}</h4> | ||
25 | +{{{subtitulo}}} | ||
26 | +</div> | ||
27 | +</script> | ||
0 | \ No newline at end of file | 28 | \ No newline at end of file |