2024-05-18 11:02:21 +01:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
2025-01-11 21:20:00 +00:00
|
|
|
{% from "macros.html" import trip_link, display_date_no_year, display_date, display_datetime, display_time, format_distance, trip_item with context %}
|
2024-05-18 11:02:21 +01:00
|
|
|
|
2024-05-18 15:43:06 +01:00
|
|
|
{% block title %}{{ heading }} - Edward Betts{% endblock %}
|
2024-05-18 11:02:21 +01:00
|
|
|
|
|
|
|
{% block style %}
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="{{ url_for("static", filename="leaflet/leaflet.css") }}">
|
|
|
|
|
|
|
|
<style>
|
2024-05-20 17:33:53 +01:00
|
|
|
body, html {
|
|
|
|
height: 100%;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
.container-fluid {
|
|
|
|
height: calc(100% - 56px); /* Subtracting the height of the navbar */
|
|
|
|
}
|
|
|
|
.text-content {
|
|
|
|
overflow-y: scroll;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
.map-container {
|
|
|
|
position: sticky;
|
|
|
|
top: 56px; /* Adjust to be below the navbar */
|
|
|
|
height: calc(100vh - 56px); /* Subtracting the height of the navbar */
|
|
|
|
}
|
2024-10-19 19:43:48 +01:00
|
|
|
#map {
|
|
|
|
height: 100%;
|
2024-05-20 17:33:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@media (max-width: 767.98px) {
|
|
|
|
.container-fluid {
|
|
|
|
display: block;
|
|
|
|
height: auto;
|
|
|
|
}
|
|
|
|
.map-container {
|
|
|
|
position: relative;
|
|
|
|
top: 0;
|
|
|
|
height: 50vh; /* Adjust as needed */
|
|
|
|
}
|
|
|
|
.text-content {
|
|
|
|
height: auto;
|
|
|
|
overflow-y: auto;
|
|
|
|
}
|
|
|
|
}
|
2024-05-18 11:02:21 +01:00
|
|
|
</style>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% macro section(heading, item_list) %}
|
2024-10-19 19:43:48 +01:00
|
|
|
{% if item_list %}
|
2024-05-18 11:02:21 +01:00
|
|
|
{% set items = item_list | list %}
|
|
|
|
<div class="heading"><h2>{{ heading }}</h2></div>
|
2024-10-21 09:52:21 +01:00
|
|
|
<p><a href="{{ url_for("trip_stats") }}">Trip statistics</a></p>
|
2024-05-18 11:02:21 +01:00
|
|
|
<p>{{ items | count }} trips</p>
|
2024-05-27 09:16:03 +01:00
|
|
|
|
|
|
|
<div>Total distance: {{ format_distance(total_distance) }}</div>
|
|
|
|
|
|
|
|
{% for transport_type, distance in distances_by_transport_type %}
|
|
|
|
<div>
|
|
|
|
{{ transport_type | title }}
|
|
|
|
distance: {{format_distance(distance) }}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
|
2024-05-18 11:02:21 +01:00
|
|
|
{% for trip in items %}
|
2025-01-11 21:20:00 +00:00
|
|
|
{{ trip_item(trip) }}
|
2024-05-18 11:02:21 +01:00
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="container-fluid d-flex flex-column flex-md-row">
|
|
|
|
<div class="map-container col-12 col-md-6 order-1 order-md-2">
|
2024-10-19 19:43:48 +01:00
|
|
|
<div id="map" class="map"></div>
|
2024-05-18 11:02:21 +01:00
|
|
|
</div>
|
|
|
|
<div class="text-content col-12 col-md-6 order-2 order-md-1 pe-3">
|
|
|
|
{{ section(heading, trips) }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block scripts %}
|
|
|
|
|
|
|
|
<script src="{{ url_for("static", filename="leaflet/leaflet.js") }}"></script>
|
|
|
|
|
|
|
|
<script src="{{ url_for("static", filename="leaflet-geodesic/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 %}
|