From 1d5068de5e4babb8c2c969c626fd1d8b53bc28ea Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Thu, 28 Sep 2017 22:27:50 +0200 Subject: Mise en commun de la template de sélection de l’année et de la mention --- templates/group_list.html | 4 ++-- templates/index.html | 14 +++++++------- templates/mention_list.html | 14 -------------- templates/timetable.html | 8 ++++---- views.py | 4 ++-- 5 files changed, 15 insertions(+), 29 deletions(-) delete mode 100644 templates/mention_list.html diff --git a/templates/group_list.html b/templates/group_list.html index eeb3a35..aebb0db 100644 --- a/templates/group_list.html +++ b/templates/group_list.html @@ -6,8 +6,8 @@ {% block body %}

{{ timetable }}

{% endblock %} diff --git a/templates/index.html b/templates/index.html index efbb21c..8d7634e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,7 +3,7 @@ - {% block title %}{% endblock %}celcatsanitizer + {% block title %}{% if year %}{{ year }} – {% endif %}{% endblock %}celcatsanitizer @@ -12,13 +12,13 @@
{% block body %} -

Choisissez votre année

+

{% if year %}{{ year }} – Choisissez votre mention{% else %}Choisissez votre année{% endif %}

{% endblock %}
diff --git a/templates/mention_list.html b/templates/mention_list.html deleted file mode 100644 index 71cfaac..0000000 --- a/templates/mention_list.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "index.html" %} - -{% block title %}{{ year }} – {% endblock %} - -{% block body %} -

{{ year }} – Choisissez votre mention

- -{% endblock %} diff --git a/templates/timetable.html b/templates/timetable.html index 21afa24..9143c2f 100644 --- a/templates/timetable.html +++ b/templates/timetable.html @@ -5,10 +5,10 @@ {% block body %}

{{ group.timetable }} – {{ group }} – Semaine {{ week }}

- {% if is_old_timetable %} - Accéder à l’emploi du temps de cette semaine.
- {% endif %} - Dernière mise à jour le {{ last_update|date:"l j F o" }} à {{ last_update|date:"H:i" }} + {% if is_old_timetable %} + Accéder à l’emploi du temps de cette semaine.
+ {% endif %} + Dernière mise à jour le {{ last_update|date:"l j F o" }} à {{ last_update|date:"H:i" }}

{% include "timetable_common.html" %}

ICSRSSAtom

{% endblock %} diff --git a/views.py b/views.py index 23bced4..14a4208 100644 --- a/views.py +++ b/views.py @@ -23,13 +23,13 @@ from .utils import get_current_week, get_week, group_courses def index(request): years = Year.objects.order_by("name") - return render(request, "index.html", {"years": years}) + return render(request, "index.html", {"elements": years}) def mention_list(request, year_slug): year = get_object_or_404(Year, slug=year_slug) timetables = Timetable.objects.order_by("name").filter(year=year) - return render(request, "mention_list.html", {"year": year, "timetables": timetables}) + return render(request, "index.html", {"year": year, "elements": timetables}) def group_list_common(request, timetable, groups): year, week = get_current_week() -- cgit v1.2.1