From 87149d0d4e682582829783a1e96fff665edd303e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Tue, 23 Aug 2016 16:22:06 +0200 Subject: [PATCH] Premier jet Affiche la liste des descriptions des spectacles d'un tirage. Accessible sans authentification. --- bda/templates/descriptions.html | 33 +++++++++++++++++++++++++++++++++ bda/urls.py | 1 + bda/views.py | 6 ++++++ 3 files changed, 40 insertions(+) create mode 100644 bda/templates/descriptions.html diff --git a/bda/templates/descriptions.html b/bda/templates/descriptions.html new file mode 100644 index 00000000..a5512e0e --- /dev/null +++ b/bda/templates/descriptions.html @@ -0,0 +1,33 @@ +{% for show in shows %} + + + + + + + + + + + + + + + + + + + {% if slots_description != "" %} + + + + {% endif %} + +
+

{{ show.title }}

+
{{ show.location }}
{{ show.date }}{{ show.slots }} place{{ show.slots|pluralize}} - show.price
+

{{ show.description }}

+
+ {{ show.slots_description }} +
+{% endfor %} diff --git a/bda/urls.py b/bda/urls.py index 8ec8f277..5d2c6d5f 100644 --- a/bda/urls.py +++ b/bda/urls.py @@ -32,4 +32,5 @@ urlpatterns = [ views.unpaid, name="bda-unpaid"), url(r'^mails-rappel/(?P\d+)$', views.send_rappel), + url(r'^descriptions/(?P\d+)$', views.descriptions_spectacles), ] diff --git a/bda/views.py b/bda/views.py index 776932e9..f6c1256a 100644 --- a/bda/views.py +++ b/bda/views.py @@ -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})