From c3be926ff7ae26754c5be9ddc98e64dc64c969eb Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 11 Jan 2025 15:29:07 -0600 Subject: [PATCH] Current trip summary on index page Closes: #169 --- templates/event_list.html | 12 +++--------- web_view.py | 3 ++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/templates/event_list.html b/templates/event_list.html index a769bed..5a89f99 100644 --- a/templates/event_list.html +++ b/templates/event_list.html @@ -39,7 +39,7 @@ } %} -{% from "macros.html" import trip_link, display_date_no_year with context %} +{% from "macros.html" import trip_link, display_date_no_year, trip_item with context %} {% from "navbar.html" import navbar with context %} @@ -81,15 +81,9 @@ {% endfor %} {% if current_trip %} - {% set end = current_trip.end %}
-
Current trip: {{ trip_link(current_trip) }}
- {% if end %} -
Dates: {{ display_date_no_year(current_trip.start) }} to {{ display_date_no_year(end) }}
- {% else %} -
Start: {{ display_date_no_year(current_trip.start) }} (end date missing)
- {% endif %} - +

Current trip

+ {{ trip_item(current_trip) }}
{% endif %} diff --git a/web_view.py b/web_view.py index e400bb1..474ac1b 100755 --- a/web_view.py +++ b/web_view.py @@ -102,7 +102,8 @@ async def index() -> str: "event_list.html", today=today, events=events, - current_trip=get_current_trip(now.date()), + get_country=agenda.get_country, + current_trip=get_current_trip(today), fullcalendar_events=calendar.build_events(events), start_event_list=date.today() - timedelta(days=1), end_event_list=date.today() + timedelta(days=365 * 2),