Ajustements de la présentation
This commit is contained in:
parent
92ead7df06
commit
d2f1b53545
3 changed files with 24 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue