209 lines
6 KiB
HTML
209 lines
6 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}{{ trip.title }} ({{ display_date(trip.start) }}){% endblock %}
|
|
|
|
{% from "macros.html" import trip_link, display_date_no_year, display_date, conference_row, accommodation_row, flight_row, train_row with context %}
|
|
|
|
{% 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 %}
|
|
|
|
{% if coordinates %}
|
|
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
|
|
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
|
|
crossorigin=""/>
|
|
{% endif %}
|
|
|
|
{% set conference_column_count = 7 %}
|
|
{% set accommodation_column_count = 7 %}
|
|
{% set travel_column_count = 8 %}
|
|
<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 */
|
|
}
|
|
|
|
#map {
|
|
height: 90vh;
|
|
}
|
|
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% set end = trip.end %}
|
|
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="col m-3">
|
|
{{ next_and_previous() }}
|
|
<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>
|
|
|
|
<div class="mb-3">
|
|
<div>Countries: {{ trip.countries_str }}</div>
|
|
|
|
{% set delta = human_readable_delta(trip.start) %}
|
|
{% if delta %}
|
|
<div>How long until trip: {{ delta }}</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% 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">
|
|
Topic: {{ item.topic }}
|
|
| Venue: {{ item.venue }}
|
|
| Location: {{ item.location }}
|
|
{% 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 %}
|
|
| <span class="badge bg-success text-nowrap">free to attend</span>
|
|
{% elif item.price and item.currency %}
|
|
| <span class="badge bg-info text-nowrap">price: {{ item.price }} {{ item.currency }}</span>
|
|
{% 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">
|
|
Address: {{ item.address }}
|
|
| Location: {{ item.location }}
|
|
{% 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.price and item.currency %}
|
|
| <span class="badge bg-info text-nowrap">price: {{ item.price }} {{ item.currency }}</span>
|
|
{% endif %}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
<div class="travel">
|
|
{% for item in trip.travel %} {{ row[item.type](item) }} {% endfor %}
|
|
</div>
|
|
|
|
<div class="mt-3">
|
|
<h4>Holidays</h4>
|
|
{% if holidays %}
|
|
|
|
<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>
|
|
{% else %}
|
|
<p>No public holidays during trip.</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{{ next_and_previous() }}
|
|
|
|
</div>
|
|
<div class="col">
|
|
<div id="map"></div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
|
|
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
|
|
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
|
|
crossorigin=""></script>
|
|
|
|
<script src="https://unpkg.com/leaflet.geodesic@2.7.1/dist/leaflet.geodesic.umd.min.js"></script>
|
|
|
|
<script src="{{ url_for("static", filename="js/map.js") }}"></script>
|
|
|
|
<script>
|
|
var coordinates = {{ coordinates | tojson }};
|
|
var routes = {{ routes | tojson }};
|
|
|
|
build_map("map", coordinates, routes);
|
|
|
|
</script>
|
|
{% endblock %}
|