{% 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 }}
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 %}

{{ year }}

Trips in {{ year }}: {{ year_stats.count }}
Total distance in {{ year}}: {{ format_distance(year_stats.total_distance) }}
{% for transport_type, distance in year_stats.distances_by_transport_type.items() %}
{{ transport_type | title }} distance: {{format_distance(distance) }}
{% endfor %} {% endfor %}
{% endblock %}