mirror of https://github.com/interlegis/sapl.git
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.
96 lines
2.7 KiB
96 lines
2.7 KiB
{% extends "crud/detail.html" %}
|
|
{% load i18n %}
|
|
{% load common_tags %}
|
|
|
|
{% block actions %}{% endblock %}
|
|
|
|
{% block detail_content %}
|
|
|
|
{% if perms|get_add_perm:view %}
|
|
<form method="POST">
|
|
{% csrf_token %}
|
|
<div class="controls">
|
|
<div class="checkbox">
|
|
<label for="id_check_all">
|
|
<input type="checkbox" id="id_check_all" onchange="checkAll(event)" /> Marcar/Desmarcar Todos
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<br />
|
|
|
|
<div class="controls">
|
|
<div class="checkbox">
|
|
<label for="id_ativos">
|
|
<input type="checkbox" name="ativos" id="id_ativos" onchange="escondeInativos()" checked /> Exibir somente
|
|
parlamentares ativos
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<br />
|
|
|
|
<div class="controls">
|
|
{% for parlamentar, check in view.get_presencas_ordem %}
|
|
{% if parlamentar.ativo %}
|
|
<label for="id_presenca_{{forloop.counter}}" class="checkbox">
|
|
<input type="checkbox" id="id_presenca_{{forloop.counter}}" name="presenca_ativos" value="{{ parlamentar.id }}"
|
|
{% if check %} checked {% endif %} />
|
|
{{ parlamentar.nome_parlamentar }} / {{ parlamentar|filiacao_data_filter:object.data_inicio }}
|
|
</label>
|
|
{% else %}
|
|
<label for="id_presenca_{{forloop.counter}}" class="checkbox inativos" style="display:none;">
|
|
<input type="checkbox" id="id_presenca_{{forloop.counter}}" name="presenca_inativos" value="{{ parlamentar.id }}"
|
|
{% if check %} checked {% endif %} />
|
|
{{ parlamentar.nome_parlamentar }} / {{ parlamentar|filiacao_data_filter:object.data_inicio }}
|
|
</label>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
<br />
|
|
<input type="submit" value="Salvar" class="btn btn-primary" />
|
|
</form>
|
|
|
|
{% else %}
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<h2>Parlamentares presentes
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
|
|
{% for parlamentar, check in view.get_presencas_ordem %}
|
|
{% if check %}
|
|
<div class="row">
|
|
<div class="col-md-6"><label for="parlamentar"> - {{ parlamentar.nome_parlamentar }} / {{
|
|
parlamentar|filiacao_data_filter:object.data_inicio }}</label></div>
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endblock detail_content %}
|
|
|
|
{% block extra_js %}
|
|
<script language="JavaScript">
|
|
function checkAll(event) {
|
|
$('[name=presenca_ativos]').each(function () {
|
|
$(this).prop('checked', event.target.checked ? 'checked' : null);
|
|
$(this).trigger('click');
|
|
});
|
|
if (($('[name=ativos]').is(':checked')) == false) {
|
|
$('[name=presenca_inativos]').each(function () {
|
|
$(this).prop('checked', event.target.checked ? 'checked' : null);
|
|
$(this).trigger('click');
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
function escondeInativos() {
|
|
$(".inativos").toggle();
|
|
}
|
|
</script>
|
|
{% endblock %}
|