diff --git a/templates/trip_page.html b/templates/trip_page.html index 06437a5..0c1d05a 100644 --- a/templates/trip_page.html +++ b/templates/trip_page.html @@ -60,6 +60,7 @@ {% endblock %} {% set end = trip.end %} +{% set total_distance = trip.total_distance() %} {% block content %}
@@ -80,6 +81,13 @@ {#
Countries: {{ trip.countries_str }}
#}
Locations: {{ trip.locations_str }}
+ {% if total_distance %} +
Total distance: + {{ "{:,.0f} km / {:,.0f} miles".format(total_distance, total_distance / 1.60934) }} +
+ {% endif %} + + {% set delta = human_readable_delta(trip.start) %} {% if delta %}
How long until trip: {{ delta }}
@@ -201,11 +209,19 @@ {% if item.arrive %} → {{ item.arrive.strftime("%H:%M %z") }} - ✨ - {{ ((item.arrive - item.depart).total_seconds() // 60) | int }} mins + 🕒{{ ((item.arrive - item.depart).total_seconds() // 60) | int }} mins {% endif %} ✨ {{ item.airline }}{{ item.flight_number }} + + {% if item.distance %} + + 🌍distance: + {{ "{:,.0f} km / {:,.0f} miles".format(item.distance, item.distance / 1.60934) }} + + {% endif %} + +
{% elif item.type == "train" %}
@@ -215,7 +231,13 @@ {% if item.class %} {{ item.class }} {% endif %} - {{ ((item.arrive - item.depart).total_seconds() // 60) | int }} mins + 🕒{{ ((item.arrive - item.depart).total_seconds() // 60) | int }} mins + {% if item.distance %} + + 🛤️ + {{ "{:,.0f} km / {:,.0f} miles".format(item.distance, item.distance / 1.60934) }} + + {% endif %}
{% endif %}