Optimisation simple (on évite des initialiations et des comptages côté template)
This commit is contained in:
parent
b7fb27061d
commit
4c36079379
@ -46,16 +46,16 @@
|
||||
|
||||
<footer>
|
||||
{% if category %}
|
||||
<a href="{% if calendar.calendar_days_list|length == 1 %}{% url 'day_view_category' category.slug date_pred.year date_pred.month date_pred.day %}{% else %}{% url 'a_venir_jour_category' category.slug date_pred.year date_pred.month date_pred.day %}{% endif %}?{{ filter.get_url }}" aria-label="dates précédentes" role="button">
|
||||
<a href="{% if calendar.nb_days == 1 %}{% url 'day_view_category' category.slug date_pred.year date_pred.month date_pred.day %}{% else %}{% url 'a_venir_jour_category' category.slug date_pred.year date_pred.month date_pred.day %}{% endif %}?{{ filter.get_url }}" aria-label="dates précédentes" role="button">
|
||||
{% else %}
|
||||
<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 %}?{{ filter.get_url }}" aria-label="dates précédentes" role="button">
|
||||
<a href="{% if calendar.nb_days == 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 %}?{{ filter.get_url }}" aria-label="dates précédentes" role="button">
|
||||
{% endif %}
|
||||
{% picto_from_name "chevrons-left" %}
|
||||
{% if calendar.calendar_days_list|length == 1 %}
|
||||
{% if calendar.nb_days == 1 %}
|
||||
{{ date_pred }}
|
||||
{% endif %}
|
||||
</a>
|
||||
{% if calendar.calendar_days_list|length > 1 %}
|
||||
{% if calendar.nb_days > 1 %}
|
||||
{% for cd in calendar.calendar_days_list %}
|
||||
<a href="#{{ cd.id }}" role="button">
|
||||
{% if cd.is_today %}Aujourd'hui
|
||||
@ -69,11 +69,11 @@
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if category %}
|
||||
<a href="{% if calendar.calendar_days_list|length == 1 %}{% url 'day_view_category' category.slug date_next.year date_next.month date_next.day %}{% else %}{% url 'a_venir_jour_category' category.slug date_next.year date_next.month date_next.day %}{% endif %}?{{ filter.get_url }}" aria-label="dates suivantes" role="button">
|
||||
<a href="{% if calendar.nb_days == 1 %}{% url 'day_view_category' category.slug date_next.year date_next.month date_next.day %}{% else %}{% url 'a_venir_jour_category' category.slug date_next.year date_next.month date_next.day %}{% endif %}?{{ filter.get_url }}" aria-label="dates suivantes" role="button">
|
||||
{% else %}
|
||||
<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 %}?{{ filter.get_url }}" aria-label="dates suivantes" role="button">
|
||||
<a href="{% if calendar.nb_days == 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 %}?{{ filter.get_url }}" aria-label="dates suivantes" role="button">
|
||||
{% endif %}
|
||||
{% if calendar.calendar_days_list|length == 1 %}
|
||||
{% if calendar.nb_days == 1 %}
|
||||
{{ date_next }}
|
||||
{% endif %}
|
||||
{% picto_from_name "chevrons-right" %}
|
||||
@ -152,12 +152,12 @@
|
||||
<article>
|
||||
<header><h2>Voir aussi</h2></header>
|
||||
{% if category %}
|
||||
<a href="{% if calendar.calendar_days_list|length == 1 %}{% url 'day_view_category' category.slug date_pred.year date_pred.month date_pred.day %}{% else %}{% url 'a_venir_jour_category' category.slug date_pred.year date_pred.month date_pred.day %}{% endif %}?{{ filter.get_url }}" aria-label="dates précédentes" role="button">
|
||||
<a href="{% if calendar.nb_days == 1 %}{% url 'day_view_category' category.slug date_pred.year date_pred.month date_pred.day %}{% else %}{% url 'a_venir_jour_category' category.slug date_pred.year date_pred.month date_pred.day %}{% endif %}?{{ filter.get_url }}" aria-label="dates précédentes" role="button">
|
||||
{% else %}
|
||||
<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 %}?{{ filter.get_url }}" aria-label="dates précédentes" role="button">
|
||||
<a href="{% if calendar.nb_days == 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 %}?{{ filter.get_url }}" aria-label="dates précédentes" role="button">
|
||||
{% endif %}
|
||||
{% picto_from_name "chevrons-left" %}
|
||||
{% if calendar.calendar_days_list|length == 1 %}
|
||||
{% if calendar.nb_days == 1 %}
|
||||
{{ date_pred }}
|
||||
{% endif %}
|
||||
</a>
|
||||
@ -168,7 +168,7 @@
|
||||
<a role="button" href="{% url 'aujourdhui' %}?{{ filter.get_url }}">Aujourd'hui</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if calendar.calendar_days_list|length == 1 %}
|
||||
{% if calendar.nb_days == 1 %}
|
||||
{% if category %}
|
||||
<a role="button" href="{% url 'a_venir_jour_category' category.slug day.year day.month day.day %}?{{ filter.get_url }}">Autour du {{ day }}</a>
|
||||
{% else %}
|
||||
@ -197,11 +197,11 @@
|
||||
{% endif %}
|
||||
|
||||
{% if category %}
|
||||
<a href="{% if calendar.calendar_days_list|length == 1 %}{% url 'day_view_category' category.slug date_next.year date_next.month date_next.day %}{% else %}{% url 'a_venir_jour_category' category.slug date_next.year date_next.month date_next.day %}{% endif %}?{{ filter.get_url }}" aria-label="dates suivantes" role="button">
|
||||
<a href="{% if calendar.nb_days == 1 %}{% url 'day_view_category' category.slug date_next.year date_next.month date_next.day %}{% else %}{% url 'a_venir_jour_category' category.slug date_next.year date_next.month date_next.day %}{% endif %}?{{ filter.get_url }}" aria-label="dates suivantes" role="button">
|
||||
{% else %}
|
||||
<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 %}?{{ filter.get_url }}" aria-label="dates suivantes" role="button">
|
||||
<a href="{% if calendar.nb_days == 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 %}?{{ filter.get_url }}" aria-label="dates suivantes" role="button">
|
||||
{% endif %}
|
||||
{% if calendar.calendar_days_list|length == 1 %}
|
||||
{% if calendar.nb_days == 1 %}
|
||||
{{ date_next }}
|
||||
{% endif %}
|
||||
{% picto_from_name "chevrons-right" %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user