From b5fa24bf997ae0c366425d3a4bc1359024d0a047 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Thu, 15 Jun 2023 19:42:21 +0200 Subject: [PATCH] Toevoegen van uitgelicht evenement --- themes/nluug/layouts/evenementen/list.html | 25 +++++++++- .../partials/show-highlighted-event.html | 49 +++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 themes/nluug/layouts/partials/show-highlighted-event.html diff --git a/themes/nluug/layouts/evenementen/list.html b/themes/nluug/layouts/evenementen/list.html index 71c5983..016c522 100644 --- a/themes/nluug/layouts/evenementen/list.html +++ b/themes/nluug/layouts/evenementen/list.html @@ -1,7 +1,30 @@ {{ define "main" }} + + {{ $.Scratch.Set "highlighted_events" slice }} + + {{ range .Pages }} + {{ if isset .Params "event_start" }} + {{ $event_start := .Params.event_start | time }} + + {{ if le now $event_start }} + {{ $.Scratch.Add "highlighted_events" . }} + {{ end }} + {{ end }} + {{ end }} + + {{ if (gt ($.Scratch.Get "highlighted_events" | len) 0) }} +

Aankomende evenementen

+
+ {{ range $.Scratch.Get "highlighted_events" }} + {{ partial "show-highlighted-event.html" . }} + {{ end }} +
+ {{ end }} + +

Overzicht