Merge branch 'Aufinal/view_spectacles' into 'master'

Ajoute un lien d'ajout à la vue par spectacles

Cette MR est acceptable à condition que l'issue #49 soit résolue

fixes #34

See merge request !42
This commit is contained in:
Martin Pepin 2016-06-27 18:48:51 +02:00
commit 40ad1f5f76
3 changed files with 13 additions and 8 deletions

View file

@ -2,6 +2,7 @@
{% block realcontent %}
<h2>{{ spectacle }}</h2>
<h3><a href="{% url "admin:bda_attribution_add" %}?spectacle={{spectacle.id}}">Ajouter une attribution</a></h3>
<table class='etat-bda' align="center">
<thead>
<tr>
@ -25,11 +26,16 @@
</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>
</tr>
{% endfor %}
</table>
@ -41,8 +47,7 @@
<br>
<button type="button" onclick="toggle('export-salle')">Afficher/Cacher liste noms</button>
<pre id="export-salle" style="display:none">
{% for participant in participants %}{{participant.name}}{% if participant.nb_places == 2 %}
{{participant.name}}{%endif%}
{% for participant in participants %}{{participant.name}} : {{participant.nb_places}} places
{% endfor %}
</pre>

View file

@ -303,11 +303,12 @@ def spectacle(request, tirage_id, spectacle_id):
'name': participant.user.get_full_name,
'username': participant.user.username,
'email': participant.user.email,
'given': attrib.given,
'given': int(attrib.given),
'paid': participant.paid,
'nb_places': 1}
if participant.id in participants:
participants[participant.id]['nb_places'] += 1
participants[participant.id]['given'] += attrib.given
else:
participants[participant.id] = participant_info

View file

@ -35,4 +35,3 @@ def highlight_clipper(clipper, q):
text = clipper.username
return highlight_text(text, q)