-
Notifications
You must be signed in to change notification settings - Fork 81
/
base.html
314 lines (266 loc) · 12 KB
/
base.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
{% load i18n staticfiles menus %}
{% load common_tags %}
{% load waffle_tags %}
{% load render_bundle from webpack_loader %}
{% load webpack_static from webpack_loader %}
<!--[if IE 8]> <html class="no-js lt-ie9" lang="pt-br"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="pt-br">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<title>{% block head_title %}{% switch "SAPLN_SWITCH" %}SAPL-Normas - {% else %}SAPL - {%endswitch%}{{nome_sistema}}{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#343a40">
{% block head_content %}
<link rel="icon" href="{% webpack_static 'img/favicon.ico' %}" type="image/png">
{% block webpack_loader_css %}
{% render_chunk_vendors 'css' %}
{% render_bundle 'global' 'css' %}
{% endblock webpack_loader_css %}
{% block webpack_loader_chunks_css %}
{% endblock webpack_loader_chunks_css %}
{% endblock %}
</head>
<body>
<div class="page fadein">
{% if not sapl_as_sapn or user.is_authenticated%}
{% if not request|has_iframe %}
{% block navigation %}
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
{% block sections_navbar %} {% navbar 'navbar.yaml' %} {% endblock sections_navbar %}
<ul class="nav navbar-nav justify-content-end" id="autenticacao">
<li class="nav-item dropdown pesquisa">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img src="{% webpack_static 'img/search.png' %}"><span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="dropdown-item">
<form id="formulario-lexml" class="navbar-form search-form" method="get" action="">
<input id="input-lexml" type="text" class="form-control" placeholder="Pesquisar no LexML" />
</form>
</li>
</ul>
</li>
<li class="nav-item"><a class="nav-link"href="/sistema/ajuda"><img src="{% webpack_static 'img/manual.png' %}"></a></li>
{% if not user.is_authenticated %}
<li class="nav-item"><a class="nav-link" href="{% url 'sapl.base:login' %}"><img src="{% webpack_static 'img/user.png' %}"></a></li>
{% else %}
<li class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img height="30" width="30" src="{% webpack_static 'img/authenticated.png' %}"><span class="caret"></span></a>
</a>
<ul class="dropdown-menu">
<li class="dropdown-item"><a>{{user.username}}</a></li>
{% if not sapl_as_sapn and 'parlamentares.can_vote' in request.user.get_all_permissions %}
<li class="dropdown-item"><a href="" onclick="window.open('{% url 'sapl.painel:voto_individual' %}','Voto Individual','width=1000, height=800, scrollbars=yes')";>
Votar Matéria
</a></li>
{% endif %}
<li class="dropdown-item"><a href="{% url 'sapl.base:alterar_senha' %}">Alterar senha</a></li>
<li class="dropdown-item"><a href="{% url 'sapl.base:logout' %}">Sair</a></li>
</ul>
</li>
{% endif %}
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
{% endblock navigation %}
{% else %}
<div class="btn-cancel-iframe">
<a href="?iframe=0" target="_blank"><i class="fa fa-2x fa-arrows-alt"></i></a>
</div>
<header class="masthead">
<div class="container">
<div class="hidden-print">
{% subnav %}
</div>
</div>
</header>
{% endif %}
{% else %}
<div class="container">
<div class="row justify-content-end px-3">
{% if sapl_as_sapn and not user.is_authenticated%}
<small><a href="{% url 'sapl.base:login' %}">Acessar</a></small>
{% endif %}
</div>
</div>
{% endif %}
{% if not request|has_iframe %}
{# Header #}
{% block main_header %}
<header class="masthead">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/">
<img src="{% if logotipo %}{{ MEDIA_URL }}{{ logotipo }}{% else %}{% webpack_static 'img/logo.png' %}{% endif %}"
alt="Logo" class="img-responsive" >
<span class="vcenter">{% if nome %}{{ nome }}{% else %}{% trans 'Câmara/Assembléia não configurada'%}{% endif %}
<br/><small>{{nome_sistema}}</small>
</span>
</a>
</div>
<div class="hidden-print">
{% block sections_nav %} {% subnav %} {% endblock sections_nav %}
</div>
</div>
</header>
{% endblock main_header %}
{% endif %}
{# Main content #}
{% block content_container %}
<main id="content" class="content page__row">
<div class="container">
{# Feedback messages #}
{% for message in messages %}
<div class="alert alert-{% if message.tags == 'error' %}danger{% else %}{{ message.tags }}{% endif %} alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
{{ message|safe }}
</div>
{% endfor %}
{# Content header #}
{% block base_header %}
<div class="clearfix">
{% block help %}
{# {% if view.help_topic %}#}
{# <a class="contextual-help right" href="{% url 'sapl.base:help' %}{{ view.help_topic }}">{% trans 'Ajuda' %}</a>#}
{# {% endif %}#}
{% endblock %}
{% block title %}
<h1 class="page-header">
{% if title %}
{{ title|safe|linebreaksbr }}
{% elif object %}
{{ object|safe|linebreaksbr }}
{% endif %}
</h1>
{% endblock %}
</div>
{% endblock base_header %}
{# Content per se #}
{% block vue_content %}<div id="app"></div>{% endblock %}
{# Content per se #}
{% block base_content %}{% endblock %}
</div>
</main>
{% endblock content_container %}
{% if not request|has_iframe %}
{% block footer_container %}
<footer id="footer" class="footer page__row hidden-print">
<div class="container">
<div class="row">
<div class="col-md-4">
<a class="footer__logo" href="#">
<a href="http://www.interlegis.leg.br/">
<img src="{% webpack_static 'img/logo_interlegis.png' %}" alt="{% trans 'Logo do Interlegis' %} ">
</a>
</a>
<p>
<small>
Desenvolvido pelo <a href="http://www.interlegis.leg.br/">Interlegis</a> em software livre e aberto.
</small>
<span>Release: 3.1.163-RC18</span>
</p>
</div>
<div class="col-md-4">
<a class="footer__logo" href="#">
<img src="{% webpack_static 'img/logo_cc.png' %}" alt="{% trans 'Logo do Creative Commons BY SA' %}">
</a>
<p>
<small>
Conteúdo e dados sob licença <a href="https://creativecommons.org">Creative Commons</a> 4.0<br><a href="https://creativecommons.org/licenses/by/4.0/">Atribuir Fonte - Compartilhar Igual</a>
</small>
</p>
</div>
<div class="col-md-4">
{% if nome %}
<address>
<small>
<strong>
<span class="org">{{ nome }}</span>
</strong>
<br>
<span class="street-address">{{ endereco }}</span>
<br> CEP: <span class="postal-code">{{ cep }}</span> | Telefone: <span>{{ telefone }}</span>
<br>
<small><a href="{% url 'sapl.api:swagger_ui_schema_api' %}">{% trans 'OpenAPI' %}</a></small> |
<a href="{{endereco_web}}" class="url">{% trans 'Site' %}</a> |
<a href="mailto:{{email}}" class="email">{% trans 'Fale Conosco' %}</a>
</small>
</address>
{% else %}
Casa Legislativa não configurada.
<br>
{% if user.is_authenticated %}
<a href="{% url 'sapl.base:casalegislativa_list' %}">Favor configurar clicando aqui</a>
{% endif %}
{% endif %}
</div>
</div>
</div>
</footer>
</div>
{% endblock footer_container %}
{% endif %}
<div vw class="enabled">
<div vw-access-button class="active"></div>
<div vw-plugin-wrapper>
<div class="vw-plugin-top-wrapper"></div>
</div>
</div>
{% block foot_js %}
{% block webpack_loader_js %}
{% render_chunk_vendors 'js' %}
{% render_bundle 'global' 'js' %}
{% endblock webpack_loader_js %}
{% block webpack_loader_chunks_js %}
{% endblock webpack_loader_chunks_js %}
{% block extra_js %}{% endblock extra_js %}
<script type="text/javascript" >
function inIframe () {
try {
return window.location !== window.parent.location
} catch (e) {
return true;
}
}
$(document).ready(function(){
let iframe_set_backend = {{ request|has_iframe|lower }}
if (iframe_set_backend && !inIframe() ) {
location.href = location.origin + '?iframe=0'
}
var form = document.getElementById("formulario-lexml");
$("#input-lexml").change(function(){
let value = $("#input-lexml").val();
let url = "{% url 'sapl.lexml:lexml_search' 'xxx'%}"
url = url.replace('xxx', value)
form.action = url;
});
});
</script>
{% if not DEBUG %}
<script src="https://vlibras.gov.br/app/vlibras-plugin.js"></script>
<script>
new window.VLibras.Widget('https://vlibras.gov.br/app');
</script>
{% if "google_analytics_id_metrica"|get_config_attr %}
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{"google_analytics_id_metrica"|get_config_attr}}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{"google_analytics_id_metrica"|get_config_attr}}');
</script>
{% endif %}
{% endif %}
{% endblock foot_js %}
</body>
</html>