Premier jet

Affiche la liste des descriptions des spectacles d'un tirage.
Accessible sans authentification.
This commit is contained in:
Martin Pépin 2016-08-23 16:22:06 +02:00
parent 5d685a04d7
commit 87149d0d4e
3 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,33 @@
{% for show in shows %}
<table id="spectacle-{{ show.id }}">
<thead>
<tr>
<th colspan="2">
<p style="text-align: center;">{{ show.title }}</p>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ show.location }}</td>
<td></td>
</tr>
<tr>
<td>{{ show.date }}</td>
<td>{{ show.slots }} place{{ show.slots|pluralize}} - show.price</td>
</tr>
<tr>
<td colspan="2">
<p style="text-align: justify;">{{ show.description }}</p>
</td>
</tr>
{% if slots_description != "" %}
<tr>
<td colspan="2">
{{ show.slots_description }}
</td>
</tr>
{% endif %}
</tbody>
</table>
{% endfor %}

View file

@ -32,4 +32,5 @@ urlpatterns = [
views.unpaid,
name="bda-unpaid"),
url(r'^mails-rappel/(?P<spectacle_id>\d+)$', views.send_rappel),
url(r'^descriptions/(?P<tirage_id>\d+)$', views.descriptions_spectacles),
]

View file

@ -364,3 +364,9 @@ def send_rappel(request, spectacle_id):
else:
ctxt['sent'] = False
return render(request, "mails-rappel.html", ctxt)
def descriptions_spectacles(request, tirage_id):
tirage = get_object_or_404(Tirage, id=tirage_id)
shows = tirage.spectacle_set.all()
return render(request, 'descriptions.html', {'shows': shows})