Même pour un événement à plusieurs jours, on indique l'heure de début si elle est disponible pour son premier jour

This commit is contained in:
Jean-Marie Favreau 2023-11-25 19:39:01 +01:00
parent 8bdc9a1948
commit b21cc8ee8c
2 changed files with 2 additions and 4 deletions

View File

@ -120,8 +120,6 @@ class Event(models.Model):
tags = ArrayField(models.CharField(max_length=64), verbose_name=_('Tags'), help_text=_("A list of tags that describe the event."), blank=True, null=True)
def single_day(self):
return not self.end_day or self.end_day == self.start_day
def get_absolute_url(self):
return reverse("view_event", kwargs={"pk": self.pk, "extra": slugify(self.title)})

View File

@ -30,7 +30,7 @@
<ul>
{% for event in events %}
<li>
{% if event.single_day and event.start_time %}
{% 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 }}</a>
@ -52,7 +52,7 @@
<ul>
{% for event in day.events %}
<li>{{ event.category | circle_cat }}
{% if event.single_day and event.start_time %}
{% if event.start_day == day.date and event.start_time %}
{{ event.start_time }}
{% endif %}
{{ event|picto_status }} <a href="{{ daytag }}" data-target="event-{{ event.id }}" onClick="toggleModal(event)">{{ event.title }}</a>