diff --git a/themes/openpowerfoundation/layouts/events/list.html b/themes/openpowerfoundation/layouts/events/list.html index 301bd1a..777e4ce 100644 --- a/themes/openpowerfoundation/layouts/events/list.html +++ b/themes/openpowerfoundation/layouts/events/list.html @@ -5,9 +5,19 @@

{{ .Title }}

- {{ range .Pages.ByDate.Reverse }} - {{ $eventdate := .Param "eventdate" }} - + {{ $.Scratch.Set "pre" true }} + {{ $.Scratch.Set "post" true }} + {{ range .Pages.ByDate.Reverse }} + {{ $eventdate := .Param "eventdate" }} + {{ $t := (time $eventdate)}} + {{ if and ($t.After now) ( $.Scratch.Get "pre")}} +

Upcoming Events

+ {{ $.Scratch.Set "pre" false }} + {{ end }} + {{ if and ($t.Before now) ($.Scratch.Get "post")}} +

Past Events

+ {{ $.Scratch.Set "post" false }} + {{ end }} {{ end }}