From 3dd322475f9a6a010ba6b01562a775719ce0b4d1 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Thu, 24 Jul 2025 22:30:31 +0100 Subject: [PATCH] Show ferry detail on individual trip page Closes: #154 --- templates/trip_page.html | 43 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/templates/trip_page.html b/templates/trip_page.html index d7f0295..7056efc 100644 --- a/templates/trip_page.html +++ b/templates/trip_page.html @@ -264,12 +264,17 @@ {% if item.type == "flight" %} ✈️ {{ item.from_airport.name }} ({{ item.from_airport.iata}}) - → + → {{ item.to_airport.name }} ({{item.to_airport.iata}}) {% elif item.type == "train" %} 🚆 {{ item.from }} - → + → + {{ item.to }} + {% elif item.type == "ferry" %} + ⛴️ + {{ item.from }} + → {{ item.to }} {% endif %} @@ -280,7 +285,7 @@ ✨ {{ display_datetime(item.depart) }} {% if item.arrive %} - → + → {{ item.arrive.strftime("%H:%M %z") }} 🕒{{ ((item.arrive - item.depart).total_seconds() // 60) | int }} mins {% endif %} @@ -299,7 +304,7 @@ {% elif item.type == "train" %}
{{ display_datetime(item.depart) }} - → + → {{ item.arrive.strftime("%H:%M %z") }} {% if item.class %} {{ item.class }} @@ -312,6 +317,36 @@ {% endif %}
+ {% elif item.type == "ferry" %} +
+ {{ item.operator }} - {{ item.ferry }} + ✨ + {{ display_datetime(item.depart) }} + → + {{ item.arrive.strftime("%H:%M %z") }} + 🕒{{ ((item.arrive - item.depart).total_seconds() // 60) | int }} mins + {% if item.class %} + {{ item.class }} + {% endif %} +
+ {% if item.vehicle %} +
+ 🚗 Vehicle: {{ item.vehicle.type }} {% if g.user.is_authenticated %}({{ item.vehicle.registration }}) {% endif %} + {% if item.vehicle.extras %} + - Extras: {{ item.vehicle.extras | join(", ") }} + {% endif %} +
+ {% endif %} + {% if g.user.is_authenticated %} +
+ {% if item.booking_reference %} + Booking reference: {{ item.booking_reference }} + {% endif %} + {% if item.price and item.currency %} + Price: {{ item.price }} {{ item.currency }} + {% endif %} +
+ {% endif %} {% endif %}