{% extends "base.html" %} {% from "macros.html" import format_distance with context %} {% set heading = "Trip statistics" %} {% block title %}{{ heading }} - Edward Betts{% endblock %} {% block content %}

Trip statistics

Trips: {{ count }}
Conferences: {{ conferences }}
Total distance: {{ format_distance(total_distance) }}
{% for transport_type, distance in distances_by_transport_type %}
{{ transport_type | title }} distance: {{format_distance(distance) }}
{% endfor %} {% for year, year_stats in yearly_stats | dictsort %} {% set countries = year_stats.countries | sort(attribute="name") %}

{{ year }}

Trips in {{ year }}: {{ year_stats.count }}
Conferences in {{ year }}: {{ year_stats.conferences }}
{{ countries | count }} countries visited in {{ year }}: {% for c in countries %} {{ c.flag }} {{ c.name }} {% endfor %}
Flight segments in {{ year }}: {{ year_stats.flight_count or 0 }} {% if year_stats.airlines %} [ by airline: {% for airline, count in year_stats.airlines.most_common() %} {{ airline }}: {{ count }}{% if not loop.last %},{% endif %} {% endfor %} ] {% endif %}
Trains segments in {{ year }}: {{ year_stats.train_count or 0 }}
Total distance in {{ year}}: {{ format_distance(year_stats.total_distance or 0) }}
{% if year_stats.distances_by_transport_type %} {% for transport_type, distance in year_stats.distances_by_transport_type.items() %}
{{ transport_type | title }} distance: {{format_distance(distance) }}
{% endfor %} {% endif %} {% endfor %}
{% endblock %}