From 89ff92c53399ae808d69b8e103221920f526cda5 Mon Sep 17 00:00:00 2001
From: Edward Betts
Date: Wed, 24 Jan 2024 12:03:56 +0000
Subject: [PATCH] Show linked events on trip page
Closes: #124
---
agenda/trip.py | 6 +++++-
static/js/map.js | 1 +
templates/trip_page.html | 28 ++++++++++++++++++++++++++--
3 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/agenda/trip.py b/agenda/trip.py
index 6234bf6..d5f9adc 100644
--- a/agenda/trip.py
+++ b/agenda/trip.py
@@ -106,7 +106,11 @@ def collect_trip_coordinates(trip: Trip) -> list[StrDict]:
coords = []
- src = [("accommodation", trip.accommodation), ("conference", trip.conferences)]
+ src = [
+ ("accommodation", trip.accommodation),
+ ("conference", trip.conferences),
+ ("event", trip.events),
+ ]
for coord_type, item_list in src:
coords += [
{
diff --git a/static/js/map.js b/static/js/map.js
index addc29a..21872c9 100644
--- a/static/js/map.js
+++ b/static/js/map.js
@@ -18,6 +18,7 @@ var icons = {
"airport": emoji_icon("✈️"),
"accommodation": emoji_icon("🏨"),
"conference": emoji_icon("🎤"),
+ "event": emoji_icon("🍷"),
}
function build_map(map_id, coordinates, routes) {
diff --git a/templates/trip_page.html b/templates/trip_page.html
index 001ba6e..03e86d1 100644
--- a/templates/trip_page.html
+++ b/templates/trip_page.html
@@ -137,8 +137,32 @@
| Location: {{ item.location }}
{% if country %}
{{ country.flag }}
- {% elif item.online %}
- 💻 Online
+ {% else %}
+
+ country code {{ item.country }} not found
+
+ {% endif %}
+ {% if item.price and item.currency %}
+ | price: {{ item.price }} {{ item.currency }}
+ {% endif %}
+
+
+
+ {% endfor %}
+
+ {% for item in trip.events %}
+ {% set country = get_country(item.country) if item.country else None %}
+
+
+
+ {{ item.title }}
+ {{ display_date_no_year(item.date) }}
+
+
+ Address: {{ item.address }}
+ | Location: {{ item.location }}
+ {% if country %}
+ {{ country.flag }}
{% else %}
country code {{ item.country }} not found