From 6ceec954d8d37b124c73bcee2456d3d57acaf9e4 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 14 Dec 2024 12:50:59 +0100 Subject: [PATCH] =?UTF-8?q?Le=20lien=20mod=C3=A9rer=20"aujourd'hui"=20ne?= =?UTF-8?q?=20renvoie=20que=20sur=20les=20=C3=A9v=C3=A9nements=20=C3=A0=20?= =?UTF-8?q?venir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/agenda_culturel/administration.html | 6 +++++- src/agenda_culturel/views.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/agenda_culturel/templates/agenda_culturel/administration.html b/src/agenda_culturel/templates/agenda_culturel/administration.html index 05ad777..dfe6122 100644 --- a/src/agenda_culturel/templates/agenda_culturel/administration.html +++ b/src/agenda_culturel/templates/agenda_culturel/administration.html @@ -40,7 +40,11 @@ reste à modérer {% for m in w %} - <{% if m.not_moderated > 0 %}a href="{% url 'moderate_from_date' m.start_day.year m.start_day.month m.start_day.day %}"{% else %}span class="a"{% endif %}> + <{% if m.not_moderated > 0 %}a href="{% if m.is_today %} + {% url 'moderate' %} + {% else %} + {% url 'moderate_from_date' m.start_day.year m.start_day.month m.start_day.day %} + {% endif %}"{% else %}span class="a"{% endif %}> {{ m.not_moderated }} / {{ m.nb_events }} 0 %}a{% else %}span{% endif %}> {% endfor %} diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index d35a94d..7ef4227 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -938,6 +938,7 @@ def administration(request): # add missing dates date_list = [today + timedelta(days=x) for x in range(0, nb_mod_days)] nb_not_moderated = [{"start_day": d, + "is_today": d == today, "nb_events": nb_not_moderated_dict[d][1] if d in nb_not_moderated_dict else 0, "not_moderated": nb_not_moderated_dict[d][0] if d in nb_not_moderated_dict else 0} for d in date_list] nb_not_moderated = [ x | { "note": 0 if x["not_moderated"] == 0 else int((nb_classes - 1) * x["not_moderated"] / max_not_moderated) + 1 } for x in nb_not_moderated]