From fbed65adcc628e2035c71bb8ae0dc48696a8416c Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 5 Oct 2024 17:37:33 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20de=20l'affichage=20=C3=A0?= =?UTF-8?q?=20venir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agenda_culturel/calendar.py | 4 +- src/agenda_culturel/static/style.scss | 31 +++++--- .../agenda_culturel/page-upcoming.html | 73 ++++++++++--------- .../agenda_culturel/place_unknown_form.html | 1 - .../single-event/event-in-upcoming-inc.html | 18 ++--- 5 files changed, 73 insertions(+), 54 deletions(-) diff --git a/src/agenda_culturel/calendar.py b/src/agenda_culturel/calendar.py index 4f8dd8b..aa561c8 100644 --- a/src/agenda_culturel/calendar.py +++ b/src/agenda_culturel/calendar.py @@ -37,6 +37,7 @@ class DayInCalendar: self.events_by_category = {} self.time_intervals = None + self.id = d.strftime('%Y-%m-%d') def is_in_past(self): return self.in_past @@ -157,7 +158,6 @@ class DayInCalendar: interval_markers = [datetime.combine(self.date, time(h, m)) for h, m in [(11, 30), (13, 0), (18, 0)]] self.build_time_intervals(all_day_name, interval_names, interval_markers) - logger.error("hop " + str(len(self.time_intervals))) return self.time_intervals @@ -165,8 +165,8 @@ class IntervalInDay(DayInCalendar): def __init__(self, d, id, name): self.name = name - self.id = d.strftime('%Y-%m-%d') + '-' + str(id) super().__init__(d) + self.id = self.id + '-' + str(id) class CalendarList: def __init__(self, firstdate, lastdate, filter=None, exact=False): diff --git a/src/agenda_culturel/static/style.scss b/src/agenda_culturel/static/style.scss index 48db75d..cc2d9a2 100644 --- a/src/agenda_culturel/static/style.scss +++ b/src/agenda_culturel/static/style.scss @@ -526,12 +526,6 @@ article#filters { .slide-buttons { float: right; - margin-bottom: -2.8em; -} -@media only screen and (min-width: 992px) { - .slide-buttons { - margin-left: -3em; - } } .highlight { @@ -817,19 +811,19 @@ nav>div { } } -nav .badge { +.badge { @extend [role="button"]; font-size: 70%; padding: 0.2em .8em; border-radius: .5em; } -nav .badge.error { +.badge.error { background: #b71c1c; border-color: #cb1b1b; } -nav .badge.simple { +.badge.simple { background: var(--secondary); border-color: var(--secondary); color: var(--secondary-inverse); @@ -1216,4 +1210,23 @@ article { top: 0; z-index: 10; } + @media only screen and (min-width: 992px) { + .resume { + column-count: 4; + } + .single-event { + .head { + float: left; + width: 30%; + margin-right: 1em; + } + .description { + float: left; + width: calc(70% - 16em); + } + .illustration { + width: 14em; + } + } + } } \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/page-upcoming.html b/src/agenda_culturel/templates/agenda_culturel/page-upcoming.html index 7f577f0..c0e9f7e 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-upcoming.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-upcoming.html @@ -32,13 +32,13 @@ {% include "agenda_culturel/filter-inc.html" with filter=filter %} - -{% for ti in calendar.time_intervals_list %} -
+{% for cd in calendar.calendar_days_list %} +
{% picto_from_name "chevrons-up" %} -
-

{{ ti.name }}

-

{{ ti.date }}

-
+

{{ cd.date }}

-
-
- {% if ti.events|length > 1 %} -

Résumé

-
    - {% for event in ti.events %} + {% if cd.events|length > 0 %} +
    + {% for ti in cd.get_time_intervals %} + {% if ti.events|length > 0 %} +

    {{ ti.name }} {% picto_from_name "chevron-down" %}

    +
      + {% for event in ti.events %}
    • {{ event.category | circle_cat:event.has_recurrences }} {% if event.start_time %} {{ event.start_time }} {% endif %} {{ event|picto_status }} {{ event.title }}
    • - {% endfor %} -
    - {% endif %} -
    -
    - {% if ti.events|length > 1 %} -

    Événements

    - {% endif %} - {% with indexti=ti.id %} - {% for event in ti.events %} - {% include "agenda_culturel/single-event/event-in-upcoming-inc.html" with event=event filter=filter day=day indexti=indexti %} - {% endfor %} - {% endwith %} -
    + {% endfor %} +
+ {% endif %} + {% endfor %}
+ {% else %} + Aucun événement + {% endif %}
- + {% for ti in cd.get_time_intervals %} + {% if ti.events|length > 0 %} +
+
+ {% picto_from_name "chevron-up" %} +
+

{{ ti.name }}

+

{{ ti.date }}

+
+
+ {% with indexti=cd.id %} + {% for event in ti.events %} + {% include "agenda_culturel/single-event/event-in-upcoming-inc.html" with event=event filter=filter day=day indexti=indexti %} + {% endfor %} + {% endwith %} +
+ {% endif %} + {% endfor %} {% endfor %} diff --git a/src/agenda_culturel/templates/agenda_culturel/place_unknown_form.html b/src/agenda_culturel/templates/agenda_culturel/place_unknown_form.html index 8770cfe..15301f8 100644 --- a/src/agenda_culturel/templates/agenda_culturel/place_unknown_form.html +++ b/src/agenda_culturel/templates/agenda_culturel/place_unknown_form.html @@ -61,7 +61,6 @@ document.querySelector(".choices__inner").classList.add("contrast"); document.querySelector(".choices__inner").classList.add("outline"); document.querySelector(".choices__inner").setAttribute("role", "button"); - console.log("hop"); diff --git a/src/agenda_culturel/templates/agenda_culturel/single-event/event-in-upcoming-inc.html b/src/agenda_culturel/templates/agenda_culturel/single-event/event-in-upcoming-inc.html index 564ddda..d765e35 100644 --- a/src/agenda_culturel/templates/agenda_culturel/single-event/event-in-upcoming-inc.html +++ b/src/agenda_culturel/templates/agenda_culturel/single-event/event-in-upcoming-inc.html @@ -4,13 +4,13 @@ {% load event_extra %} {% load tag_extra %} -
- {% picto_from_name "arrow-up" %} +
{% if event.image or event.local_image %}
{{ event.image_alt }}
{% endif %} +
{% if event|can_show_start_time:day %} {% if event.start_time %}
@@ -28,15 +28,15 @@ {{ event.category | small_cat_recurrent:event.has_recurrences }} {% if event.location or event.exact_location %}
{% endif %} -

+

{{ event|picto_status }} {{ event.title }} -

+ {% if event.location or event.exact_location %} -

+

{% picto_from_name "map-pin" %} {% include "agenda_culturel/event-location-inc.html" with event=event %} -
+
{% endif %} @@ -47,11 +47,11 @@ {% include "agenda_culturel/date-times-inc.html" with event=event %}

{% endif %} +
- - +

{{ event.description |linebreaks2 | truncatewords:60 }}

- +