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