diff --git a/agenda/types.py b/agenda/types.py index b1bca73..d150db6 100644 --- a/agenda/types.py +++ b/agenda/types.py @@ -2,7 +2,6 @@ import datetime import typing -from collections import Counter from dataclasses import dataclass, field from pycountry.db import Country @@ -142,25 +141,6 @@ class Trip: else None ) - def distances_by_transport_type(self) -> list[tuple[str, float]]: - """Calculate the total distance travelled for each type of transport. - - Any travel item with a missing or None 'distance' field is ignored. - """ - transport_distances: Counter[float] = Counter() - - for item in self.travel: - distance = item.get("distance") - if distance: - transport_type = item.get("type", "unknown") - transport_distances[transport_type] += distance - - return list(transport_distances.items()) - - -# Example usage: -# You would call the function with your travel list here to get the results. - @dataclass class Holiday: diff --git a/templates/trip_page.html b/templates/trip_page.html index afe8321..0c1d05a 100644 --- a/templates/trip_page.html +++ b/templates/trip_page.html @@ -61,7 +61,6 @@ {% set end = trip.end %} {% set total_distance = trip.total_distance() %} -{% set distances_by_transport_type = trip.distances_by_transport_type() %} {% block content %}
| {{ display_date(item.date) }} | - {% else %} -- {% endif %} - | {{ country.flag }} {{ country.name }} | -{{ item.display_name }} | -
| {{ display_date(item.date) }} | + {% else %} ++ {% endif %} + | {{ country.flag }} {{ country.name }} | +{{ item.display_name }} | +
No public holidays during trip.
+No public holidays during trip.
{% endif %}