mirror of https://github.com/interlegis/sapl.git
1 changed files with 71 additions and 0 deletions
@ -0,0 +1,71 @@ |
|||
{% extends "crud/form.html" %} |
|||
{% load i18n %} |
|||
{% load crispy_forms_tags %} |
|||
{% load common_tags %} |
|||
|
|||
{% block base_content %} |
|||
<form method="POST"> |
|||
{% csrf_token %} |
|||
|
|||
<div class="row-fluid"> |
|||
<div class="col-md-12" > |
|||
<div id="div_id_nome" class="form-group"> |
|||
{{ form.nome }} |
|||
|
|||
|
|||
<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 %} |
|||
<div class="checkbox"> |
|||
<label for="id_presenca_{{forloop.counter}}"> |
|||
<input type="checkbox" id="id_presenca_{{forloop.counter}}" name="presenca_ativos" value="{{ parlamentar.id }}" {% if check %} checked {% endif %}/> |
|||
{{ parlamentar.nome_parlamentar }} / {{ parlamentar.filiacao_atual }} |
|||
</label> |
|||
</div> |
|||
{% else %} |
|||
<div class="checkbox inativos" style="display:none;"> |
|||
<label for="id_presenca_{{forloop.counter}}"> |
|||
<input type="checkbox" id="id_presenca_{{forloop.counter}}" name="presenca_inativos" value="{{ parlamentar.id }}" {% if check %} checked {% endif %}/> |
|||
{{ parlamentar.nome_parlamentar }} / {{ parlamentar.filiacao_atual }} |
|||
</label> |
|||
</div> |
|||
{% endif %} |
|||
{% endfor %} |
|||
</div> |
|||
|
|||
<br /> |
|||
<input type="submit" value="Salvar" class="btn btn-primary" /> |
|||
</form> |
|||
|
|||
{% endblock base_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 %} |
|||
Loading…
Reference in new issue