2024-01-04 22:57:05 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
2024-01-14 17:23:50 +00:00
|
|
|
{% from "macros.html" import trip_link, display_date_no_year, display_date, conference_row, accommodation_row, flight_row, train_row with context %}
|
2024-01-04 22:57:05 +00:00
|
|
|
|
2024-01-06 09:17:34 +00:00
|
|
|
{% set row = { "flight": flight_row, "train": train_row } %}
|
|
|
|
|
2024-04-16 22:01:16 +01:00
|
|
|
{% block title %}Trips - Edward Betts{% endblock %}
|
|
|
|
|
2024-01-04 22:57:05 +00:00
|
|
|
{% block style %}
|
2024-01-14 10:31:51 +00:00
|
|
|
|
2024-03-30 10:18:21 +00:00
|
|
|
<link rel="stylesheet" href="{{ url_for("static", filename="leaflet/leaflet.css") }}">
|
2024-01-14 10:31:51 +00:00
|
|
|
|
2024-01-16 20:43:28 +00:00
|
|
|
{% set conference_column_count = 7 %}
|
2024-01-04 22:57:05 +00:00
|
|
|
{% set accommodation_column_count = 7 %}
|
2024-04-05 14:58:44 +01:00
|
|
|
{% set travel_column_count = 9 %}
|
2024-01-04 22:57:05 +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-14 10:31:51 +00:00
|
|
|
|
2024-01-14 12:17:22 +00:00
|
|
|
.map {
|
2024-01-14 10:31:51 +00:00
|
|
|
height: 80vh;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-04 22:57:05 +00:00
|
|
|
</style>
|
|
|
|
{% endblock %}
|
|
|
|
|
2024-01-06 09:17:34 +00:00
|
|
|
{% macro section(heading, item_list, badge) %}
|
|
|
|
{% if item_list %}
|
2024-01-06 15:39:46 +00:00
|
|
|
{% set items = item_list | list %}
|
2024-01-06 09:17:34 +00:00
|
|
|
<div class="heading"><h2>{{ heading }}</h2></div>
|
2024-01-06 15:39:46 +00:00
|
|
|
<p>{{ items | count }} trips</p>
|
|
|
|
{% for trip in items %}
|
2024-04-06 08:24:10 +01:00
|
|
|
{% set total_distance = trip.total_distance() %}
|
2024-01-06 09:17:34 +00:00
|
|
|
{% set end = trip.end %}
|
|
|
|
<div class="border border-2 rounded mb-2 p-2">
|
2024-01-12 14:04:06 +00:00
|
|
|
<h3>
|
2024-01-14 17:23:50 +00:00
|
|
|
{{ trip_link(trip) }}
|
2024-01-12 14:04:06 +00:00
|
|
|
<small class="text-muted">({{ display_date(trip.start) }})</small></h3>
|
2024-01-06 09:17:34 +00:00
|
|
|
<div>Countries: {{ trip.countries_str }}</div>
|
|
|
|
{% if end %}
|
|
|
|
<div>Dates: {{ display_date_no_year(trip.start) }} to {{ display_date_no_year(end) }}</div>
|
|
|
|
{% else %}
|
|
|
|
<div>Start: {{ display_date_no_year(trip.start) }} (end date missing)</div>
|
|
|
|
{% endif %}
|
2024-04-06 08:24:10 +01:00
|
|
|
{% if total_distance %}
|
|
|
|
<div>Total distance:
|
|
|
|
{{ "{:,.0f} km / {:,.0f} miles".format(total_distance, total_distance / 1.60934) }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2024-01-06 09:17:34 +00:00
|
|
|
<div class="conferences">
|
|
|
|
{% for conf in trip.conferences %}
|
|
|
|
{{ conference_row(conf, "going") }}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2024-01-04 22:57:05 +00:00
|
|
|
|
2024-01-06 09:17:34 +00:00
|
|
|
<div class="accommodation">
|
|
|
|
{% for conf in trip.accommodation %}
|
|
|
|
{{ accommodation_row(conf, "going") }}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2024-01-04 22:57:05 +00:00
|
|
|
|
2024-01-06 09:17:34 +00:00
|
|
|
<div class="travel">
|
|
|
|
{% for item in trip.travel %}
|
|
|
|
{{ row[item.type](item) }}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2024-01-04 22:57:05 +00:00
|
|
|
</div>
|
2024-01-06 09:17:34 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
2024-01-04 22:57:05 +00:00
|
|
|
|
|
|
|
|
2024-01-06 09:17:34 +00:00
|
|
|
{% block content %}
|
|
|
|
<div class="p-2">
|
|
|
|
|
|
|
|
|
|
|
|
<h1>Trips</h1>
|
2024-01-17 12:41:45 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-1">
|
|
|
|
</div>
|
|
|
|
<div class="col-11">
|
|
|
|
<div id="future-map" class="map"></div>
|
|
|
|
</div>
|
2024-01-06 09:17:34 +00:00
|
|
|
{{ section("Current", current, "attending") }}
|
|
|
|
{{ section("Future", future, "going") }}
|
2024-01-17 12:41:45 +00:00
|
|
|
<div class="col-1">
|
|
|
|
</div>
|
|
|
|
<div class="col-11">
|
|
|
|
<div id="past-map" class="map"></div>
|
|
|
|
</div>
|
2024-01-06 09:17:34 +00:00
|
|
|
{{ section("Past", past|reverse, "went") }}
|
2024-01-04 22:57:05 +00:00
|
|
|
</div>
|
2024-01-14 10:31:51 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block scripts %}
|
|
|
|
|
2024-03-30 10:18:21 +00:00
|
|
|
<script src="{{ url_for("static", filename="leaflet/leaflet.js") }}"></script>
|
2024-01-14 10:31:51 +00:00
|
|
|
|
2024-03-30 10:18:21 +00:00
|
|
|
<script src="{{ url_for("static", filename="leaflet-geodesic/leaflet.geodesic.umd.min.js") }}"></script>
|
2024-01-14 12:01:33 +00:00
|
|
|
<script src="{{ url_for("static", filename="js/map.js") }}"></script>
|
|
|
|
|
2024-01-14 10:31:51 +00:00
|
|
|
<script>
|
|
|
|
var future_coordinates = {{ future_coordinates | tojson }};
|
|
|
|
var future_routes = {{ future_routes | tojson }};
|
|
|
|
|
2024-01-14 12:17:22 +00:00
|
|
|
build_map("future-map", future_coordinates, future_routes);
|
|
|
|
|
|
|
|
var past_coordinates = {{ past_coordinates | tojson }};
|
|
|
|
var past_routes = {{ past_routes | tojson }};
|
|
|
|
|
|
|
|
build_map("past-map", past_coordinates, past_routes);
|
2024-01-04 22:57:05 +00:00
|
|
|
|
2024-01-14 10:31:51 +00:00
|
|
|
</script>
|
2024-01-04 22:57:05 +00:00
|
|
|
{% endblock %}
|