{% extends "base.html" %} {% block title %}{{ trip.title }} ({{ display_date(trip.start) }}) - Edward Betts{% endblock %} {% from "macros.html" import trip_link, display_datetime, display_date_no_year, display_date, display_conf_date_no_year, conference_row, accommodation_row, flight_row, train_row, ferry_row, coach_row, bus_row with context %} {% set row = {"flight": flight_row, "train": train_row, "ferry": ferry_row, "coach": coach_row, "bus": bus_row} %} {% macro trip_duration(depart, arrive) -%} {%- set mins = ((arrive - depart).total_seconds() // 60) | int -%} {%- set h = mins // 60 -%} {%- set m = mins % 60 -%} {%- if h %}{{ h }}h {% endif -%} {%- if m %}{{ m }}m{% elif h %}0m{% endif -%} {%- endmacro %} {% 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 %} {% endif %} {% set conference_column_count = 7 %} {% set accommodation_column_count = 7 %} {% set travel_column_count = 9 %} {% endblock %} {% set end = trip.end %} {% set total_distance = trip.total_distance() %} {% set distances_by_transport_type = trip.distances_by_transport_type() %} {% set total_co2_kg = trip.total_co2_kg() %} {% set co2_by_transport_type = trip.co2_by_transport_type() %} {% block content %}
{{ next_and_previous() }}

{{ trip.title }}

{% if end %} {{ display_date_no_year(trip.start) }} to {{ display_date_no_year(end) }} ({{ (end - trip.start).days }} nights) {% else %} {{ display_date_no_year(trip.start) }} (end date missing) {% endif %}

    {% for location, country in trip.locations() %}
  • {{ country.flag if trip.show_flags }} {{ location }}
  • {% endfor %}
{% if destination_times %}
Destination time zones {% for item in destination_times %} {% endfor %}
Destination Timezone Difference from UK
{{ item.destination_label }} {{ item.timezone or "Unknown" }} {{ item.offset_display }}
{% endif %}
{% if total_distance %} {{ "{:,.0f} km / {:,.0f} mi".format(total_distance, total_distance / 1.60934) }} {% endif %} {% if distances_by_transport_type %} {% for transport_type, distance in distances_by_transport_type %} {{ transport_type | title }}: {{ "{:,.0f} km".format(distance) }} {% endfor %} {% endif %} {% if total_co2_kg %} CO₂ {{ "{:,.1f}".format(total_co2_kg) }} kg {% endif %} {% if co2_by_transport_type %} {% for transport_type, co2_kg in co2_by_transport_type %} {{ transport_type | title }} CO₂ {{ "{:,.1f}".format(co2_kg) }} kg {% endfor %} {% endif %}
{% set delta = human_readable_delta(trip.start) %} {% if delta %}
How long until trip: {{ delta }}
{% endif %} {% if trip.schengen_compliance %}
Schengen Compliance: {% if trip.schengen_compliance.is_compliant %} ✅ Compliant {% else %} ❌ Non-compliant {% endif %}
{{ trip.schengen_compliance.total_days_used }}/90 days used {% if trip.schengen_compliance.is_compliant %} ({{ trip.schengen_compliance.days_remaining }} remaining) {% else %} ({{ trip.schengen_compliance.days_over_limit }} over limit) {% endif %}
{% endif %}
{# ---- Chronological itinerary ---- #} {% for day, day_elements in trip.elements_grouped_by_day() %} {% set weather = trip_weather.get(day.isoformat()) if trip_weather else None %}

{{ display_date_no_year(day) }} {% if weather %} {{ weather.status }} {{ weather.temp_min }}–{{ weather.temp_max }}°C {{ weather.detailed_status }} {% endif %} {% if g.user.is_authenticated and day <= today %} photos {% endif %}

{% for e in day_elements %} {% if e.element_type == "conference" %} {% set item = e.detail %} {% set country = get_country(item.country) if item.country else None %}
{{ item.name }} {{ display_conf_date_no_year(item.attend_start if item.attend_start else item.start) }} to {{ display_conf_date_no_year(item.attend_end if item.attend_end else item.end) }} {% if item.attend_start or item.attend_end %} (full conference: {{ display_date_no_year(item.start) }} to {{ display_date_no_year(item.end) }}) {% endif %}

Topic: {{ item.topic }} Venue: {{ item.venue }} Location: {{ item.location }} {% if country %} {{ country.flag if trip.show_flags }} {% elif item.online %} 💻 Online {% else %} country code {{ item.country }} not found {% endif %} {% if item.free %} free to attend {% elif item.price and item.currency %} price: {{ item.price }} {{ item.currency }} {% endif %}

{% elif e.element_type == "check-in" %} {% set item = e.detail %} {% set country = get_country(item.country) if item.country else None %} {% set nights = (item.to.date() - item.from.date()).days %}
{{ e.get_emoji() }} {{ item.name }} {% if item.operator and item.operator != item.name %}{{ item.operator }}{% endif %} ({% if nights == 1 %}1 night{% else %}{{ nights }} nights{% endif %})

{{ item.location }} {% if country %} {{ country.flag if trip.show_flags }} {% else %} country code {{ item.country }} not found {% endif %} {% if item.address %} · {{ item.address }}{% endif %} {% if g.user.is_authenticated and item.price and item.currency %} {{ item.price }} {{ item.currency }} {% endif %}

{% elif e.element_type == "check-out" %} {% set item = e.detail %}
{{ e.get_emoji() }} Check out: {{ item.name }} {% if item.operator and item.operator != item.name %}{{ item.operator }}{% endif %}
{% elif e.element_type == "flight" %} {% set item = e.detail %} {% set full_flight_number = item.airline_code + item.flight_number %} {% set radarbox_url = "https://www.radarbox.com/data/flights/" + full_flight_number %} {% set is_overnight = item.arrive and item.depart.date() != item.arrive.date() %}
✈️ {{ item.from_airport.name }} ({{ item.from_airport.iata }}) → {{ item.to_airport.name }} ({{ item.to_airport.iata }})
{{ item.airline_name }} {{ full_flight_number }} · {{ item.depart.strftime("%H:%M") }} {% if item.arrive %} → {{ item.arrive.strftime("%H:%M") }}{% if is_overnight %} +1 day{% endif %} 🕒{{ trip_duration(item.depart, item.arrive) }} {% endif %} {% if item.distance %} 🌍 {{ "{:,.0f} km".format(item.distance) }} {% endif %} {% if item.co2_kg is defined and item.co2_kg is not none %} CO₂ {{ "{:,.1f}".format(item.co2_kg) }} kg {% endif %}
{% elif e.element_type == "train" %} {% set item = e.detail %} {% set is_overnight = item.depart.date() != item.arrive.date() %}
{% if is_overnight %}🌙{% else %}🚆{% endif %} {{ item.from }} → {{ item.to }} {% if item.operator %}{{ item.operator }}{% endif %} {% if is_overnight %}Night train{% endif %}

{{ item.depart.strftime("%H:%M") }} → {{ item.arrive.strftime("%H:%M") }}{% if is_overnight %} +1 day{% endif %} {% if item.class %} {{ item.class }} {% endif %} 🕒{{ trip_duration(item.depart, item.arrive) }} {% if item.distance %} 🛤️ {{ "{:,.0f} km".format(item.distance) }} {% endif %} {% if item.co2_kg is defined and item.co2_kg is not none %} CO₂ {{ "{:,.1f}".format(item.co2_kg) }} kg {% endif %} {% if item.coach %} 🛏️ Coach {{ item.coach }}{% if item.seat %}, Seat {% if item.seat is iterable and item.seat is not string %}{{ item.seat | join(" & ") }}{% else %}{{ item.seat }}{% endif %}{% endif %} {% endif %}

{% elif e.element_type in ("coach", "bus") %} {% set item = e.detail %}
🚌 {{ item.from }} → {{ item.to }} {% if item.operator %}{{ item.operator }}{% endif %}

{{ item.depart.strftime("%H:%M") }} → {{ item.arrive.strftime("%H:%M") }} {% if item.class %} {{ item.class }} {% endif %} 🕒{{ trip_duration(item.depart, item.arrive) }} {% if item.distance %} 🛤️ {{ "{:,.0f} km".format(item.distance) }} {% endif %} {% if item.co2_kg is defined and item.co2_kg is not none %} CO₂ {{ "{:,.1f}".format(item.co2_kg) }} kg {% endif %}

{% elif e.element_type == "ferry" %} {% set item = e.detail %}
⛴️ {{ item.from }} → {{ item.to }} {{ item.operator }}{% if item.ferry %} · {{ item.ferry }}{% endif %}

{{ item.depart.strftime("%H:%M") }} → {{ item.arrive.strftime("%H:%M") }} 🕒{{ trip_duration(item.depart, item.arrive) }} {% if item.class %} {{ item.class }} {% endif %} {% if item.co2_kg is defined and item.co2_kg is not none %} CO₂ {{ "{:,.1f}".format(item.co2_kg) }} kg {% 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 %} {% endfor %} {% endfor %} {% if trip.flight_bookings %}

Flight bookings

{% for item in trip.flight_bookings %}
{{ item.flights | map(attribute="airline_name") | unique | join(" + ") }} {% if g.user.is_authenticated and item.booking_reference %} booking reference: {{ item.booking_reference }} {% endif %} {% if g.user.is_authenticated and item.price and item.currency %} price: {{ item.price }} {{ item.currency }} {% endif %}
{% endfor %} {% endif %} {% if trip.events %}

Events

{% for item in trip.events %} {% set country = get_country(item.country) if item.country else None %}
{{ item.title }} {{ display_date_no_year(item.date) }}

Address: {{ item.address }} | Location: {{ item.location }} {% if country %} {{ country.flag if trip.show_flags }} {% else %} country code {{ item.country }} not found {% endif %} {% if g.user.is_authenticated and item.price and item.currency %} | price: {{ item.price }} {{ item.currency }} {% endif %}

{% endfor %} {% endif %}

Holidays

{% if holidays %} {% for item in holidays %} {% set country = get_country(item.country) %} {% if loop.first or item.date != loop.previtem.date %} {% else %} {% endif %} {% endfor %}
{{ display_date(item.date) }}{{ country.flag if trip.show_flags }} {{ country.name }} {{ item.display_name }}
{% else %}

No public holidays during trip.

{% endif %}

UK school holidays (Bristol)

{% if school_holidays %} {% for item in school_holidays %} {% endfor %}
{{ display_date(item.as_date) }} to {{ display_date(item.end_as_date) }} {{ item.title }}
{% else %}

No UK school holidays during trip.

{% endif %}
{{ next_and_previous() }}
{% endblock %} {% block scripts %} {% endblock %}