Move trip new-country filtering into stats

This commit is contained in:
Edward Betts 2026-01-15 22:53:17 +00:00
parent ddfa77b152
commit f22772d12d
5 changed files with 27 additions and 15 deletions

View file

@ -27,19 +27,13 @@
<div>Trips in {{ year }}: {{ year_stats.count }}</div>
<div>Conferences in {{ year }}: {{ year_stats.conferences }}</div>
<div>{{ countries | count }} countries visited in {{ year }}:
{% set display_new_countries = [] %}
{% for c in new_countries %}
{% if c.alpha_2 not in previously_visited %}
{% set _ = display_new_countries.append(c) %}
{% endif %}
{% endfor %}
{% if display_new_countries %}
({{ display_new_countries | count }} new)
{% if new_countries %}
({{ new_countries | count }} new)
{% endif %}
{% for c in countries %}
<span class="d-inline-block border border-2 p-1 m-1">
{{ c.flag }} {{ c.name }} ({{ c.alpha_2 }})
{% if c in display_new_countries %}
{% if c in new_countries %}
<span class="badge text-bg-info">new</span>
{% endif %}
</span>