Amélioration de la performance des templates

This commit is contained in:
Jean-Marie Favreau 2024-11-24 12:40:43 +01:00
parent 5e65ecdb5c
commit ea5372cae5
16 changed files with 246 additions and 185 deletions

View File

@ -47,8 +47,14 @@
<p> <p>
{% picto_from_name "calendar" %} {% picto_from_name "calendar" %}
{% if event.end_day and event.end_day != event.start_day %}du{% else %}le{% endif %} {% if event.end_day and event.end_day != event.start_day %}du{% else %}le{% endif %}
{% include "agenda_culturel/date-times-inc.html" with event=event %} {{ event.start_day|date|frdate }}
</p> {% if event.start_time %} {% if not event.end_day or event.end_day == event.start_day %}{% if event.end_time %}de{% else %}à{% endif %}{% endif %}
{{ event.start_time }}
{% endif %}
{% if event.end_day and event.end_day != event.start_day %}
au {% if event.end_day and event.end_day != event.start_day %}{{ event.end_day|date|frdate }}{% endif %}
{% endif %}
{% if event.end_time %} {% if not event.end_day|date|frdate or event.end_day == event.start_day %}jusqu'à{% endif %} {{ event.end_time }}{% endif %} </p>
</header> </header>
<div class="body-fixed">{{ event.description |linebreaks }}</div> <div class="body-fixed">{{ event.description |linebreaks }}</div>

View File

@ -1,10 +0,0 @@
{% load utils_extra %}
{{ event.start_day|date|frdate }}
{% if event.start_time %} {% if not event.end_day or event.end_day == event.start_day %}{% if event.end_time %}de{% else %}à{% endif %}{% endif %}
{{ event.start_time }}
{% endif %}
{% if event.end_day and event.end_day != event.start_day %}
au {% if event.end_day and event.end_day != event.start_day %}{{ event.end_day|date|frdate }}{% endif %}
{% endif %}
{% if event.end_time %} {% if not event.end_day|date|frdate or event.end_day == event.start_day %}jusqu'à{% endif %} {{ event.end_time }}{% endif %}

View File

@ -1,83 +0,0 @@
{% load cat_extra %}
{% load event_extra %}
{% load utils_extra %}
{% load static %}
{% with day.date|date:"Y-m-d" as daytag %}
{% with "date-"|add:daytag as daytag %}
<article class="day{{ day|calendar_classes:fixed_style }}" id="{{ daytag }}">
{% if day.is_today %}
<script>
document.addEventListener("DOMContentLoaded", function(e) {
agenda = document.getElementById("calendar");
todayArticle = document.getElementById("today").parentElement;
left = todayArticle.offsetLeft;
top = todayArticle.offsetTop;
agenda.scrollTo({top: top, left: left});
});
</script>
{% endif %}
<header{% if day.is_today %} id="today"{% endif %}>
<{% if headers != "" %}{{ headers }}{% else %}h2{% endif %}><a href="{{ day.date | url_day }}?{{ filter.get_url }}">{{ day.date | date:"l j" }}</a></{% if headers != "" %}{{ headers }}{% else %}h2{% endif %}>
</header>
{% if day.events %}
{% if resume == 1 %}
<ul>
{% for category, events in day.events_by_category_ordered %}
<li>{{ events.0.category | circle_cat }}
<a href="{{ day.date | url_day }}?{{ filter.get_url|add_url_category:events.0.category }}" data-target="{{ daytag }}-category-{{ events.0.category.pk }}" onClick="toggleModal(event)">{{ events | length }} {{ category }}</a></li>
<dialog id="{{ daytag }}-category-{{ events.0.category.pk }}">
<article>
<header>
<a href="#{{ daytag }}-category-{{ events.0.category.pk }}"
aria-label="Fermer"
class="close"
data-target="{{ daytag }}-category-{{ events.0.category.pk }}"
onClick="toggleModal(event)"></a>
<h3>{{ events.0.category | small_cat }} du {{ day.date | date:"l j F" }}</h3>
</header>
<ul>
{% for event in events %}
<li>
{% if event.start_day == day.date and event.start_time %}
{{ event.start_time }}
{% endif %}
<a href="{{ event.get_absolute_url }}">{{ event|picto_status }} {{ event.title }} {{ event|tw_badge }}</a>
</li>
{% endfor %}
</ul>
<footer>
<div class="buttons">
<a href="{{ day.date | url_day }}?{{ filter.get_url }}" role="button">Voir la journée <svg width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<use href="{% static 'images/feather-sprite.svg' %}#chevron-right" />
</svg></a>
</div>
</footer>
</article>
</dialog>
{% endfor %}
<ul>
{% else %}
<ul>
{% for event in day.events %}
<li>{{ event.category | circle_cat:event.has_recurrences }}
{% if event.start_day == day.date and event.start_time %}
{{ event.start_time }}
{% endif %}
{{ event|picto_status }} <a href="{{ event.get_absolute_url }}" data-target="event-{{ event.id }}" onClick="toggleModal(event)">{{ event.title }}</a>
{{ event|tw_badge }}
<dialog id="event-{{ event.id }}">
{% include "agenda_culturel/single-event/event-modal-inc.html" with event=event filter=filter %}
</dialog>
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
</ul>
</article>
{% endwith %}
{% endwith %}

View File

@ -1,14 +0,0 @@
{% if event.exact_location %}
{% if nolink %}
{{ event.exact_location.name }}, {{ event.exact_location.city }}
{% else %}
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
{% endif %}
{% else %}
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
<a href="{% url 'add_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
{% else %}
{{ event.location }}
{% endif %}
{% endif %}

View File

@ -7,7 +7,6 @@
{% load cat_extra %} {% load cat_extra %}
{% load static %} {% load static %}
{% load cache %} {% load cache %}
{% load i18n %}
{% load l10n %} {% load l10n %}
{% block entete_header %} {% block entete_header %}
@ -60,7 +59,6 @@
{{ object.description|safe }} {{ object.description|safe }}
</header> </header>
{% get_current_language as LANGUAGE_CODE %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %} {% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout organisation_list user.is_authenticated object page_obj.number past %} {% cache cache_timeout organisation_list user.is_authenticated object page_obj.number past %}
<div class="slide-buttons"> <div class="slide-buttons">

View File

@ -1,9 +1,6 @@
{% extends "agenda_culturel/page.html" %} {% extends "agenda_culturel/page.html" %}
{% load i18n %}
{% load cat_extra %} {% load cat_extra %}
{% load event_extra %} {% load event_extra %}
{% load utils_extra %} {% load utils_extra %}
@ -28,9 +25,8 @@
{% include "agenda_culturel/filter-inc.html" with filter=filter noarticle=0 %} {% include "agenda_culturel/filter-inc.html" with filter=filter noarticle=0 %}
{% get_current_language as LANGUAGE_CODE %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %} {% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout month user.is_authenticated calendar.firstdate filter.get_url LANGUAGE_CODE %} {% cache cache_timeout month user.is_authenticated calendar.firstdate filter.get_url %}
<article> <article>
<header> <header>
@ -64,12 +60,75 @@
{% endif %} {% endif %}
<div class="grid week-in-month"> <div class="grid week-in-month">
{% for d in calendar.calendar_days_list %} {% for day in calendar.calendar_days_list %}
{% if forloop.counter0|divisibleby:7 %} {% if forloop.counter0|divisibleby:7 %}
{% if not forloop.first %}</div><div class="grid week-in-month">{% endif %} {% if not forloop.first %}</div><div class="grid week-in-month">{% endif %}
<div id="week-{{ d.date.isocalendar.1 }}" class="entete-semaine"><h2><a href="{% url 'week_view' calendar.year d.week %}?{{ filter.get_url }}">Semaine {{ d.week }}</a></h2></div> <div id="week-{{ day.date.isocalendar.1 }}" class="entete-semaine"><h2><a href="{% url 'week_view' calendar.year day.week %}?{{ filter.get_url }}">Semaine {{ d.week }}</a></h2></div>
{% endif %} {% endif %}
{% include "agenda_culturel/day-inc.html" with day=d resume=1 fixed_style=calendar.all_in_past filter=filter headers="h3" %}
{% with day.date|date:"Y-m-d" as daytag %}
{% with "date-"|add:daytag as daytag %}
<article class="day{{ day|calendar_classes:calendar.all_in_past }}" id="{{ daytag }}">
{% if day.is_today %}
<script>
document.addEventListener("DOMContentLoaded", function(e) {
agenda = document.getElementById("calendar");
todayArticle = document.getElementById("today").parentElement;
left = todayArticle.offsetLeft;
top = todayArticle.offsetTop;
agenda.scrollTo({top: top, left: left});
});
</script>
{% endif %}
<header{% if day.is_today %} id="today"{% endif %}>
<h3><a href="{{ day.date | url_day }}?{{ filter.get_url }}">{{ day.date | date:"l j" }}</a></h3}>
</header>
{% if day.events %}
<ul>
{% for category, events in day.events_by_category_ordered %}
<li>{{ events.0.category | circle_cat }}
<a href="{{ day.date | url_day }}?{{ filter.get_url|add_url_category:events.0.category }}" data-target="{{ daytag }}-category-{{ events.0.category.pk }}" onClick="toggleModal(event)">{{ events | length }} {{ category }}</a></li>
<dialog id="{{ daytag }}-category-{{ events.0.category.pk }}">
<article>
<header>
<a href="#{{ daytag }}-category-{{ events.0.category.pk }}"
aria-label="Fermer"
class="close"
data-target="{{ daytag }}-category-{{ events.0.category.pk }}"
onClick="toggleModal(event)"></a>
<h3>{{ events.0.category | small_cat }} du {{ day.date | date:"l j F" }}</h3>
</header>
<ul>
{% for event in events %}
<li>
{% if event.start_day == day.date and event.start_time %}
{{ event.start_time }}
{% endif %}
<a href="{{ event.get_absolute_url }}">{{ event|picto_status }} {{ event.title }} {{ event|tw_badge }}</a>
</li>
{% endfor %}
</ul>
<footer>
<div class="buttons">
<a href="{{ day.date | url_day }}?{{ filter.get_url }}" role="button">Voir la journée <svg width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<use href="{% static 'images/feather-sprite.svg' %}#chevron-right" />
</svg></a>
</div>
</footer>
</article>
</dialog>
{% endfor %}
<ul>
{% endif %}
</ul>
</article>
{% endwith %}
{% endwith %}
{% endfor %} {% endfor %}
</div> </div>
{% if calendar.lastdate|shift_day:+1|not_after_last %} {% if calendar.lastdate|shift_day:+1|not_after_last %}

View File

@ -1,7 +1,6 @@
{% extends "agenda_culturel/page.html" %} {% extends "agenda_culturel/page.html" %}
{% load i18n %}
{% load cache %} {% load cache %}
{% load cat_extra %} {% load cat_extra %}
{% load event_extra %} {% load event_extra %}
@ -37,9 +36,8 @@
{% include "agenda_culturel/filter-inc.html" with filter=filter noarticle=1 %} {% include "agenda_culturel/filter-inc.html" with filter=filter noarticle=1 %}
{% get_current_language as LANGUAGE_CODE %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %} {% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout upcoming user.is_authenticated calendar.firstdate filter.get_url calendar.calendar_days_list|length LANGUAGE_CODE %} {% cache cache_timeout upcoming user.is_authenticated calendar.firstdate filter.get_url calendar.calendar_days_list|length %}
<footer> <footer>
<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"> <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">

View File

@ -1,13 +1,12 @@
{% extends "agenda_culturel/page.html" %} {% extends "agenda_culturel/page.html" %}
{% load i18n %}
{% load cache %} {% load cache %}
{% load cat_extra %} {% load cat_extra %}
{% load event_extra %} {% load event_extra %}
{% load utils_extra %} {% load utils_extra %}
{% load static %} {% load static %}
{% load i18n %} {% load tag_extra %}
{% block entete_header %} {% block entete_header %}
{% css_categories %} {% css_categories %}
@ -23,9 +22,8 @@
{% include "agenda_culturel/filter-inc.html" with filter=filter noarticle=0 %} {% include "agenda_culturel/filter-inc.html" with filter=filter noarticle=0 %}
{% get_current_language as LANGUAGE_CODE %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %} {% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout week user.is_authenticated calendar.firstdate filter.get_url LANGUAGE_CODE %} {% cache cache_timeout week user.is_authenticated calendar.firstdate filter.get_url %}
<article> <article>
<header> <header>
@ -64,8 +62,99 @@
{% endif %} {% endif %}
<div class="grid"> <div class="grid">
{% for d in calendar.calendar_days_list %} {% for day in calendar.calendar_days_list %}
{% include "agenda_culturel/day-inc.html" with day=d resume=0 fixed_style=calendar.all_in_past filter=filter headers="" %}
{% with day.date|date:"Y-m-d" as daytag %}
{% with "date-"|add:daytag as daytag %}
<article class="day{{ day|calendar_classes:calendar.all_in_past }}" id="{{ daytag }}">
{% if day.is_today %}
<script>
document.addEventListener("DOMContentLoaded", function(e) {
agenda = document.getElementById("calendar");
todayArticle = document.getElementById("today").parentElement;
left = todayArticle.offsetLeft;
top = todayArticle.offsetTop;
agenda.scrollTo({top: top, left: left});
});
</script>
{% endif %}
<header{% if day.is_today %} id="today"{% endif %}>
<h2><a href="{{ day.date | url_day }}?{{ filter.get_url }}">{{ day.date | date:"l j" }}</a></h2>
</header>
{% if day.events %}
<ul>
{% for event in day.events %}
<li>{{ event.category | circle_cat:event.has_recurrences }}
{% if event.start_day == day.date and event.start_time %}
{{ event.start_time }}
{% endif %}
{{ event|picto_status }} <a href="{{ event.get_absolute_url }}" data-target="event-{{ event.id }}" onClick="toggleModal(event)">{{ event.title }}</a>
{{ event|tw_badge }}
<dialog id="event-{{ event.id }}">
<article>
<header>
<a href="#event-{{ event.id }}"
aria-label="Fermer"
class="close"
data-target="event-{{ event.id }}"
onClick="toggleModal(event)"></a>
<h3>{{ event.category|small_cat_recurrent:event.has_recurrences }} {{ event|picto_status }} {{ event.title }} {{ event|picto_visibility:user.is_authenticated }}</h3>
<p>
{% picto_from_name "map-pin" %}
{% if event.exact_location %}
{{ event.exact_location.name }}, {{ event.exact_location.city }}
{% else %}
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
<a href="{% url 'add_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
{% else %}
{{ event.location }}
{% endif %}
{% endif %} </p>
<p>
{% picto_from_name "calendar" %}
{% if event.end_day and event.end_day != event.start_day %}du{% else %}le{% endif %}
{{ event.start_day|date|frdate }}
{% if event.start_time %} {% if not event.end_day or event.end_day == event.start_day %}{% if event.end_time %}de{% else %}à{% endif %}{% endif %}
{{ event.start_time }}
{% endif %}
{% if event.end_day and event.end_day != event.start_day %}
au {% if event.end_day and event.end_day != event.start_day %}{{ event.end_day|date|frdate }}{% endif %}
{% endif %}
{% if event.end_time %} {% if not event.end_day|date|frdate or event.end_day == event.start_day %}jusqu'à{% endif %} {{ event.end_time }}{% endif %}
</p>
</header>
<div class="body-fixed">{{ event.description |linebreaks }}</div>
<p>
{% for tag in event.sorted_tags %}
{{ tag | tag_button }}
{% endfor %}
</p>
<footer class="infos-and-buttons">
<div class="buttons">
<a href="{{ event.get_absolute_url }}" role="button">Voir l'événement <svg width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<use href="{% static 'images/feather-sprite.svg' %}#chevron-right" />
</svg></a>
</div>
</footer>
</article>
</dialog>
</li>
{% endfor %}
</ul>
{% endif %}
</ul>
</article>
{% endwith %}
{% endwith %}
{% endfor %} {% endfor %}
</div> </div>
<div class="slider-button slider-button-inside button-right hidden">{% picto_from_name "arrow-right" %}</div> <div class="slider-button slider-button-inside button-right hidden">{% picto_from_name "arrow-right" %}</div>

View File

@ -7,7 +7,6 @@
{% load cat_extra %} {% load cat_extra %}
{% load static %} {% load static %}
{% load cache %} {% load cache %}
{% load i18n %}
{% load l10n %} {% load l10n %}
{% block entete_header %} {% block entete_header %}
@ -86,7 +85,6 @@
<p>Voir aussi <a href="{% url 'view_places' %}">les autres lieux</a></p> <p>Voir aussi <a href="{% url 'view_places' %}">les autres lieux</a></p>
</div> </div>
</div> </div>
{% get_current_language as LANGUAGE_CODE %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %} {% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout place_list user.is_authenticated object page_obj.number past %} {% cache cache_timeout place_list user.is_authenticated object page_obj.number past %}
<div class="slide-buttons"> <div class="slide-buttons">

View File

@ -3,7 +3,6 @@
{% block title %}{% block og_title %}Lieux{% endblock %}{% endblock %} {% block title %}{% block og_title %}Lieux{% endblock %}{% endblock %}
{% load cache %} {% load cache %}
{% load i18n %}
{% load utils_extra %} {% load utils_extra %}
{% load static %} {% load static %}
{% load cat_extra %} {% load cat_extra %}
@ -36,7 +35,6 @@
<div class="vertical-max"> <div class="vertical-max">
{% get_current_language as LANGUAGE_CODE %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %} {% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout place_lists user.is_authenticated %} {% cache cache_timeout place_lists user.is_authenticated %}

View File

@ -35,7 +35,16 @@
{% if not no_location %} {% if not no_location %}
<h5> <h5>
{% picto_from_name "map-pin" %} {% picto_from_name "map-pin" %}
{% include "agenda_culturel/event-location-inc.html" with event=event %}
{% if event.exact_location %}
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
{% else %}
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
<a href="{% url 'add_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
{% else %}
{{ event.location }}
{% endif %}
{% endif %}
</h5> </h5>
{% endif %} {% endif %}
</hgroup> </hgroup>
@ -51,7 +60,14 @@
{% picto_from_name "calendar" %} {% picto_from_name "calendar" %}
<em>{% if event.end_day and event.end_day != event.start_day %}Cet événement dure du {% else %}Cet événement a lieu le{% endif %} <em>{% if event.end_day and event.end_day != event.start_day %}Cet événement dure du {% else %}Cet événement a lieu le{% endif %}
{% include "agenda_culturel/date-times-inc.html" with event=event %} {{ event.start_day|date|frdate }}
{% if event.start_time %} {% if not event.end_day or event.end_day == event.start_day %}{% if event.end_time %}de{% else %}à{% endif %}{% endif %}
{{ event.start_time }}
{% endif %}
{% if event.end_day and event.end_day != event.start_day %}
au {% if event.end_day and event.end_day != event.start_day %}{{ event.end_day|date|frdate }}{% endif %}
{% endif %}
{% if event.end_time %} {% if not event.end_day|date|frdate or event.end_day == event.start_day %}jusqu'à{% endif %} {{ event.end_time }}{% endif %}
</em></p> </em></p>
{% endif %} {% endif %}
<div class="infos"> <div class="infos">

View File

@ -10,12 +10,29 @@
</h3> </h3>
<p class="subentry-search">{% picto_from_name "calendar" %} <p class="subentry-search">{% picto_from_name "calendar" %}
{% if event.end_day and event.end_day != event.start_day %}du{% else %}le{% endif %} {% if event.end_day and event.end_day != event.start_day %}du{% else %}le{% endif %}
{% include "agenda_culturel/date-times-inc.html" with event=event %} {{ event.start_day|date|frdate }}
{% if event.start_time %} {% if not event.end_day or event.end_day == event.start_day %}{% if event.end_time %}de{% else %}à{% endif %}{% endif %}
{{ event.start_time }}
{% endif %}
{% if event.end_day and event.end_day != event.start_day %}
au {% if event.end_day and event.end_day != event.start_day %}{{ event.end_day|date|frdate }}{% endif %}
{% endif %}
{% if event.end_time %} {% if not event.end_day|date|frdate or event.end_day == event.start_day %}jusqu'à{% endif %} {{ event.end_time }}{% endif %}
<p class="subentry-search"> <p class="subentry-search">
{% if not no_location %} {% if not no_location %}
{% if event.location or event.exact_location %} {% if event.location or event.exact_location %}
{% picto_from_name "map-pin" %} {% picto_from_name "map-pin" %}
{% include "agenda_culturel/event-location-inc.html" with event=event %}
{% if event.exact_location %}
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
{% else %}
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
<a href="{% url 'add_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
{% else %}
{{ event.location }}
{% endif %}
{% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
</p> </p>

View File

@ -18,10 +18,27 @@
{{ event|picto_visibility:user.is_authenticated }}</h3> {{ event|picto_visibility:user.is_authenticated }}</h3>
{% picto_from_name "map-pin" %} {% picto_from_name "map-pin" %}
{% include "agenda_culturel/event-location-inc.html" with event=event %}
{% if event.exact_location %}
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
{% else %}
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
<a href="{% url 'add_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
{% else %}
{{ event.location }}
{% endif %}
{% endif %}
<p>{% picto_from_name "calendar" %} <p>{% picto_from_name "calendar" %}
{% if event.end_day and event.end_day != event.start_day %}du{% else %}le{% endif %} {% if event.end_day and event.end_day != event.start_day %}du{% else %}le{% endif %}
{% include "agenda_culturel/date-times-inc.html" with event=event %} {{ event.start_day|date|frdate }}
{% if event.start_time %} {% if not event.end_day or event.end_day == event.start_day %}{% if event.end_time %}de{% else %}à{% endif %}{% endif %}
{{ event.start_time }}
{% endif %}
{% if event.end_day and event.end_day != event.start_day %}
au {% if event.end_day and event.end_day != event.start_day %}{{ event.end_day|date|frdate }}{% endif %}
{% endif %}
{% if event.end_time %} {% if not event.end_day|date|frdate or event.end_day == event.start_day %}jusqu'à{% endif %} {{ event.end_time }}{% endif %}
{% if event.has_recurrences %} {% if event.has_recurrences %}
<p> <p>
{% picto_from_name "repeat" %} {% picto_from_name "repeat" %}

View File

@ -1,44 +0,0 @@
{% load static %}
{% load cat_extra %}
{% load utils_extra %}
{% load event_extra %}
{% load tag_extra %}
<article>
<header>
<a href="#event-{{ event.id }}"
aria-label="Fermer"
class="close"
data-target="event-{{ event.id }}"
onClick="toggleModal(event)"></a>
<h3>{{ event.category|small_cat_recurrent:event.has_recurrences }} {{ event|picto_status }} {{ event.title }} {{ event|picto_visibility:user.is_authenticated }}</h3>
<p>
{% picto_from_name "map-pin" %}
{% include "agenda_culturel/event-location-inc.html" with event=event nolink=1 %}
</p>
<p>
{% picto_from_name "calendar" %}
{% if event.end_day and event.end_day != event.start_day %}du{% else %}le{% endif %}
{% include "agenda_culturel/date-times-inc.html" with event=event %}
</p>
</header>
<div class="body-fixed">{{ event.description |linebreaks }}</div>
<p>
{% for tag in event.sorted_tags %}
{{ tag | tag_button }}
{% endfor %}
</p>
<footer class="infos-and-buttons">
<div class="buttons">
<a href="{{ event.get_absolute_url }}" role="button">Voir l'événement <svg width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<use href="{% static 'images/feather-sprite.svg' %}#chevron-right" />
</svg></a>
</div>
</footer>
</article>

View File

@ -13,11 +13,27 @@
<p> <p>
{% picto_from_name "calendar" %} {% picto_from_name "calendar" %}
{% if event.end_day and event.end_day != event.start_day %}du{% else %}le{% endif %} {% if event.end_day and event.end_day != event.start_day %}du{% else %}le{% endif %}
{% include "agenda_culturel/date-times-inc.html" with event=event %} {{ event.start_day|date|frdate }}
{% if event.start_time %} {% if not event.end_day or event.end_day == event.start_day %}{% if event.end_time %}de{% else %}à{% endif %}{% endif %}
{{ event.start_time }}
{% endif %}
{% if event.end_day and event.end_day != event.start_day %}
au {% if event.end_day and event.end_day != event.start_day %}{{ event.end_day|date|frdate }}{% endif %}
{% endif %}
{% if event.end_time %} {% if not event.end_day|date|frdate or event.end_day == event.start_day %}jusqu'à{% endif %} {{ event.end_time }}{% endif %}
</p> </p>
<p> <p>
{% picto_from_name "map-pin" %} {% picto_from_name "map-pin" %}
{% include "agenda_culturel/event-location-inc.html" with event=event %}
{% if event.exact_location %}
<a href="{{ event.exact_location.get_absolute_url }}">{{ event.exact_location.name }}, {{ event.exact_location.city }}</a>
{% else %}
{% if perms.agenda_culturel.change_event and perms.agenda_culturel.change_place %}
<a href="{% url 'add_place_to_event' event.pk %}" class="missing-data">{{ event.location }}</a>
{% else %}
{{ event.location }}
{% endif %}
{% endif %}
</p> </p>
{% with event.get_shown_organisers as organisers %} {% with event.get_shown_organisers as organisers %}

View File

@ -16,7 +16,7 @@
{% block content %} {% block content %}
{% with cache_timeout=user.is_authenticated|yesno:"30,600" %} {% with cache_timeout=user.is_authenticated|yesno:"30,600" %}
{% cache cache_timeout alltags LANGUAGE_CODE %} {% cache cache_timeout alltags %}
<article class="tag-descriptions"> <article class="tag-descriptions">
<header> <header>