forked from DGNum/gestioCOF
fixes #85
This commit is contained in:
parent
217624fe08
commit
46638bd6d8
2 changed files with 19 additions and 5 deletions
|
@ -378,12 +378,12 @@ EventFormset = formset_factory(AdminEventForm, BaseEventRegistrationFormset)
|
|||
class CalendarForm(forms.ModelForm):
|
||||
subscribe_to_events = forms.BooleanField(
|
||||
initial=True,
|
||||
label="Événements du COF.")
|
||||
label="Événements du COF")
|
||||
subscribe_to_my_shows = forms.BooleanField(
|
||||
initial=True,
|
||||
label="Les spectacles pour lesquels j'ai obtenu une place.")
|
||||
label="Les spectacles pour lesquels j'ai obtenu une place")
|
||||
other_shows = forms.ModelMultipleChoiceField(
|
||||
label="Spectacles supplémentaires.",
|
||||
label="Spectacles supplémentaires",
|
||||
queryset=Spectacle.objects.filter(tirage__active=True),
|
||||
widget=forms.CheckboxSelectMultiple,
|
||||
required=False)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% extends "base_title.html" %}
|
||||
{% load bootstrap %}
|
||||
|
||||
{% block realcontent %}
|
||||
|
||||
|
@ -36,8 +37,21 @@ souscrire aux événements du COF et/ou aux spectacles BdA.
|
|||
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Enregistrer" class="btn btn-primary" />
|
||||
{{ form | bootstrap }}
|
||||
<p>
|
||||
<button type="button" class="btn btn-default" onClick="select(true)">Tout sélectionner</button>
|
||||
<button type="button" class="btn btn-default" onClick="select(false)">Tout désélectionner</button>
|
||||
</p>
|
||||
|
||||
<input type="submit" value="Enregistrer" class="btn btn-primary center-block" />
|
||||
</form>
|
||||
|
||||
<script language="JavaScript">
|
||||
function select(check) {
|
||||
checkboxes = document.getElementsByName("other_shows");
|
||||
for(var i=0, n=checkboxes.length;i<n;i++) {
|
||||
checkboxes[i].checked = check;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue