Ajout de formulaires de supression et d'ajout

This commit is contained in:
ludo 2016-06-16 22:55:34 +02:00
parent 574aaad745
commit c36b0c7ef3
4 changed files with 46 additions and 17 deletions

View file

@ -3,7 +3,7 @@
{% block realcontent %}
<h2>{{ spectacle }}</h2>
{% for message in messages %}
<h3>{{ message }}</h3>
<h2 class="{{message.tags}}" align="center">{{ message }}</h2>
{% endfor %}
<table class='etat-bda' align="center">
<thead>
@ -18,8 +18,13 @@
</thead>
{% for participant in participants %}
<tr>
<form action="{% url 'bda-del-attrib' spectacle.tirage.id spectacle.id %}"
method="POST"
onsubmit="return confirm('Voulez-vous vraiment supprimer cette attribution ?');">
{% csrf_token %}
<td>{{participant.name}}</td>
<td>{{participant.username}}</td>
<td>{{participant.username}}
<input type="hidden" name="username" value={{participant.username}}></td>
<td>{{participant.nb_places}} place{{participant.nb_places|pluralize}}</td>
<td>{{participant.email}}</td>
<td>
@ -28,11 +33,18 @@
</div>
</td>
<td align="center">
<div class={%if participant.given %}"greenratio"{%else%}"redratio"{%endif%}>
{% if participant.given %}Oui{% else %}Non{%endif%}
<div class={%if participant.given == participant.nb_places %}"greenratio"
{%elif participant.given == 0%}"redratio"
{%else%}"orangeratio"
{%endif%}>
{% if participant.given == participant.nb_places %}Oui
{% elif participant.given == 0 %}Non
{% else %}{{participant.given}}/{{participant.nb_places}}
{%endif%}
</div>
</td>
<td id="bda-part-button"><input type="submit" value="Supprimer"></td>
</form>
</tr>
{% endfor %}
<form action="{% url 'bda-add-attrib' spectacle.tirage.id spectacle.id %}" method="POST">
@ -48,7 +60,7 @@
<td></td>
<td></td>
<td align="center"><input type="checkbox" name="given"></td>
<td><input type="submit" value="Ajouter"></td>
<td align="center" id="bda-part-button"><input type="submit" value="Ajouter"></td>
</tr>
</table>
<br>