Add overall airline, airport, and station stats to trip summary
Aggregate yearly stats into overall totals so the trip stats page shows flight segments by airline, airports used, and stations used in the summary section at the top. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bc5e595bb0
commit
523dc78b35
4 changed files with 59 additions and 0 deletions
|
|
@ -811,6 +811,7 @@ def trip_stats() -> str:
|
|||
yearly_stats = agenda.stats.calculate_yearly_stats(
|
||||
trip_list, app.config.get("PREVIOUSLY_VISITED")
|
||||
)
|
||||
overall_stats = agenda.stats.calculate_overall_stats(yearly_stats)
|
||||
|
||||
return flask.render_template(
|
||||
"trip/stats.html",
|
||||
|
|
@ -818,6 +819,7 @@ def trip_stats() -> str:
|
|||
total_distance=calc_total_distance(trip_list),
|
||||
distances_by_transport_type=sum_distances_by_transport_type(trip_list),
|
||||
yearly_stats=yearly_stats,
|
||||
overall_stats=overall_stats,
|
||||
conferences=conferences,
|
||||
previously_visited=app.config.get("PREVIOUSLY_VISITED", set),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue