Show flight distance

This commit is contained in:
Edward Betts 2024-04-06 09:25:58 +02:00
parent 87aaba64b2
commit eb3be4cb51
2 changed files with 5 additions and 2 deletions

View file

@ -98,7 +98,10 @@
| <a href="https://uk.flightaware.com/live/flight/{{ full_flight_number | replace("U2", "EZY") }}">FlightAware</a>
| <a href="{{ radarbox_url }}">radarbox</a>
</div>
<div class="grid-item">
<div class="grid-item text-end">
{% if item.distance %}
{{ "{:,.0f} km / {:,.0f} miles".format(item.distance, item.distance / 1.60934) }}
{% endif %}
</div>
{% endmacro %}

View file

@ -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)