From af49dac232681a35a6c4ba9d381c013617fe7269 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 15 Jul 2025 16:32:59 +0200 Subject: [PATCH] Add new country count display to trip statistics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Show the number of new countries visited each year in parentheses next to the total country count. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- templates/trip/stats.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates/trip/stats.html b/templates/trip/stats.html index 160e37f..b31cb58 100644 --- a/templates/trip/stats.html +++ b/templates/trip/stats.html @@ -26,6 +26,15 @@
Trips in {{ year }}: {{ year_stats.count }}
Conferences in {{ year }}: {{ year_stats.conferences }}
{{ countries | count }} countries visited in {{ year }}: + {% set new_countries = [] %} + {% for c in countries %} + {% if c.alpha_2 not in previously_visited %} + {% set _ = new_countries.append(c) %} + {% endif %} + {% endfor %} + {% if new_countries %} + ({{ new_countries | count }} new) + {% endif %} {% for c in countries %} {{ c.flag }} {{ c.name }} ({{ c.alpha_2 }})