on améliore la détection des récurrences

This commit is contained in:
Jean-Marie Favreau 2024-01-07 10:43:27 +01:00
parent a4965731e4
commit bb6bebc5a7
4 changed files with 6 additions and 3 deletions

View File

@ -303,6 +303,9 @@ class Event(models.Model):
return result return result
def has_recurrences(self):
# TODO: see https://forge.chapril.org/jmtrivial/agenda_culturel/issues/65
return self.recurrences is not None and len(self.recurrences.rrules) != 0
def update_recurrence_dtstartend(self): def update_recurrence_dtstartend(self):
sday = date.fromisoformat(self.start_day) if isinstance(self.start_day, str) else self.start_day sday = date.fromisoformat(self.start_day) if isinstance(self.start_day, str) else self.start_day

View File

@ -10,7 +10,7 @@
{% if event.end_day %}du{% else %}le{% endif %} {% if event.end_day %}du{% else %}le{% endif %}
{% include "agenda_culturel/date-times-inc.html" with event=event %} {% include "agenda_culturel/date-times-inc.html" with event=event %}
{% picto_from_name "map-pin" %} {% picto_from_name "map-pin" %}
{% if event.recurrences %} {% if event.has_recurrences %}
<p class="subentry-search"> <p class="subentry-search">
{% picto_from_name "repeat" %} {% picto_from_name "repeat" %}
<!-- TODO: see https://forge.chapril.org/jmtrivial/agenda_culturel/issues/65 --> <!-- TODO: see https://forge.chapril.org/jmtrivial/agenda_culturel/issues/65 -->

View File

@ -68,7 +68,7 @@
{% else %} {% else %}
<p><em>Cet événement est disponible uniquement sur les nuits énimagmatiques.</em></p> <p><em>Cet événement est disponible uniquement sur les nuits énimagmatiques.</em></p>
{% endif %} {% endif %}
{% if event.recurrences %} {% if event.has_recurrences %}
<p class="footer"> <p class="footer">
{% picto_from_name "repeat" %} {% picto_from_name "repeat" %}
<!-- TODO: see https://forge.chapril.org/jmtrivial/agenda_culturel/issues/65 --> <!-- TODO: see https://forge.chapril.org/jmtrivial/agenda_culturel/issues/65 -->

View File

@ -47,7 +47,7 @@
<p><em>À notre connaissance, cet événement n'est pas référencé autre part sur internet.</em></p> <p><em>À notre connaissance, cet événement n'est pas référencé autre part sur internet.</em></p>
{% endif %} {% endif %}
{% if event.recurrences %} {% if event.has_recurrences %}
<p class="footer"> <p class="footer">
{% picto_from_name "repeat" %} {% picto_from_name "repeat" %}
<!-- TODO: see https://forge.chapril.org/jmtrivial/agenda_culturel/issues/65 --> <!-- TODO: see https://forge.chapril.org/jmtrivial/agenda_culturel/issues/65 -->