From 2be06712a8e258d2ee2b7b910af7fbc6150a3c34 Mon Sep 17 00:00:00 2001 From: Raphael Kabo Date: Mon, 27 May 2024 09:56:57 +0100 Subject: Improve event lists --- views/eventgroup.handlebars | 41 +++++++++++++++---------------------- views/partials/eventList.handlebars | 22 ++++++++++++++++++++ views/publicEventList.handlebars | 41 +++++-------------------------------- 3 files changed, 43 insertions(+), 61 deletions(-) create mode 100644 views/partials/eventList.handlebars (limited to 'views') diff --git a/views/eventgroup.handlebars b/views/eventgroup.handlebars index 9658b60..3151aea 100755 --- a/views/eventgroup.handlebars +++ b/views/eventgroup.handlebars @@ -109,31 +109,22 @@ {{/if}} -
-
About
-
- {{{parsedDescription}}} -
-
-
-
Upcoming events
-
- {{#if upcomingEventsExist}} - {{#each events}} - {{#unless this.eventHasConcluded}} - - - {{this.name}} - {{#if this.location}} {{this.location}}{{/if}} - {{this.displayDate}} - - {{/unless}} - {{/each}} - {{else}} -
No events!
- {{/if}} -
-
+
+
About
+
+ {{{parsedDescription}}} +
+
+ +
+
Upcoming events
+ {{> eventList upcomingEvents}} +
+ +
+
Past events
+ {{> eventList pastEvents}} +
{{#if editingEnabled}} diff --git a/views/partials/eventList.handlebars b/views/partials/eventList.handlebars new file mode 100644 index 0000000..6c8e7a4 --- /dev/null +++ b/views/partials/eventList.handlebars @@ -0,0 +1,22 @@ +
+{{#if this}} + {{#each this}} +
+
{{this.title}}
+
+ {{#each this.events}} + + + {{this.name}} + {{#if this.location}} {{this.location}}{{/if}} + {{this.displayDate}} + {{#if this.eventGroup}} + {{this.eventGroup.name}} + {{/if}} + + {{/each}} + {{/each}} +{{else}} +
No events!
+{{/if}} +
diff --git a/views/publicEventList.handlebars b/views/publicEventList.handlebars index 8dccaaa..b8cacd0 100644 --- a/views/publicEventList.handlebars +++ b/views/publicEventList.handlebars @@ -21,44 +21,13 @@
-
Upcoming events
- +
Upcoming events
+ {{> eventList upcomingEvents }}
-
Past events
-
- {{#if pastEvents}} - {{#each pastEvents}} - - - {{this.name}} - {{this.displayDate}} - {{#if this.eventGroup}} - {{this.eventGroup.name}} - {{/if}} - - {{/each}} - {{else}} -
No events!
- {{/if}} -
+
Past events
+ {{> eventList pastEvents }}
@@ -79,4 +48,4 @@ {{/if}} - \ No newline at end of file + -- cgit v1.2.3