2024-06-16 11:31:23 +01:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% from "macros.html" import format_distance with context %}
|
|
|
|
|
|
|
|
{% set heading = "Trip statistics" %}
|
|
|
|
|
|
|
|
{% block title %}{{ heading }} - Edward Betts{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2024-06-17 16:28:45 +01:00
|
|
|
<div class="container-fluid">
|
2024-06-16 11:31:23 +01:00
|
|
|
<h1>Trip statistics</h1>
|
|
|
|
<div>Trips: {{ count }}</div>
|
2024-07-10 19:28:56 +01:00
|
|
|
<div>Conferences: {{ conferences }}</div>
|
2024-06-16 11:31:23 +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 %}
|
|
|
|
|
|
|
|
{% for year, year_stats in yearly_stats | dictsort %}
|
2024-06-17 16:10:07 +01:00
|
|
|
{% set countries = year_stats.countries | sort(attribute="name") %}
|
2024-06-16 11:31:23 +01:00
|
|
|
<h4>{{ year }}</h4>
|
|
|
|
<div>Trips in {{ year }}: {{ year_stats.count }}</div>
|
2024-07-10 19:28:56 +01:00
|
|
|
<div>Conferences in {{ year }}: {{ year_stats.conferences }}</div>
|
2024-06-17 16:10:07 +01:00
|
|
|
<div>{{ countries | count }} countries visited in {{ year }}:
|
|
|
|
{% for c in countries %}
|
2024-06-17 16:28:45 +01:00
|
|
|
<span class="text-nowrap">{{ c.flag }} {{ c.name }}</span>
|
2024-06-17 16:10:07 +01:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2024-11-10 21:02:37 +00:00
|
|
|
<div>
|
2024-12-12 20:47:21 +00:00
|
|
|
Flight segments in {{ year }}: {{ year_stats.flight_count or 0 }}
|
|
|
|
{% if year_stats.airlines %}
|
2024-11-10 21:02:37 +00:00
|
|
|
[ by airline:
|
2024-12-12 20:47:21 +00:00
|
|
|
{% for airline, count in year_stats.airlines.most_common() %}
|
|
|
|
{{ airline }}: {{ count }}{% if not loop.last %},{% endif %}
|
|
|
|
{% endfor %} ]
|
|
|
|
{% endif %}
|
2024-11-10 21:02:37 +00:00
|
|
|
</div>
|
2024-12-12 20:47:21 +00:00
|
|
|
<div>Trains segments in {{ year }}: {{ year_stats.train_count or 0 }}</div>
|
|
|
|
<div>Total distance in {{ year}}: {{ format_distance(year_stats.total_distance or 0) }}</div>
|
|
|
|
{% if year_stats.distances_by_transport_type %}
|
2024-06-16 11:31:23 +01:00
|
|
|
{% for transport_type, distance in year_stats.distances_by_transport_type.items() %}
|
|
|
|
<div>
|
|
|
|
{{ transport_type | title }}
|
|
|
|
distance: {{format_distance(distance) }}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2024-12-12 20:47:21 +00:00
|
|
|
{% endif %}
|
2024-06-16 11:31:23 +01:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|