From eb3be4cb515b4afb2c1f6af623b44d4c1ee61473 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 6 Apr 2024 09:25:58 +0200 Subject: [PATCH] Show flight distance --- templates/macros.html | 5 ++++- web_view.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/macros.html b/templates/macros.html index 897b05b..3cbdec6 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -98,7 +98,10 @@ | FlightAware | radarbox -
+
+ {% if item.distance %} + {{ "{:,.0f} km / {:,.0f} miles".format(item.distance, item.distance / 1.60934) }} + {% endif %}
{% endmacro %} diff --git a/web_view.py b/web_view.py index bb6ec2d..e927b49 100755 --- a/web_view.py +++ b/web_view.py @@ -110,7 +110,7 @@ async def weekends() -> str: def travel_list() -> str: """Page showing a list of upcoming travel.""" data_dir = app.config["PERSONAL_DATA"] - flights = travel.parse_yaml("flights", data_dir) + flights = agenda.trip.load_flights(data_dir) trains = [ item for item in travel.parse_yaml("trains", data_dir)