Merge branch 'Aufinal/select_all' into 'master'

Ajoute bouton select all à liste-reventes



See merge request !97
This commit is contained in:
Martin Pepin 2016-10-09 19:08:17 +02:00
commit f032b6c5ec

View file

@ -11,7 +11,20 @@
{% endif %}
<form action="" class="form-horizontal" method="post">
{% csrf_token %}
{{form | bootstrap}}
<div class="form-group">
<h3>Spectacles</h3>
<br/>
<button type="button" class="btn btn-primary" onClick="select(true)">Tout sélectionner</button>
<button type="button" class="btn btn-primary" onClick="select(false)">Tout désélectionner</button>
<div class="multiple-checkbox">
<ul>
{% for checkbox in form.spectacles %}
<li>{{checkbox}}</li>
{%endfor%}
</ul>
</div>
</div>
<input type="submit" class="btn btn-primary" value="S'inscrire pour les places sélectionnées">
</form>
@ -23,4 +36,13 @@
<li><a href="{% url "bda-buy-revente" spectacle.id %}">{{spectacle}}</a></li>
{% endfor %}
{% endif %}
<script language="JavaScript">
function select(check) {
checkboxes = document.getElementsByName("spectacles");
for(var i=0, n=checkboxes.length;i<n;i++) {
checkboxes[i].checked = check;
}
}
</script>
{% endblock %}