forked from DGNum/gestioCOF
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:
commit
40ad1f5f76
3 changed files with 13 additions and 8 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
{% block realcontent %}
|
{% block realcontent %}
|
||||||
<h2>{{ spectacle }}</h2>
|
<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">
|
<table class='etat-bda' align="center">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -25,11 +26,16 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<div class={%if participant.given %}"greenratio"{%else%}"redratio"{%endif%}>
|
<div class={%if participant.given == participant.nb_places %}"greenratio"
|
||||||
{% if participant.given %}Oui{% else %}Non{%endif%}
|
{%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>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
@ -41,8 +47,7 @@
|
||||||
<br>
|
<br>
|
||||||
<button type="button" onclick="toggle('export-salle')">Afficher/Cacher liste noms</button>
|
<button type="button" onclick="toggle('export-salle')">Afficher/Cacher liste noms</button>
|
||||||
<pre id="export-salle" style="display:none">
|
<pre id="export-salle" style="display:none">
|
||||||
{% for participant in participants %}{{participant.name}}{% if participant.nb_places == 2 %}
|
{% for participant in participants %}{{participant.name}} : {{participant.nb_places}} places
|
||||||
{{participant.name}}{%endif%}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
|
@ -303,11 +303,12 @@ def spectacle(request, tirage_id, spectacle_id):
|
||||||
'name': participant.user.get_full_name,
|
'name': participant.user.get_full_name,
|
||||||
'username': participant.user.username,
|
'username': participant.user.username,
|
||||||
'email': participant.user.email,
|
'email': participant.user.email,
|
||||||
'given': attrib.given,
|
'given': int(attrib.given),
|
||||||
'paid': participant.paid,
|
'paid': participant.paid,
|
||||||
'nb_places': 1}
|
'nb_places': 1}
|
||||||
if participant.id in participants:
|
if participant.id in participants:
|
||||||
participants[participant.id]['nb_places'] += 1
|
participants[participant.id]['nb_places'] += 1
|
||||||
|
participants[participant.id]['given'] += attrib.given
|
||||||
else:
|
else:
|
||||||
participants[participant.id] = participant_info
|
participants[participant.id] = participant_info
|
||||||
|
|
||||||
|
|
|
@ -35,4 +35,3 @@ def highlight_clipper(clipper, q):
|
||||||
text = clipper.username
|
text = clipper.username
|
||||||
return highlight_text(text, q)
|
return highlight_text(text, q)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue