From a96aefe22b10b267b610a5b2fc60660b668dc539 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 20 May 2024 18:32:49 +0200 Subject: [PATCH] Improve trip list template --- templates/trip/list.html | 71 +++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/templates/trip/list.html b/templates/trip/list.html index 07dad88..a0f3f48 100644 --- a/templates/trip/list.html +++ b/templates/trip/list.html @@ -116,40 +116,8 @@ {% endfor %} {% endif %} - {% for item in trip.conferences %} - {% set country = get_country(item.country) if item.country else None %} -
-
-
- {{ item.name }} - - {{ display_date_no_year(item.start) }} to {{ display_date_no_year(item.end) }} - -
-

- Topic: {{ item.topic }} - | Venue: {{ item.venue }} - | Location: {{ item.location }} - {% if country %} - {{ country.flag }} - {% elif item.online %} - 💻 Online - {% else %} - - country code {{ item.country }} not found - - {% endif %} - {% if item.free %} - | free to attend - {% elif item.price and item.currency %} - | price: {{ item.price }} {{ item.currency }} - {% endif %} -

-
-
- {% endfor %} + {{ conference_list(trip) }} - {% set date_heading = None %} {% for day, elements in trip.elements_grouped_by_day() %}

{{ display_date_no_year(day) }}

{% set accommodation_label = {"check-in": "check-in from", "check-out": "check-out by"} %} @@ -176,6 +144,43 @@ {% endif %} {% endmacro %} +{% macro conference_list(trip) %} + {% for item in trip.conferences %} + {% set country = get_country(item.country) if item.country else None %} +
+
+
+ {{ item.name }} + + {{ display_date_no_year(item.start) }} to {{ display_date_no_year(item.end) }} + +
+

+ Topic: {{ item.topic }} + | Venue: {{ item.venue }} + | Location: {{ item.location }} + {% if country %} + {{ country.flag }} + {% elif item.online %} + 💻 Online + {% else %} + + country code {{ item.country }} not found + + {% endif %} + {% if item.free %} + | free to attend + {% elif item.price and item.currency %} + | price: {{ item.price }} {{ item.currency }} + {% endif %} +

+
+
+ {% endfor %} + + +{% endmacro %} + {% block content %}