{% macro display_datetime(dt) %}{{ dt.strftime("%a, %d, %b %Y %H:%M %z") }}{% endmacro %} {% macro display_time(dt) %}{{ dt.strftime("%H:%M %z") }}{% endmacro %} {% macro display_date(dt) %}{{ dt.strftime("%a %-d %b %Y") }}{% endmacro %} {% macro display_date_no_year(dt) %}{{ dt.strftime("%a %-d %b") }}{% endmacro %} {% macro trip_link(trip) %} {{ trip.title }} {% endmacro %} {% macro conference_row(item, badge) %} {% set country = get_country(item.country) if item.country else None %}
{{ item.start.strftime("%a, %d %b %Y") }}
{{ item.end.strftime("%a, %d %b") }}
{% if item.url %} {{ item.name }} {% else %} {{ item.name }} {% endif %} {% if item.going and not (item.accommodation_booked or item.travel_booked) %} {{ badge }} {% endif %} {% if item.accommodation_booked %} accommodation {% endif %} {% if item.transport_booked %} transport {% endif %}
{{ item.topic }}
{{ item.location }}
{{ display_date(item.cfp_end) if item.cfp_end else "" }}
{% if country %} {{ country.flag }} {{ country.name }} {% elif item.online %} 💻 Online {% else %} country code {{ item.country }} not found {% endif %}
{% endmacro %} {% macro accommodation_row(item, badge) %} {% set country = get_country(item.country) %} {% set nights = (item.to.date() - item.from.date()).days %}
{{ item.from.strftime("%a, %d %b %Y") }}
{{ item.to.strftime("%a, %d %b") }}
{% if nights == 1 %}1 night{% else %}{{ nights }} nights{% endif %}
{{ item.operator }}
{{ item.location }}
{% if country %} {{ country.flag }} {{ country.name }} {% else %} country code {{ item.country }} not found {% endif %}
{% if item.url %} {{ item.name }} {% else %} {{ item.name }} {% endif %}
{% endmacro %} {% macro flight_row(item) %} {% set full_flight_number = item.airline + item.flight_number %} {% set radarbox_url = "https://www.radarbox.com/data/flights/" + full_flight_number %}
{{ item.depart.strftime("%a, %d %b %Y") }}
{{ item.from }} → {{ item.to }}
{{ item.depart.strftime("%H:%M") }}
{% if item.arrive %} {{ item.arrive.strftime("%H:%M") }} {% if item.arrive.date() != item.depart.date() %}+1 day{% endif %} {% endif %}
{{ item.duration }}
{{ full_flight_number }}
{% if g.user.is_authenticated %} {{ item.booking_reference }} {% else %} redacted {% endif %}
flightradar24 | FlightAware | radarbox
{% endmacro %} {% macro train_row(item) %}
{{ item.depart.strftime("%a, %d %b %Y") }}
{{ item.from }} → {{ item.to }}
{{ item.depart.strftime("%H:%M") }}
{% if item.arrive %} {{ item.arrive.strftime("%H:%M") }} {% if item.depart != item.arrive and item.arrive.date() != item.depart.date() %}+1 day{% endif %} {% endif %}
{{ ((item.arrive - item.depart).total_seconds() // 60) | int }} mins
{{ item.operator }}
{% if g.user.is_authenticated %} {{ item.booking_reference }} {% else %} redacted {% endif %}
{% endmacro %}