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.
113 lines
5.2 KiB
113 lines
5.2 KiB
{% extends "crud/detail.html" %}
|
|
{% load i18n crispy_forms_tags %}
|
|
{% block actions %}{% endblock %}
|
|
|
|
{% block title %}
|
|
<h1 class="page-header">
|
|
{% if opcao %}
|
|
Adicionar Matérias à Pauta <small>(Reunião: {{ object }})</small>
|
|
{% else %}
|
|
Remover Matérias da Pauta <small>(Reunião: {{ object }})</small>
|
|
{% endif %}
|
|
</h1>
|
|
{% endblock %}
|
|
|
|
{% block detail_content %}
|
|
{% if opcao %}
|
|
{% if not show_results %}
|
|
{% crispy filter.form %}
|
|
{% endif %}
|
|
|
|
{% if show_results %}
|
|
{% if numero_resultados > 0 %}
|
|
{% if numero_resultados == 1 %}
|
|
<div style="text-align: right;"><b>Pesquisa concluída com sucesso! Foi encontrada 1 matéria disponível.</b></div><br>
|
|
{% else %}
|
|
<div style="text-align: right;">
|
|
<b>Pesquisa concluída com sucesso! Foram encontradas {{ numero_resultados }} matérias disponíveis.</b>
|
|
</div>
|
|
<br>
|
|
{% endif %}
|
|
<form method="POST" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
<fieldset>
|
|
<legend>Matérias para Adicionar à Pauta</legend>
|
|
<table class="table table-striped table-hover">
|
|
<div class="controls">
|
|
<div class="checkbox">
|
|
<label for="id_check_all">
|
|
<input type="checkbox" id="id_check_all" onchange="checkAll(this)"/> Marcar/Desmarcar Todos
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<thead><tr><th>Matéria</th></tr></thead>
|
|
<tbody>
|
|
{% for materia_t in object_list %}
|
|
<tr>
|
|
<td>
|
|
<input type="checkbox" name="materia_id" value="{{ materia_t.materia.id }}" {% if check %} checked {% endif %}/>
|
|
{{ materia_t.materia.tipo.sigla }}
|
|
{{ materia_t.materia.numero }}/{{ materia_t.materia.ano }} - {{ materia_t.materia.tipo.descricao }}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</fieldset>
|
|
<input type="submit" value="Salvar" class="btn btn-primary"S>
|
|
</form>
|
|
{% else %}
|
|
<br><div style="text-align: center"><b>Nenhuma matéria disponível encontrada.</b></div>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% else %}
|
|
{% if materias %}
|
|
{% if numero_materias == 1 %}
|
|
<div style="text-align: right;"><b>Há 1 matéria disponível.</b></div><br>
|
|
{% else %}
|
|
<div style="text-align: right;"><b>Há {{ numero_materias }} matérias disponíveis.</b></div><br>
|
|
{% endif %}
|
|
<form method="POST" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
<fieldset>
|
|
<legend>Matérias para Remover da Pauta</legend>
|
|
<table class="table table-striped table-hover">
|
|
<div class="controls">
|
|
<div class="checkbox">
|
|
<label for="id_check_all">
|
|
<input type="checkbox" id="id_check_all" onchange="checkAll(this)" /> Marcar/Desmarcar Todos
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<thead><tr><th>Matéria</th></tr></thead>
|
|
<tbody>
|
|
{% for materia in materias %}
|
|
<tr>
|
|
<td>
|
|
<input type="checkbox" name="materia_id" value="{{ materia.id }}" {% if check %} checked {% endif %}/>
|
|
{{ materia.tipo.sigla }} {{ materia.numero }}/{{ materia.ano }} - {{ materia.tipo.descricao }}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</fieldset>
|
|
<input type="submit" value="Remover" class="btn btn-danger"S>
|
|
</form>
|
|
{% else %}
|
|
<br><div style="text-align: center;"><b>Não há matéria disponível.</b></div>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block extra_js %}
|
|
<script language="JavaScript">
|
|
function checkAll(elem){
|
|
let checkboxes = document.getElementsByName('materia_id');
|
|
for(let i=0; i<checkboxes.length; i++){
|
|
if(checkboxes[i].type == 'checkbox')
|
|
checkboxes[i].checked = elem.checked
|
|
}
|
|
}
|
|
</script>
|
|
{% endblock %}
|
|
|