Afficher 2 éléments d'agenda sur accueil

This commit is contained in:
Claude Paroz 2025-08-19 21:07:14 +02:00
parent b208df98ad
commit cac9b4cb45
3 changed files with 8 additions and 5 deletions

View file

@ -74,7 +74,8 @@ nav {
border-left: 2px solid red;
}
.agenda_line { margin-top: 7em !important; margin-right: 7em !important; }
.agenda_line { margin-right: 7em !important; }
.agenda_container > div:first-of-type { margin-top: 7em !important; }
@media (max-width: 767.98px) {
.agenda_line { margin-top: 1em !important; margin-right: 0 !important; }
.agenda_line > div { text-align: center !important; margin-top: 1em !important; }

View file

@ -11,9 +11,9 @@ class HomeView(TemplateView):
def get_context_data(self, **kwargs):
return {
**super().get_context_data(**kwargs),
"item": Agenda.objects.filter(
"items": Agenda.objects.filter(
date_heure__date__gte=date.today(), prive=False,
).order_by("date_heure").first(),
).order_by("date_heure")[:2],
}

View file

@ -17,7 +17,9 @@
</div>
</a>
</div>
<div class="row justify-content-center mt-5 agenda_line">
<div class="agenda_container">
{% for item in items %}
<div class="row justify-content-center mt-3 agenda_line">
<div class="col-12 text-end mt-2">
<span class="text-black rounded align-self-center fw-bold p-2 date_agenda">
{{ item.date_heure|date:'D d F à H:i' }}
@ -30,7 +32,7 @@
</div>
</div>
</div>
<div id="homeaudio" class="d-flex justify-content-center">
<div id="homeaudio" class="d-flex justify-content-center mt-5">
<div class="text-start">
<i>Écouter:</i><br>
<audio controls src="{% static 'songs/WeShallOvercome.mp3' %}"></audio>