FEATURE [export] uncheck all centers button

This commit is contained in:
2023-05-24 15:34:39 +02:00
parent f5448f9d95
commit dad36927f3
2 changed files with 19 additions and 0 deletions

View File

@@ -39,8 +39,13 @@
{{ 'This will eventually restrict your possibilities in filtering the data.'|trans }}</p>
<h3 class="m-3">{{ 'Center'|trans }}</h3>
{{ form_widget(form.centers.center) }}
<div class="mb-3 mt-3">
<input class="btn btn-misc" type= "button" onclick='uncheckAll(this)' value="{{ 'uncheck all'|trans }}"/>
</div>
{% if form.centers.regroupment is defined %}
<h3 class="m-3">{{ 'Pick aggregated centers'|trans }}</h3>
{{ form_widget(form.centers.regroupment) }}
@@ -53,3 +58,15 @@
</div>
{% endblock content %}
{% block js %}
<script>
const uncheckAll = () => {
const checkedCenters = document.getElementsByName('centers[center][]');
checkedCenters.forEach(checkbox => checkbox.checked = false)
}
</script>
{% endblock js %}