mirror of https://github.com/interlegis/sapl.git
Browse Source
* Implementa Relatório de Votações Nominais * Alterações solicitadas - Relatório de Votações Nominais * Apply suggestions from code review Todas as sugestões de alteração acatadas. Co-authored-by: Edward <9326037+edwardoliveira@users.noreply.github.com> * Update views.py Conforme observação sobre o retorno da QuerySet, escolha da opção 2 - colocar o qs dentro dos if's. Também houve a alteração na view, utilizando diretamente a classe genérica MultiFormatOutputMixin. Com a refatoração efetuada, não foi necessário definir uma especificação da mesma. --------- Co-authored-by: root <root@info38.camaranh> Co-authored-by: Edward <9326037+edwardoliveira@users.noreply.github.com>pull/3790/head
committed by
GitHub
8 changed files with 351 additions and 17 deletions
@ -0,0 +1,82 @@ |
|||||
|
{% extends "crud/list.html" %} |
||||
|
{% load i18n %} |
||||
|
{% load crispy_forms_tags %} |
||||
|
|
||||
|
{% block base_content %} |
||||
|
{% if not show_results %} |
||||
|
{% crispy filter.form %} |
||||
|
{% else %} |
||||
|
<div class="float-left"> |
||||
|
{% with 'sapl.relatorios:relatorio_votacoes_nominais' as url_reverse %} |
||||
|
{% include "crud/format_options.html" %} |
||||
|
{% endwith %} |
||||
|
</div> |
||||
|
|
||||
|
<div class="actions btn-group float-right" role="group"> |
||||
|
<a href="{% url 'sapl.relatorios:relatorio_votacoes_nominais' %}" class="btn btn-outline-primary">{% trans 'Fazer uma nova pesquisa' %}</a> |
||||
|
</div> |
||||
|
<br /><br /> |
||||
|
<b>PARÂMETROS DE PESQUISA<br /></b> |
||||
|
{% if tipo_materia %} |
||||
|
 Tipo de Matéria: {{ tipo_materia }}<br /> |
||||
|
{% endif %} |
||||
|
{% if numero %} |
||||
|
 Número: {{ numero }}<br /> |
||||
|
{% endif %} |
||||
|
{% if ano %} |
||||
|
 Ano: {{ ano }}<br /> |
||||
|
{% endif %} |
||||
|
 Período: {{ periodo }}<br /><br /> |
||||
|
|
||||
|
{% if object_list %} |
||||
|
|
||||
|
{% if qtde_votacoes > 1 %} |
||||
|
<h3>Foram encontradas {{qtde_votacoes}} votações.</h3></br> |
||||
|
{% elif qtde_votacoes == 1 %} |
||||
|
<h3>Foi encontrada {{qtde_votacoes}} votação.</h3></br> |
||||
|
{% endif %} |
||||
|
|
||||
|
<table class="table table-bordered table-hover"> |
||||
|
<thead class="thead-default" > |
||||
|
<tr> |
||||
|
<th>Dados da Votação / Matéria</th> |
||||
|
<th>Parlamentar - Voto</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
{% for rv in object_list %} |
||||
|
<tr> |
||||
|
<td class="materia"> |
||||
|
{% if rv.ordem %} |
||||
|
<b><a href="{% url 'sapl.materia:materialegislativa_detail' rv.ordem.materia_id %}">{{ rv.ordem.materia }}</a></b> - {{ rv.ordem.materia.ementa }}<br /> |
||||
|
<b>Momento da Votação: </b><a href="{% url 'sapl.sessao:ordemdia_list' rv.ordem.sessao_plenaria_id %}">Ordem do Dia</a> - |
||||
|
<a href="{% url 'sapl.sessao:sessaoplenaria_detail' rv.ordem.sessao_plenaria_id %}">{{ rv.ordem.sessao_plenaria }}</a><br /> |
||||
|
<b>Data da Votação: </b>{{ rv.data_hora|date:"d/m/Y" }}<br /> |
||||
|
<b>Resultado: </b>{{ rv.ordem.resultado }} |
||||
|
{% else %} |
||||
|
<b><a href="{% url 'sapl.materia:materialegislativa_detail' rv.expediente.materia_id %}">{{ rv.expediente.materia }}</a></b> - {{ rv.expediente.materia.ementa }}<br /> |
||||
|
<b>Momento da Votação: </b><a href="{% url 'sapl.sessao:expedientemateria_list' rv.expediente.sessao_plenaria_id %}">Expediente</a> - |
||||
|
<a href="{% url 'sapl.sessao:sessaoplenaria_detail' rv.expediente.sessao_plenaria_id %}">{{ rv.expediente.sessao_plenaria }}</a><br /> |
||||
|
<b>Data da Votação: </b>{{ rv.data_hora|date:"d/m/Y" }}<br /> |
||||
|
<b>Resultado: </b>{{ rv.expediente.resultado }} |
||||
|
{% endif %} |
||||
|
</td> |
||||
|
<td class="votos"> |
||||
|
{% for voto in rv.votoparlamentar_set.all|dictsort:"parlamentar.nome_parlamentar" %} |
||||
|
<span style="white-space: nowrap;"> |
||||
|
{{ voto.parlamentar }} - <b>{{ voto.voto }}</b> |
||||
|
</span><br /> |
||||
|
{% endfor %} |
||||
|
</td> |
||||
|
</tr> |
||||
|
{% endfor %} |
||||
|
</tbody> |
||||
|
</table> |
||||
|
{% else %} |
||||
|
<tr><td><h3 style="text-align: left;">Nenhuma votação encontrada com esses parâmetros.</h3></td></tr><br><br> |
||||
|
{% endif %} |
||||
|
{% endif %} |
||||
|
{% if filter_url %} |
||||
|
{% include "paginacao.html" %} |
||||
|
{% endif %} |
||||
|
{% endblock base_content %} |
@ -0,0 +1,53 @@ |
|||||
|
{% extends "relatorios/base_relatorio.html" %} |
||||
|
{% load i18n %} |
||||
|
{% load common_tags %} |
||||
|
{% load static %} |
||||
|
|
||||
|
{% block content %} |
||||
|
<h2>Votações Nominais</h2> |
||||
|
<span style="font-size:x-small"> |
||||
|
<b>PARÂMETROS DE PESQUISA:<br /></b> |
||||
|
{% if tipo_materia %} |
||||
|
Tipo de matéria: {{ tipo_materia }}<br /> |
||||
|
{% endif %} |
||||
|
{% if numero %} |
||||
|
Número: {{ numero }}<br /> |
||||
|
{% endif %} |
||||
|
{% if ano %} |
||||
|
Ano: {{ ano }}<br /> |
||||
|
{% endif %} |
||||
|
Período: {{ periodo }}<br /> |
||||
|
</span> |
||||
|
|
||||
|
{% if object_list %} |
||||
|
{% if qtde_votacoes > 1 %} |
||||
|
<h3>Foram encontradas {{qtde_votacoes}} votações.</h3> |
||||
|
{% elif qtde_votacoes == 1 %} |
||||
|
<h3>Foi encontrada {{qtde_votacoes}} votação.</h3> |
||||
|
{% endif %} |
||||
|
|
||||
|
{% for rv in object_list %} |
||||
|
<div style="border-top: 1px solid black;margin-top:0.3cm;font-size:small"> |
||||
|
{% if rv.ordem %} |
||||
|
<b>Matéria: {{ rv.ordem.materia }}</b> - {{ rv.ordem.materia.ementa }}<br /> |
||||
|
<b>Momento da Votação: </b>Ordem do Dia - {{ rv.ordem.sessao_plenaria }}<br /> |
||||
|
<b>Data da Votação: </b>{{ rv.data_hora|date:"d/m/Y" }}<br /> |
||||
|
<b>Resultado: </b>{{ rv.ordem.resultado }}<br /><br /> |
||||
|
{% else %} |
||||
|
<b>Matéria: {{ rv.expediente.materia }}</b> - {{ rv.expediente.materia.ementa }}<br /> |
||||
|
<b>Momento da Votação: </b>Expediente - {{ rv.expediente.sessao_plenaria }}<br /> |
||||
|
<b>Data da Votação: </b>{{ rv.data_hora|date:"d/m/Y" }}<br /> |
||||
|
<b>Resultado: </b>{{ rv.expediente.resultado }}<br /><br /> |
||||
|
{% endif %} |
||||
|
</div> |
||||
|
<ul style="columns: 2; list-style-type: none;font-size:small"> |
||||
|
{% for voto in rv.votoparlamentar_set.all|dictsort:"parlamentar.nome_parlamentar" %} |
||||
|
<li>{{ voto.parlamentar }} - <b>{{ voto.voto }}</b></li> |
||||
|
{% endfor %} |
||||
|
</ul> |
||||
|
{% endfor %} |
||||
|
{% else %} |
||||
|
<tr><td><h3 style="text-align: left;">Nenhuma votação encontrada com esses parâmetros.</h3></td></tr><br><br> |
||||
|
{% endif %} |
||||
|
|
||||
|
{% endblock content %} |
Loading…
Reference in new issue