From 3f610831227e7def4b74651747d5625c9a009311 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Tue, 31 Oct 2017 13:10:18 +0100 Subject: Création d’une flatpage spécifique à la page « à propos » Ajout d’un processeur de contexte pour afficher la version de CS en bas de page. --- templates/flatpages/about.html | 6 ++++++ templates/index.html | 3 ++- views.py | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 templates/flatpages/about.html diff --git a/templates/flatpages/about.html b/templates/flatpages/about.html new file mode 100644 index 0000000..3df7c53 --- /dev/null +++ b/templates/flatpages/about.html @@ -0,0 +1,6 @@ +{% extends "flatpages/default.html" %} + +{% block body %} +

{{ flatpage.title }} – celcatsanitizer {{ celcatsanitizer_version }}

+ {{ flatpage.content }} +{% endblock %} diff --git a/templates/index.html b/templates/index.html index abaf5f1..1ea6e53 100644 --- a/templates/index.html +++ b/templates/index.html @@ -24,7 +24,8 @@ {% endblock %} diff --git a/views.py b/views.py index 384fdd0..c0c63cb 100644 --- a/views.py +++ b/views.py @@ -23,6 +23,8 @@ from django.shortcuts import get_object_or_404, render from .models import Timetable, Group, Course, Year from .utils import get_current_week, get_current_or_next_week, get_week, group_courses +import edt + def index(request): years = Year.objects.order_by("name") return render(request, "index.html", {"elements": years}) @@ -102,3 +104,6 @@ def calendars(request, year_slug, timetable_slug, group_slug): .order_by("length") return render(request, "calendars.html", {"group": group, "groups": groups}) + +def ctx_processor(request): + return {"celcatsanitizer_version": edt.VERSION} -- cgit v1.2.1