Add next and previous links at top of trip page

This commit is contained in:
Edward Betts 2024-01-23 16:28:20 +00:00
parent 6c1c638104
commit 14c25e16ed

View file

@ -6,6 +6,17 @@
{% set row = { "flight": flight_row, "train": train_row } %}
{% macro next_and_previous() %}
<p>
{% 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 %}
</p>
{% endmacro %}
{% block style %}
{% if coordinates %}
@ -55,6 +66,7 @@
{% block content %}
<div class="row">
<div class="col m-3">
{{ next_and_previous() }}
<h1>{{ trip.title }}</h1>
<p class="lead">
{% if end %}
@ -167,14 +179,7 @@
{% endif %}
</div>
<p>
{% 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 %}
</p>
{{ next_and_previous() }}
</div>
<div class="col">