Sistema de Apoio ao Processo Legislativo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

165 lines
6.5 KiB

{% extends "crud/detail.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block actions %}{% endblock %}
{% block sections_nav %}
{% endblock %}
{% block detail_content %}
{% block buttons %}
{% comment %} {% if filter_url and not filter.form.errors %}
<div class="actions btn-group pull-right" role="group">
<a href="{% url 'sapl.sessao:votacao_bloco_expediente' pk_sessao %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a>
</div>
<div class="actions btn-group pull-right" role="group">
<a href="{% url 'sapl.sessao:expedientemateria_list' pk_sessao %}" class="btn btn-default">{% trans 'Matérias do Expediente' %}</a>
</div>
{% endif %} {% endcomment %}
{% endblock %}
<p></p>
{% comment %} {% if paginator.count %} {% endcomment %}
<form method="POST" enctype="application/x-www-form-urlencoded" action="{% url 'sapl.sessao:votacaoblocosimbod' pk %}">
{% csrf_token %}
<br><br>
<table class="table table-striped table-bordered">
<thead class="thead-default">
<tr>
<td><h3>{% trans "Tipo de Votação" %}</h3></td>
</tr>
</thead>
<tr>
<td class="col-md-12">
<input type="radio" name="tipo_votacao" id="tipo_votacao" value="1" checked="checked" onchange="alteraTipoVotacao()" > <label for="tipo">Simbólica</label>
</br>
<input type="radio" name="tipo_votacao" id="tipo_votacao" value="2" onchange="alteraTipoVotacao()" > <label for="tipo">Nominal</label>
</br>
</td>
</tr>
</table>
<br>
<h3>Selecione a(s) ordem(s) do dia desejada(s).</h3>
<table class="table table-striped table-bordered">
<thead class="thead-default">
<tr>
<td><h3>{% trans "Ordem do dia" %}</h3></td>
</tr>
</thead>
<div class="checkbox">
<label for="id_check_all">
<input type="checkbox" id="id_check_all" onchange="checkAll(this)" /> Marcar/Desmarcar Todos
</label>
</div>
{% for o in ordem_dia %}
<tr class="{% if o.tipo_votacao == 1 %}Simbolica{% else %}Nominal{% endif %}" {% if o.tipo_votacao == 2 %} style="display:none;" {% endif %}>
<td>
<input type="checkbox" name="ordem_id_{{o.tipo_votacao}}" id="{{o.id}}" value="{{o.id}}" {% if check %} checked {% endif %}>
<strong><a href="{% url 'sapl.materia:materialegislativa_detail' o.id %}">{{o.materia.tipo.sigla}} {{o.materia.numero}}/{{o.materia.ano}} - {{o.materia.tipo}}</strong></a></br>
{% if o.materia.numeracao_set.last %}
<strong>Processo:</strong> &nbsp; {{o.materia.numeracao_set.last}}</br>
{% endif %}
<strong>Autor:</strong>
{% for a in o.materia.autoria_set.all %}
{% if not forloop.first %}
, &nbsp;&nbsp; {{a.autor|default_if_none:""}}
{% else %}
&nbsp;{{a.autor|default_if_none:""}}
{% endif %}
{% endfor %}
</br>
{% if o.materia.numero_protocolo %}
<strong>Protocolo:</strong> &nbsp; {{o.materia.numero_protocolo}}</br>
{% endif %}
{% if o.materia.tramitacao_set.last %}
{% if o.materia.tramitacao_set.last.turno %}
<strong>Turno:</strong>&nbsp;
{% for t in turno_choices %}
{% if t.0 == o.materia.tramitacao_set.last.turno %}
{{ t.1 }}
{% endif %}
{% endfor %}</br>
{% endif %}
{% endif %}
<strong>Ementa:</strong>&nbsp;{{ o.ementa|safe }}</br>
<p></p>
</td>
</tr>
{% endfor %}
</table>
<input type="submit" value="Registrar votação" class="btn btn-primary"S>
</form>
{% comment %} {% else %}
<table class="table table-striped table-bordered">
<tr>
<td>
<h3>Nenhuma ordem do dia aberta.</h3>
</td>
</tr>
</table>
{% endif %} {% endcomment %}
{% endblock detail_content %}
{% block extra_js %}
<script>
$(window).on('beforeunload', function () {
$("input[type=submit], input[type=button]").prop("disabled", "disabled");
});
</script>
<script language="JavaScript">
function checkAll(ele) {
/* $('[name=ordem_id_1]').each(function() {
$(this).prop('unchecked', event.target.checked ? 'checked': null);
$(this).trigger('click');
}); */
let checkboxes = document.getElementsByName('ordem_id_1');
if (ele.checked) {
for (let i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = true;
}
}
} else {
for (let i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = false;
}
}
}
checkboxes = document.getElementsByName('ordem_id_2');
if (ele.checked) {
for (let i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = true;
}
}
} else {
for (let i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = false;
}
}
}
}
function alteraTipoVotacao() {
$(".Simbolica").toggle();
$(".Nominal").toggle();
}
</script>
{% endblock extra_js%}