From 1dfad41e3dd7dfa30d7b15f4744c85211daffa54 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sun, 17 Apr 2022 11:15:16 +0200 Subject: [PATCH] Add behind the scene section on index --- photo21/templates/index.html | 17 ++++++++++++++++- photo21/views.py | 11 +++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/photo21/templates/index.html b/photo21/templates/index.html index dd0f63a..276e65a 100644 --- a/photo21/templates/index.html +++ b/photo21/templates/index.html @@ -12,7 +12,7 @@ SPDX-License-Identifier: GPL-3.0-or-later

{% blocktranslate trimmed %} This website aims to collect the pictures and movies taken in the student - life of ENS Paris-Saclay-Saclay or involving its students. + life of ENS Paris-Saclay or involving its students. {% endblocktranslate %}

@@ -48,4 +48,19 @@ SPDX-License-Identifier: GPL-3.0-or-later {% endfor %} + +

{% trans "Behind the scene" %}

+

+ {% blocktranslate trimmed %} + Because we value your privacy, we do not sell the data on this site, + unlike many free online platforms. + The dedicated server running this website is kindly hosted by the + Crans at the ENS Paris-Saclay + basement. + It is not managed by the Crans. Current active administrators are: + {% endblocktranslate %} + {% for user in superusers %} {{ user.username }}{% endfor %}. + {% trans "They should be contacted at" %} + photos@crans.org. +

{% endblock %} diff --git a/photo21/views.py b/photo21/views.py index eec62cd..4b7cb21 100644 --- a/photo21/views.py +++ b/photo21/views.py @@ -2,6 +2,7 @@ # Copyright (C) 2021-2022 Amicale des élèves de l'ENS Paris-Saclay # SPDX-License-Identifier: GPL-3.0-or-later +from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponse from django.views.generic import ListView, View @@ -21,3 +22,13 @@ class IndexView(LoginRequiredMixin, ListView): queryset = Gallery.objects.all() paginate_by = 4 template_name = "index.html" + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + + # Get superusers + User = get_user_model() + superusers = User.objects.filter(is_superuser=True) + context["superusers"] = superusers + + return context