aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/index.html20
-rw-r--r--templates/mention_list.html6
-rw-r--r--templates/year_list.html5
-rw-r--r--views.py4
4 files changed, 23 insertions, 12 deletions
diff --git a/templates/index.html b/templates/index.html
index 007ab35..c7c2543 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{% block head %}{% endblock %}
- <title>{% block title %}{% if year %}{{ year }} &ndash; {% endif %}{% endblock %}celcatsanitizer</title>
+ <title>{% block title %}{% endblock %}celcatsanitizer</title>
<link rel="stylesheet" href="{% static "celcatsanitizer/style.css" %}">
</head>
<body>
@@ -13,15 +13,15 @@
</header>
<div class="content">
{% block body %}
- <h3>{% if year %}{{ year }} &ndash; Choisissez votre mention{% else %}Choisissez votre année{% endif %}</h3>
- <ul>
- {% for element in elements %}
- <li><a href="{% if year %}{% url "groups" year.slug element.slug %}{% else %}{% url "mentions" element.slug %}{% endif %}">{{ element }}</a></li>
- {% empty %}
- <p><em>Aucun emploi du temps à afficher</em></p>
- {% endfor %}
- </ul>
- {% if year %}<a href="{% url "index" %}">Retour à la liste des années</a>{% else %}<a href="{% url "rooms" %}">Emploi du temps des salles</a>{% endif %}
+ <h3>{% block pagetitle %}{% endblock %}</h3>
+ <ul>
+ {% for element in elements %}
+ <li><a href="{% block url %}{% endblock %}">{{ element }}</a></li>
+ {% empty %}
+ <p><em>{% block empty %}Aucun emploi du temps à afficher{% endblock %}</em></p>
+ {% endfor %}
+ </ul>
+ {% block navigation %}{% endblock %}
{% endblock %}
</div>
<footer>
diff --git a/templates/mention_list.html b/templates/mention_list.html
new file mode 100644
index 0000000..3b9d8e8
--- /dev/null
+++ b/templates/mention_list.html
@@ -0,0 +1,6 @@
+{% extends "index.html" %}
+
+{% block title %}{{ year }} &ndash; {% endblock %}
+{% block pagetitle %}{{ year }} &ndash; Choississez votre mention{% endblock %}
+{% block url %}{% url "groups" year.slug element.slug %}{% endblock %}
+{% block navigation %}<a href="{% url "index" %}">Retour à la liste des années</a>{% endblock %}
diff --git a/templates/year_list.html b/templates/year_list.html
new file mode 100644
index 0000000..4256ec1
--- /dev/null
+++ b/templates/year_list.html
@@ -0,0 +1,5 @@
+{% extends "index.html" %}
+
+{% block pagetitle %}Choisissez votre année{% endblock %}
+{% block url %}{% url "mentions" element.slug %}{% endblock %}
+{% block navigation %}<a href="{% url "rooms" %}">Emploi du temps des salles</a>{% endblock %}
diff --git a/views.py b/views.py
index 1fc74b5..1308db1 100644
--- a/views.py
+++ b/views.py
@@ -37,14 +37,14 @@ if connection.vendor == "postgresql":
def index(request):
years = Year.objects.order_by("name")
- return render(request, "index.html", {"elements": years})
+ return render(request, "year_list.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, "index.html",
+ return render(request, "mention_list.html",
{"year": year, "elements": timetables})