From 340905ecff6a1b3a54459d2df4f251199d973f69 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 24 Jan 2025 20:01:41 +0100 Subject: [PATCH] Less flags. Only show flags for international trips to more than one country. --- agenda/types.py | 2 +- templates/macros.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agenda/types.py b/agenda/types.py index c7bcb45..0bfef4d 100644 --- a/agenda/types.py +++ b/agenda/types.py @@ -171,7 +171,7 @@ class Trip: @functools.cached_property def show_flags(self) -> bool: """Show flags for international trips.""" - return len(self.countries) != 1 or self.countries[0].name != "United Kingdom" + return len({c for c in self.countries if c.name != "United Kingdom"}) > 1 @property def countries_str(self) -> str: diff --git a/templates/macros.html b/templates/macros.html index f9ca49f..20cf147 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -284,7 +284,7 @@ | Venue: {{ item.venue }} | Location: {{ item.location }} {% if country %} - {{ country.flag }} + {{ flag(trip, country.flag) }} {% elif item.online %} 💻 Online {% else %}