Merge branch 'master' of https://git.eleves.ens.fr/cof-geek/gestioCOF into Aufinal/bda_shotgun
This commit is contained in:
commit
b7a4ece939
3 changed files with 27 additions and 6 deletions
|
@ -219,10 +219,10 @@ class SpectacleReventeAdmin(admin.ModelAdmin):
|
||||||
list_display = ("spectacle", "seller", "date", "soldTo")
|
list_display = ("spectacle", "seller", "date", "soldTo")
|
||||||
raw_id_fields = ("attribution",)
|
raw_id_fields = ("attribution",)
|
||||||
readonly_fields = ("shotgun", "expiration_time")
|
readonly_fields = ("shotgun", "expiration_time")
|
||||||
search_fields = ("spectacle__title",
|
search_fields = ['attribution__spectacle__title',
|
||||||
"seller__user__username",
|
'seller__user__username',
|
||||||
"seller__user__firstname",
|
'seller__user__first_name',
|
||||||
"seller__user__lastname",)
|
'seller__user__last_name']
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(CategorieSpectacle)
|
admin.site.register(CategorieSpectacle)
|
||||||
|
|
|
@ -228,7 +228,6 @@ class SpectacleRevente(models.Model):
|
||||||
answered_mail = models.ManyToManyField(Participant,
|
answered_mail = models.ManyToManyField(Participant,
|
||||||
related_name="wanted",
|
related_name="wanted",
|
||||||
blank=True)
|
blank=True)
|
||||||
|
|
||||||
seller = models.ForeignKey(Participant,
|
seller = models.ForeignKey(Participant,
|
||||||
related_name="original_shows",
|
related_name="original_shows",
|
||||||
verbose_name="Vendeur")
|
verbose_name="Vendeur")
|
||||||
|
|
|
@ -11,7 +11,29 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<form action="" class="form-horizontal" method="post">
|
<form action="" class="form-horizontal" method="post">
|
||||||
{% csrf_token %}
|
{% 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">
|
<input type="submit" class="btn btn-primary" value="S'inscrire pour les places sélectionnées">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<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 %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue