Ajustements de la présentation

This commit is contained in:
Claude Paroz 2025-08-27 18:27:47 +02:00
parent 92ead7df06
commit d2f1b53545
3 changed files with 24 additions and 14 deletions

View file

@ -17,6 +17,18 @@ class HomeView(TemplateView):
}
class PresentationView(TemplateView):
template_name="presentation.html"
def get_context_data(self, **kwargs):
return {
**super().get_context_data(**kwargs),
"next_event": Agenda.objects.filter(
date_heure__date__gte=date.today(), prive=False,
).order_by("date_heure").first(),
}
class AgendaView(ListView):
model = Agenda
template_name = "agenda.html"
@ -35,7 +47,7 @@ class MediaView(ListView):
template_name = "media.html"
def get_queryset(self):
qs = Document.objects.all().order_by("-quand")
qs = Document.objects.all().order_by("-quand", "titre")
if not self.request.user.is_authenticated:
qs = qs.filter(prive=False)
return qs