diff --git a/templates/trip/stats.html b/templates/trip/stats.html index 6fe8a18..bbfa044 100644 --- a/templates/trip/stats.html +++ b/templates/trip/stats.html @@ -7,7 +7,7 @@ {% block title %}{{ heading }} - Edward Betts{% endblock %} {% block content %} -
+

Trip statistics

Trips: {{ count }}
Total distance: {{ format_distance(total_distance) }}
@@ -25,11 +25,9 @@
Trips in {{ year }}: {{ year_stats.count }}
{{ countries | count }} countries visited in {{ year }}: {% for c in countries %} - {{ c.flag }} {{ c.name }} + {{ c.flag }} {{ c.name }} {% endfor %}
-
Flights in {{ year }}: {{ year_stats.flight_count }}
-
Trains in {{ year }}: {{ year_stats.train_count }}
Total distance in {{ year}}: {{ format_distance(year_stats.total_distance) }}
{% for transport_type, distance in year_stats.distances_by_transport_type.items() %}
diff --git a/web_view.py b/web_view.py index 8c81927..76440f7 100755 --- a/web_view.py +++ b/web_view.py @@ -547,13 +547,6 @@ def calculate_yearly_stats(trips: list[Trip]) -> dict[int, StrDict]: for country in trip.countries: yearly_stats[year].setdefault("countries", set()) yearly_stats[year]["countries"].add(country) - for leg in trip.travel: - if leg["type"] == "flight": - yearly_stats[year].setdefault("flight_count", 0) - yearly_stats[year]["flight_count"] += 1 - if leg["type"] == "train": - yearly_stats[year].setdefault("train_count", 0) - yearly_stats[year]["train_count"] += 1 return dict(yearly_stats)