From 60e3b389d065746d61906f91327867bfd5ed582c Mon Sep 17 00:00:00 2001
From: Alban Gruin
Date: Wed, 25 Apr 2018 09:34:34 +0200
Subject: qsjps: abstraction et navigation de la template
---
templates/qsjps.html | 17 ++++-------------
views.py | 2 +-
2 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/templates/qsjps.html b/templates/qsjps.html
index a166dbd..9fbdf8a 100644
--- a/templates/qsjps.html
+++ b/templates/qsjps.html
@@ -2,16 +2,7 @@
{% load dt_week %}
{% block title %}Trouver une salle – {% endblock %}
-
-{% block body %}
-
Trouver une salle entre {{ form.begin.value }} et {{ form.end.value }}
-
- {% with year=form.cleaned_data.day.year week=form.cleaned_data.day|dt_week %}
- {% for room in rooms %}
- - {{ room }}
- {% empty %}
- Aucune salle trouvée
- {% endfor %}
- {% endwith %}
-
-{% endblock %}
+{% block pagetitle %}Trouver une salle entre {{ form.begin.value }} et {{ form.end.value }}{% endblock %}
+{% block url %}{% url "room-timetable" element.slug form.cleaned_data.day.year form.cleaned_data.day|dt_week %}{% endblock %}
+{% block navigation %}Retour à la liste des salles –
+Nouvelle recherche{% endblock %}
diff --git a/views.py b/views.py
index aabda59..2411fe7 100644
--- a/views.py
+++ b/views.py
@@ -274,7 +274,7 @@ def qsjps(request):
rooms = Room.objects.qsjps(begin, end)
return render(request, "qsjps.html",
- {"rooms": rooms, "form": form})
+ {"elements": rooms, "form": form})
# Si le formulaire est invalide, on ré-affiche le formulaire
# avec les erreurs
--
cgit v1.2.1