🇬🇧 Hide UK flags for all UK trips with show_flags logic 🏴

Implement show_flags property to conditionally display country flags for international trips. Remove unnecessary UK flags on purely UK-based trips. Closes: #183

🔧 Updated templates to use show_flags property.
📝 Adjusted map and trip details to reflect flag changes.
This commit is contained in:
Edward Betts 2024-10-19 19:43:48 +01:00
parent 9ad2ba9462
commit 3c0694de19
4 changed files with 28 additions and 36 deletions

View file

@ -13,7 +13,7 @@
<a href="{{ url_for("trip_page", start=trip.start.isoformat()) }}">{{ trip.title }}</a>
{% endmacro %}
{% macro conference_row(item, badge) %}
{% macro conference_row(item, badge, show_flags=True) %}
{% set country = get_country(item.country) if item.country else None %}
<div class="grid-item text-end">{{ item.start.strftime("%a, %d %b %Y") }}</div>
<div class="grid-item text-end">{{ item.end.strftime("%a, %d %b") }}</div>
@ -50,7 +50,7 @@
<div class="grid-item text-end">{{ display_date(item.cfp_end) if item.cfp_end else "" }}</div>
<div class="grid-item">
{% if country %}
{{ country.flag }} {{ country.name }}
{% if show_flags %}{{ country.flag }}{% endif %} {{ country.name }}
{% elif item.online %}
💻 Online
{% else %}
@ -61,7 +61,7 @@
</div>
{% endmacro %}
{% macro accommodation_row(item, badge) %}
{% macro accommodation_row(item, badge, show_flags=True) %}
{% set country = get_country(item.country) %}
{% set nights = (item.to.date() - item.from.date()).days %}
@ -72,7 +72,7 @@
<div class="grid-item">{{ item.location }}</div>
<div class="grid-item">
{% if country %}
{{ country.flag }} {{ country.name }}
{% if show_flags %}{{ country.flag }}{% endif %} {{ country.name }}
{% else %}
<span class="text-bg-danger p-2">
country code <strong>{{ item.country }}</strong> not found
@ -96,7 +96,7 @@
</div>
{% endmacro %}
{% macro flight_booking_row(booking) %}
{% macro flight_booking_row(booking, show_flags=True) %}
<div class="grid-item">
{% if g.user.is_authenticated %}
{{ booking.booking_reference or "reference missing" }}