From ceee85926a7fec9244fcc4e23e3ffda79f292609 Mon Sep 17 00:00:00 2001 From: tree Date: Fri, 24 Nov 2023 13:16:13 +0100 Subject: [PATCH] update --- src/components/EventItem.astro | 30 +++++++++++++++++++++++++----- src/pages/events.astro | 4 ++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/components/EventItem.astro b/src/components/EventItem.astro index 41f2170..89980b4 100644 --- a/src/components/EventItem.astro +++ b/src/components/EventItem.astro @@ -43,6 +43,23 @@ function dateEnd(str, days) { return format(addDays(new Date(str), days), 'yyyy-MM-dd'); } +const statuses = { + preregistration: { + title: 'Pre-registration', + color: 'text-orange-500', + }, + unconfirmed: { + title: 'Planned', + color: '' + }, + confirmed: { + title: 'Confirmed', + color: 'text-green-500', + } +} + +const status = item.confirmed ? statuses.confirmed : (item.links?.rsvp ? statuses.preregistration : statuses.unconfirmed) + ---
@@ -66,11 +83,13 @@ function dateEnd(str, days) {
- {item.links?.rsvp && -
- -
- } +
+
+ {/*
*/} + {item.links?.rsvp && + + } +
@@ -79,6 +98,7 @@ function dateEnd(str, days) {
Date: {dateFormat(item.date)} {item.days ? ' - ' + dateFormat(dateEnd(item.date, item.days)) + ` (${item.days} days)` : ''}
+
Status: {status.title}
Lead: {item.lead || 'n/a'}
diff --git a/src/pages/events.astro b/src/pages/events.astro index 336c6e6..b6108a9 100644 --- a/src/pages/events.astro +++ b/src/pages/events.astro @@ -57,6 +57,10 @@ for (const year of pastYears.reverse()) { ))}
))} + +

+ Source repository +