From c9fcf1d5e7ed1570ea1ed492a31d45a1ce3f4660 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 18 May 2024 12:14:34 +0200 Subject: [PATCH] Include current trip in future list --- web_view.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web_view.py b/web_view.py index 2034fe4..293cba4 100755 --- a/web_view.py +++ b/web_view.py @@ -311,6 +311,12 @@ def trip_future_list() -> str: trip_list = get_trip_list(route_distances) today = date.today() + current = [ + item + for item in trip_list + if item.start <= today and (item.end or item.start) >= today + ] + future = [item for item in trip_list if item.start > today] coordinates, routes = agenda.trip.get_coordinates_and_routes(future) @@ -318,7 +324,7 @@ def trip_future_list() -> str: return flask.render_template( "trip/list.html", heading="Future trips", - trips=future, + trips=current + future, coordinates=coordinates, routes=routes, today=today,