Browse Source

Adiciona opção de selecionar todos na busca textual (#2791)

pull/2811/head
Cesar Augusto de Carvalho 6 years ago
committed by Cesar Carvalho
parent
commit
b61cf3fae4
  1. 25
      sapl/templates/search/search.html

25
sapl/templates/search/search.html

@ -7,14 +7,21 @@
</br>
<form method="get" action=".">
<div class="row">
<div class="col-md-8">
<div class="col-md-12">
{{ form.q|as_crispy_field }}
</div>
</div>
<div class="row">
<div class="row">
<div class="col-md-8">
<h3> Em quais tipos de documento deseja pesquisar?</h3>
<br/>
<div class="checkbox" id="check_all">
<label for="id_check_all">
<input type="checkbox" id="id_check_all" onchange="checkAll(this)" /> Marcar/Desmarcar Todos
</label>
</div>
<br/>
{{ form.models }}
</div>
</div>
@ -103,3 +110,17 @@
</form>
{% endblock %}
{% block extra_js %}
<script language="JavaScript">
function checkAll(elem) {
let checkboxes = document.getElementsByName('models');
for (let i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox')
checkboxes[i].checked = elem.checked;
}
}
</script>
{% endblock %}
Loading…
Cancel
Save