Travel stats: distance and price by year and travel type

Closes: #155
This commit is contained in:
Edward Betts 2024-06-16 11:31:23 +01:00
parent 12a2b739e8
commit 1e14a99419
3 changed files with 77 additions and 1 deletions

View file

@ -48,11 +48,12 @@
{% endblock %}
{% macro section(heading, item_list) %}
{% if item_list %}
{% set items = item_list | list %}
<div class="heading"><h2>{{ heading }}</h2></div>
<p><a href="{{ url_for("trip_stats") }}">Trip statistics</a></p>
<p>{{ items | count }} trips</p>
{% if item_list %}
<div>Total distance: {{ format_distance(total_distance) }}</div>
{% for transport_type, distance in distances_by_transport_type %}