Amélioration de la navigation

This commit is contained in:
Jean-Marie Favreau 2024-10-05 22:48:55 +02:00
parent ea483c9c37
commit 427272fde1

View File

@ -23,14 +23,17 @@
{% get_current_language as LANGUAGE_CODE %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout upcoming user.is_authenticated calendar.firstdate filter.to_str LANGUAGE_CODE %}
{% cache cache_timeout upcoming user.is_authenticated calendar.firstdate filter.to_str calendar.calendar_days_list|length LANGUAGE_CODE %}
<article>
<header><h1 id="index-avenir">{% block title %}{% block og_title %}
{% if calendar.calendar_days_list.0.is_now %}
{% if calendar.calendar_days_list.0.is_today %}
Événements à venir
{% else %}
Événements du {{ calendar.calendar_days_list.0.date| date:"l j F Y" }}
{% if calendar.calendar_days_list|length > 1 %}
et suivants
{% endif %}
{% endif %}
{% endblock %}{% endblock %}</h1></header>
@ -38,7 +41,7 @@
{% include "agenda_culturel/filter-inc.html" with filter=filter %}
<footer>
<a href="{% url 'a_venir_jour' date_pred.year date_pred.month date_pred.day %}" aria-label="dates précédentes" role="button">
<a href="{% if calendar.calendar_days_list|length == 1 %}{% url 'day_view' date_pred.year date_pred.month date_pred.day %}{% else %}{% url 'a_venir_jour' date_pred.year date_pred.month date_pred.day %}{% endif %}" aria-label="dates précédentes" role="button">
{% picto_from_name "chevrons-left" %}
{% if calendar.calendar_days_list|length == 1 %}
{{ date_pred }}
@ -57,7 +60,7 @@
{% picto_from_name "chevrons-down" %}</a>
{% endfor %}
{% endif %}
<a href="{% url 'a_venir_jour' date_next.year date_next.month date_next.day %}" aria-label="dates suivantes" role="button">
<a href="{% if calendar.calendar_days_list|length == 1 %}{% url 'day_view' date_next.year date_next.month date_next.day %}{% else %}{% url 'a_venir_jour' date_next.year date_next.month date_next.day %}{% endif %}" aria-label="dates suivantes" role="button">
{% if calendar.calendar_days_list|length == 1 %}
{{ date_next }}
{% endif %}
@ -130,9 +133,12 @@
{% endfor %}
<article>
<header><h2>Voir aussi</h2></header>
{% if date_pred %}
<a href="{% url 'a_venir_jour' date_pred.year date_pred.month date_pred.day %}" aria-label="dates précédentes" role="button">{% picto_from_name "chevrons-left" %}</a>
{% endif %}
<a href="{% if calendar.calendar_days_list|length == 1 %}{% url 'day_view' date_pred.year date_pred.month date_pred.day %}{% else %}{% url 'a_venir_jour' date_pred.year date_pred.month date_pred.day %}{% endif %}" aria-label="dates précédentes" role="button">
{% picto_from_name "chevrons-left" %}
{% if calendar.calendar_days_list|length == 1 %}
{{ date_pred }}
{% endif %}
</a>
{% if calendar.today_in_calendar %}
<a role="button" href="{% url 'aujourdhui' %}?{{ filter.get_url }}">Aujourd'hui</a>
{% endif %}
@ -145,9 +151,12 @@
<a role="button" href="{% url 'month_view' calendar.lastdate.year calendar.lastdate.month %}?{{ filter.get_url }}">{{ calendar.lastdate | date:"F o" }}</a>
{% endif %}
<a role="button" data-tooltip="Copiez ce lien et importez-le dans votre agenda" href="{% url 'export_ical' %}?{{ filter.get_url }}">Export ical {% picto_from_name "calendar" %}</a>
{% if date_next %}
<a href="{% url 'a_venir_jour' date_next.year date_next.month date_next.day %}" aria-label="dates suivantes" role="button">{% picto_from_name "chevrons-right" %}</a>
{% endif %}
<a href="{% if calendar.calendar_days_list|length == 1 %}{% url 'day_view' date_next.year date_next.month date_next.day %}{% else %}{% url 'a_venir_jour' date_next.year date_next.month date_next.day %}{% endif %}" aria-label="dates suivantes" role="button">
{% if calendar.calendar_days_list|length == 1 %}
{{ date_next }}
{% endif %}
{% picto_from_name "chevrons-right" %}
</a>
</article>