Add more country flags on the trip list.
This commit is contained in:
parent
448d59514b
commit
d4dda44768
|
@ -59,7 +59,9 @@ class TripElement:
|
||||||
def airport_label(airport: StrDict) -> str:
|
def airport_label(airport: StrDict) -> str:
|
||||||
"""Airport label: name and iata."""
|
"""Airport label: name and iata."""
|
||||||
name = airport.get("alt_name") or airport["city"]
|
name = airport.get("alt_name") or airport["city"]
|
||||||
return f"{name} ({airport['iata']})"
|
country = agenda.get_country(airport["country"])
|
||||||
|
assert country and country.flag
|
||||||
|
return f"{name} ({airport['iata']}) {country.flag}"
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
|
@ -152,16 +152,13 @@
|
||||||
{% set date_heading = None %}
|
{% set date_heading = None %}
|
||||||
{% for day, elements in trip.elements_grouped_by_day() %}
|
{% for day, elements in trip.elements_grouped_by_day() %}
|
||||||
<h4>{{ display_date_no_year(day) }}</h4>
|
<h4>{{ display_date_no_year(day) }}</h4>
|
||||||
|
{% set accommodation_label = {"check-in": "check-in from", "check-out": "check-out by"} %}
|
||||||
{% for e in elements %}
|
{% for e in elements %}
|
||||||
{% if e.element_type == "check-in" %}
|
{% if e.element_type in accommodation_label %}
|
||||||
|
{% set c = get_country(e.detail.country) %}
|
||||||
<div>
|
<div>
|
||||||
{{ e.get_emoji() }} {{ e.title }}
|
{{ e.get_emoji() }} {{ e.title }} {{ c.flag }}
|
||||||
(check-in from {{ display_time(e.when) }})
|
({{ accommodation_label[e.element_type] }} {{ display_time(e.when) }})
|
||||||
</div>
|
|
||||||
{% elif e.element_type == "check-out" %}
|
|
||||||
<div>
|
|
||||||
{{ e.get_emoji() }} {{ e.title }}
|
|
||||||
(check-out by {{ display_time(e.when) }})
|
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in a new issue