From 888c9106b06846323b4bb3704688850c30ff4c21 Mon Sep 17 00:00:00 2001
From: Edward Betts
Date: Fri, 29 Dec 2023 19:02:05 +0000
Subject: [PATCH] Add 'going' badges to conferences
---
templates/conference_list.html | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/templates/conference_list.html b/templates/conference_list.html
index a61659d..14c3560 100644
--- a/templates/conference_list.html
+++ b/templates/conference_list.html
@@ -19,19 +19,25 @@
{% endblock %}
-{% macro row(item) %}
+{% macro row(item, badge) %}
{{ item.start.strftime("%a, %d %b %Y") }}
{{ item.end.strftime("%a, %d %b") }}
-{{ item.name }}
+{{ item.name }}
+ {% if item.going %}
+
+ {{ badge }}
+
+ {% endif %}
+
{{ item.topic }}
{{ item.location }}
{% endmacro %}
-{% macro section(heading, item_list) %}
+{% macro section(heading, item_list, badge) %}
{% if item_list %}
{{heading}}
-{% for item in item_list %}{{ row(item) }}{% endfor %}
+{% for item in item_list %}{{ row(item, badge) }}{% endfor %}
{% endif %}
{% endmacro %}
@@ -52,9 +58,9 @@
- {{ section("Current", current) }}
- {{ section("Future", future) }}
- {{ section("Past", past|reverse) }}
+ {{ section("Current", current, "attending") }}
+ {{ section("Future", future, "going") }}
+ {{ section("Past", past|reverse, "went") }}