From 505bb9215df6ffce68e33c1f8c87b521cb1c18ff Mon Sep 17 00:00:00 2001 From: Vanja Cosic <1070957+vanjacosic@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:58:28 +0200 Subject: Fix sorting by date on Events page --- templates/events.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/events.html b/templates/events.html index 3fefc7a..7a75111 100644 --- a/templates/events.html +++ b/templates/events.html @@ -17,7 +17,12 @@

{{ group | capitalize }}

- {% for event in meetups[group] %} + {% set events_sorted = meetups[group] | sort(attribute="date") | reverse %} + + {# Reverse sorting again for upcoming events #} + {% if group == 'upcoming' %}{% set events_sorted = events_sorted | reverse %}{% endif %} + + {% for event in events_sorted %} {% set event_page = section.pages | filter(attribute="title", value=event.title) | first%} {% if event_page %} -- cgit v1.2.3