2024-01-12 14:04:06 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
2024-04-16 22:01:16 +01:00
|
|
|
{% block title %}{{ trip.title }} ({{ display_date(trip.start) }}) - Edward Betts{% endblock %}
|
2024-01-17 20:56:42 +00:00
|
|
|
|
2024-01-30 11:07:28 +00:00
|
|
|
{% from "macros.html" import trip_link, display_datetime, display_date_no_year, display_date, conference_row, accommodation_row, flight_row, train_row with context %}
|
2024-01-12 14:04:06 +00:00
|
|
|
|
|
|
|
{% set row = { "flight": flight_row, "train": train_row } %}
|
|
|
|
|
2024-01-23 16:28:20 +00:00
|
|
|
{% 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 %}
|
|
|
|
|
2024-01-12 14:04:06 +00:00
|
|
|
{% block style %}
|
2024-01-12 15:04:08 +00:00
|
|
|
|
2024-01-12 16:54:52 +00:00
|
|
|
{% if coordinates %}
|
2024-03-30 10:18:21 +00:00
|
|
|
<link rel="stylesheet" href="{{ url_for("static", filename="leaflet/leaflet.css") }}">
|
2024-01-12 15:04:08 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2024-01-16 20:43:28 +00:00
|
|
|
{% set conference_column_count = 7 %}
|
2024-01-12 14:04:06 +00:00
|
|
|
{% set accommodation_column_count = 7 %}
|
2024-04-05 14:58:44 +01:00
|
|
|
{% set travel_column_count = 9 %}
|
2024-01-12 14:04:06 +00:00
|
|
|
<style>
|
|
|
|
.conferences {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat({{ conference_column_count }}, auto); /* 7 columns for each piece of information */
|
|
|
|
gap: 10px;
|
|
|
|
justify-content: start;
|
|
|
|
}
|
|
|
|
|
|
|
|
.accommodation {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat({{ accommodation_column_count }}, auto);
|
|
|
|
gap: 10px;
|
|
|
|
justify-content: start;
|
|
|
|
}
|
|
|
|
|
|
|
|
.travel {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat({{ travel_column_count }}, auto);
|
|
|
|
gap: 10px;
|
|
|
|
justify-content: start;
|
|
|
|
}
|
|
|
|
|
|
|
|
.grid-item {
|
|
|
|
/* Additional styling for grid items can go here */
|
|
|
|
}
|
2024-01-12 15:04:08 +00:00
|
|
|
|
2024-10-13 10:12:39 +01:00
|
|
|
.half-map {
|
|
|
|
height: 100vh;
|
|
|
|
}
|
|
|
|
|
|
|
|
.full-window-map {
|
|
|
|
position: fixed; /* Make the map fixed position */
|
|
|
|
top: 56px;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
z-index: 9999; /* Make sure it sits on top */
|
|
|
|
}
|
|
|
|
|
|
|
|
#toggleMapSize {
|
|
|
|
position: fixed; /* Fixed position */
|
|
|
|
top: 66px; /* 10px from the top */
|
|
|
|
right: 10px; /* 10px from the right */
|
|
|
|
z-index: 10000; /* Higher than the map's z-index */
|
2024-01-12 15:04:08 +00:00
|
|
|
}
|
|
|
|
|
2024-01-12 14:04:06 +00:00
|
|
|
</style>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% set end = trip.end %}
|
2024-04-06 15:13:07 +01:00
|
|
|
{% set total_distance = trip.total_distance() %}
|
2024-04-16 12:41:00 +01:00
|
|
|
{% set distances_by_transport_type = trip.distances_by_transport_type() %}
|
2024-01-12 14:04:06 +00:00
|
|
|
|
|
|
|
{% block content %}
|
2024-01-23 15:55:28 +00:00
|
|
|
<div class="row">
|
2024-02-19 09:46:57 +00:00
|
|
|
<div class="col-md-6 col-sm-12">
|
|
|
|
<div class="m-3">
|
2024-01-23 16:28:20 +00:00
|
|
|
{{ next_and_previous() }}
|
2024-01-23 15:55:28 +00:00
|
|
|
<h1>{{ trip.title }}</h1>
|
|
|
|
<p class="lead">
|
|
|
|
{% 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 %}
|
|
|
|
</p>
|
2024-01-12 14:04:06 +00:00
|
|
|
|
2024-01-23 15:55:28 +00:00
|
|
|
<div class="mb-3">
|
2024-01-30 11:07:28 +00:00
|
|
|
{# <div>Countries: {{ trip.countries_str }}</div> #}
|
|
|
|
<div>Locations: {{ trip.locations_str }}</div>
|
2024-01-12 14:04:06 +00:00
|
|
|
|
2024-04-06 15:13:07 +01:00
|
|
|
{% if total_distance %}
|
|
|
|
<div>Total distance:
|
|
|
|
{{ "{:,.0f} km / {:,.0f} miles".format(total_distance, total_distance / 1.60934) }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2024-04-16 12:41:00 +01:00
|
|
|
{% if distances_by_transport_type %}
|
|
|
|
{% for transport_type, distance in distances_by_transport_type %}
|
|
|
|
<div>{{ transport_type | title }} distance:
|
|
|
|
{{ "{:,.0f} km / {:,.0f} miles".format(distance, distance / 1.60934) }}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
|
2024-04-06 15:13:07 +01:00
|
|
|
|
2024-01-23 15:55:28 +00:00
|
|
|
{% set delta = human_readable_delta(trip.start) %}
|
|
|
|
{% if delta %}
|
|
|
|
<div>How long until trip: {{ delta }}</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2024-01-12 14:04:06 +00:00
|
|
|
|
2024-01-23 15:55:28 +00:00
|
|
|
{% for item in trip.conferences %}
|
|
|
|
{% set country = get_country(item.country) if item.country else None %}
|
|
|
|
<div class="card my-1">
|
|
|
|
<div class="card-body">
|
|
|
|
<h5 class="card-title">
|
|
|
|
<a href="{{ item.url }}">{{ item.name }}</a>
|
|
|
|
<small class="text-muted">
|
|
|
|
{{ display_date_no_year(item.start) }} to {{ display_date_no_year(item.end) }}
|
|
|
|
</small>
|
|
|
|
</h5>
|
|
|
|
<p class="card-text">
|
2024-06-20 12:40:26 +01:00
|
|
|
<strong>Topic:</strong> {{ item.topic }}
|
|
|
|
<strong>Venue:</strong> {{ item.venue }}
|
|
|
|
<strong>Location:</strong> {{ item.location }}
|
2024-01-23 15:55:28 +00:00
|
|
|
{% if country %}
|
|
|
|
{{ country.flag }}
|
|
|
|
{% elif item.online %}
|
|
|
|
💻 Online
|
|
|
|
{% else %}
|
|
|
|
<span class="text-bg-danger p-2">
|
|
|
|
country code <strong>{{ item.country }}</strong> not found
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
|
|
|
{% if item.free %}
|
2024-06-20 12:40:26 +01:00
|
|
|
<span class="badge bg-success text-nowrap">free to attend</span>
|
2024-01-23 15:55:28 +00:00
|
|
|
{% elif item.price and item.currency %}
|
2024-06-20 12:40:26 +01:00
|
|
|
<span class="badge bg-info text-nowrap">price: {{ item.price }} {{ item.currency }}</span>
|
2024-01-23 15:55:28 +00:00
|
|
|
{% endif %}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{% for item in trip.accommodation %}
|
|
|
|
{% set country = get_country(item.country) if item.country else None %}
|
|
|
|
{% set nights = (item.to.date() - item.from.date()).days %}
|
|
|
|
<div class="card my-1">
|
|
|
|
<div class="card-body">
|
|
|
|
<h5 class="card-title">
|
|
|
|
{% if item.operator %}{{ item.operator }}: {% endif %}
|
|
|
|
<a href="{{ item.url }}">{{ item.name }}</a>
|
|
|
|
<small class="text-muted">
|
|
|
|
{{ display_date_no_year(item.from) }} to {{ display_date_no_year(item.to) }}
|
|
|
|
({% if nights == 1 %}1 night{% else %}{{ nights }} nights{% endif %})
|
|
|
|
</small>
|
|
|
|
</h5>
|
|
|
|
<p class="card-text">
|
2024-06-20 12:40:26 +01:00
|
|
|
<strong>Address:</strong> {{ item.address }}
|
|
|
|
<strong>Location:</strong> {{ item.location }}
|
2024-01-23 15:55:28 +00:00
|
|
|
{% if country %}
|
|
|
|
{{ country.flag }}
|
2024-01-24 12:03:56 +00:00
|
|
|
{% else %}
|
|
|
|
<span class="text-bg-danger p-2">
|
|
|
|
country code <strong>{{ item.country }}</strong> not found
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
2024-03-05 07:01:17 +00:00
|
|
|
{% if g.user.is_authenticated and item.price and item.currency %}
|
2024-06-20 12:40:26 +01:00
|
|
|
<span class="badge bg-info text-nowrap">price: {{ item.price }} {{ item.currency }}</span>
|
2024-01-24 12:03:56 +00:00
|
|
|
{% endif %}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
|
2024-06-20 12:40:26 +01:00
|
|
|
{% if trip.flight_bookings %}
|
|
|
|
<h3>Flight bookings</h3>
|
|
|
|
{% for item in trip.flight_bookings %}
|
|
|
|
<div>
|
|
|
|
{{ item.flights | map(attribute="airline_name") | unique | join(" + ") }}
|
|
|
|
{% if g.user.is_authenticated and item.booking_reference %}
|
|
|
|
<strong>booking reference:</strong> {{ item.booking_reference }}
|
|
|
|
{% endif %}
|
|
|
|
{% if g.user.is_authenticated and item.price and item.currency %}
|
|
|
|
<span class="badge bg-info text-nowrap">price: {{ item.price }} {{ item.currency }}</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
|
2024-01-24 12:03:56 +00:00
|
|
|
{% for item in trip.events %}
|
|
|
|
{% set country = get_country(item.country) if item.country else None %}
|
|
|
|
<div class="card my-1">
|
|
|
|
<div class="card-body">
|
|
|
|
<h5 class="card-title">
|
|
|
|
<a href="{{ item.url }}">{{ item.title }}</a>
|
|
|
|
<small class="text-muted">{{ display_date_no_year(item.date) }}</small>
|
|
|
|
</h5>
|
|
|
|
<p class="card-text">
|
|
|
|
Address: {{ item.address }}
|
|
|
|
| Location: {{ item.location }}
|
|
|
|
{% if country %}
|
|
|
|
{{ country.flag }}
|
2024-01-23 15:55:28 +00:00
|
|
|
{% else %}
|
|
|
|
<span class="text-bg-danger p-2">
|
|
|
|
country code <strong>{{ item.country }}</strong> not found
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
2024-03-05 07:01:17 +00:00
|
|
|
{% if g.user.is_authenticated and item.price and item.currency %}
|
2024-01-23 15:55:28 +00:00
|
|
|
| <span class="badge bg-info text-nowrap">price: {{ item.price }} {{ item.currency }}</span>
|
|
|
|
{% endif %}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
|
2024-01-30 11:07:28 +00:00
|
|
|
{% for item in trip.travel %}
|
|
|
|
<div class="card my-1">
|
|
|
|
<div class="card-body">
|
|
|
|
<h5 class="card-title">
|
|
|
|
{% 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 }}
|
|
|
|
{% endif %}
|
|
|
|
</h5>
|
|
|
|
<p class="card-text">
|
|
|
|
{% if item.type == "flight" %}
|
|
|
|
<div>
|
|
|
|
<span>{{ item.airline_name }} ({{ item.airline }})</span>
|
|
|
|
✨
|
|
|
|
{{ display_datetime(item.depart) }}
|
2024-03-12 15:10:17 +00:00
|
|
|
{% if item.arrive %}
|
2024-01-30 11:07:28 +00:00
|
|
|
→
|
|
|
|
{{ item.arrive.strftime("%H:%M %z") }}
|
2024-04-06 15:13:07 +01:00
|
|
|
<span>🕒{{ ((item.arrive - item.depart).total_seconds() // 60) | int }} mins</span>
|
2024-03-12 15:10:17 +00:00
|
|
|
{% endif %}
|
2024-01-30 11:07:28 +00:00
|
|
|
✨
|
|
|
|
<span>{{ item.airline }}{{ item.flight_number }}</span>
|
2024-04-06 15:13:07 +01:00
|
|
|
|
|
|
|
{% if item.distance %}
|
|
|
|
<span>
|
|
|
|
🌍distance:
|
|
|
|
{{ "{:,.0f} km / {:,.0f} miles".format(item.distance, item.distance / 1.60934) }}
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
2024-01-30 11:07:28 +00:00
|
|
|
</div>
|
|
|
|
{% elif item.type == "train" %}
|
|
|
|
<div>
|
|
|
|
{{ display_datetime(item.depart) }}
|
|
|
|
→
|
|
|
|
{{ item.arrive.strftime("%H:%M %z") }}
|
|
|
|
{% if item.class %}
|
|
|
|
<span class="badge bg-info text-nowrap">{{ item.class }}</span>
|
|
|
|
{% endif %}
|
2024-04-06 15:13:07 +01:00
|
|
|
<span>🕒{{ ((item.arrive - item.depart).total_seconds() // 60) | int }} mins</span>
|
|
|
|
{% if item.distance %}
|
|
|
|
<span>
|
|
|
|
🛤️
|
|
|
|
{{ "{:,.0f} km / {:,.0f} miles".format(item.distance, item.distance / 1.60934) }}
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
2024-01-30 11:07:28 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2024-01-16 18:08:50 +00:00
|
|
|
|
2024-01-23 15:55:28 +00:00
|
|
|
<div class="mt-3">
|
|
|
|
<h4>Holidays</h4>
|
|
|
|
{% if holidays %}
|
2024-04-16 12:12:19 +01:00
|
|
|
<table class="table table-hover w-auto">
|
|
|
|
{% for item in holidays %}
|
|
|
|
{% set country = get_country(item.country) %}
|
|
|
|
<tr>
|
|
|
|
{% if loop.first or item.date != loop.previtem.date %}
|
|
|
|
<td class="text-end">{{ display_date(item.date) }}</td>
|
|
|
|
{% else %}
|
|
|
|
<td></td>
|
|
|
|
{% endif %}
|
|
|
|
<td>{{ country.flag }} {{ country.name }}</td>
|
|
|
|
<td>{{ item.display_name }}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
2024-01-23 15:55:28 +00:00
|
|
|
{% else %}
|
2024-04-16 12:12:19 +01:00
|
|
|
<p>No public holidays during trip.</p>
|
2024-01-14 12:35:15 +00:00
|
|
|
{% endif %}
|
2024-01-23 15:55:28 +00:00
|
|
|
</div>
|
2024-01-14 12:29:39 +00:00
|
|
|
|
2024-01-23 16:28:20 +00:00
|
|
|
{{ next_and_previous() }}
|
2024-01-12 14:04:06 +00:00
|
|
|
|
2024-01-23 15:55:28 +00:00
|
|
|
</div>
|
2024-02-19 09:46:57 +00:00
|
|
|
</div>
|
|
|
|
<div class="col-md-6 col-sm-12">
|
2024-10-13 10:12:39 +01:00
|
|
|
<button id="toggleMapSize" class="btn btn-primary mb-2">Toggle map size</button>
|
|
|
|
<div id="map" class="half-map">
|
|
|
|
</div>
|
2024-01-23 15:55:28 +00:00
|
|
|
</div>
|
2024-01-12 14:04:06 +00:00
|
|
|
</div>
|
|
|
|
{% endblock %}
|
2024-01-12 15:04:08 +00:00
|
|
|
|
|
|
|
{% block scripts %}
|
|
|
|
|
2024-03-30 10:18:21 +00:00
|
|
|
<script src="{{ url_for("static", filename="leaflet/leaflet.js") }}"></script>
|
|
|
|
<script src="{{ url_for("static", filename="leaflet-geodesic/leaflet.geodesic.umd.min.js") }}"></script>
|
2024-01-14 15:42:48 +00:00
|
|
|
|
2024-01-14 12:01:33 +00:00
|
|
|
<script src="{{ url_for("static", filename="js/map.js") }}"></script>
|
|
|
|
|
2024-01-12 15:04:08 +00:00
|
|
|
<script>
|
2024-01-12 16:54:52 +00:00
|
|
|
var coordinates = {{ coordinates | tojson }};
|
2024-01-12 17:17:12 +00:00
|
|
|
var routes = {{ routes | tojson }};
|
2024-01-12 15:04:08 +00:00
|
|
|
|
2024-01-14 12:01:33 +00:00
|
|
|
build_map("map", coordinates, routes);
|
2024-01-12 17:17:12 +00:00
|
|
|
|
2024-01-12 15:04:08 +00:00
|
|
|
</script>
|
|
|
|
{% endblock %}
|