Add new country count display to trip statistics

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 <noreply@anthropic.com>
This commit is contained in:
Edward Betts 2025-07-15 16:32:59 +02:00
parent d65981ef7e
commit af49dac232

View file

@ -26,6 +26,15 @@
<div>Trips in {{ year }}: {{ year_stats.count }}</div>
<div>Conferences in {{ year }}: {{ year_stats.conferences }}</div>
<div>{{ 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 %}
<span class="text-nowrap border border-2 px-2 my-3 mx-1">
{{ c.flag }} {{ c.name }} ({{ c.alpha_2 }})