Add CO2 breakdown by transport type to trip list and detail pages
Implements bug #194 by adding CO2 emission display by transport type: - Add co2_by_transport_type() method to Trip class - Display CO2 breakdown on trip list page and individual trip items - Display CO2 breakdown on individual trip detail pages - Show both total CO2 and breakdown by transport type (flight/train/ferry) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
af49dac232
commit
a68df381fe
4 changed files with 46 additions and 0 deletions
|
|
@ -351,6 +351,16 @@
|
|||
<div>Total CO₂: {{ "{:,.1f}".format(total_co2_kg) }} kg</div>
|
||||
{% endif %}
|
||||
|
||||
{% set co2_by_transport = trip.co2_by_transport_type() %}
|
||||
{% if co2_by_transport %}
|
||||
{% for transport_type, co2_kg in co2_by_transport %}
|
||||
<div>
|
||||
{{ transport_type | title }}
|
||||
CO₂: {{ "{:,.1f}".format(co2_kg) }} kg
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if trip.schengen_compliance %}
|
||||
<div>
|
||||
<strong>Schengen:</strong>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue