diff --git a/templates/trip_page.html b/templates/trip_page.html index a9bf8a8..001ba6e 100644 --- a/templates/trip_page.html +++ b/templates/trip_page.html @@ -6,6 +6,17 @@ {% set row = { "flight": flight_row, "train": train_row } %} +{% macro next_and_previous() %} +
+ {% if prev_trip %} + previous: {{ trip_link(prev_trip) }} ({{ (trip.start - prev_trip.end).days }} days) + {% endif %} + {% if next_trip %} + next: {{ trip_link(next_trip) }} ({{ (next_trip.start - trip.end).days }} days) + {% endif %} +
+{% endmacro %} + {% block style %} {% if coordinates %} @@ -55,6 +66,7 @@ {% block content %}{% if end %} @@ -167,14 +179,7 @@ {% endif %}
- {% if prev_trip %} - previous: {{ trip_link(prev_trip) }} ({{ (trip.start - prev_trip.end).days }} days) - {% endif %} - {% if next_trip %} - next: {{ trip_link(next_trip) }} ({{ (next_trip.start - trip.end).days }} days) - {% endif %} -
+ {{ next_and_previous() }}