From f8f33d4bc95c31dbfb75c8c7d7bc1bb56e1abb02 Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Tue, 6 Jun 2023 13:06:40 +0200 Subject: [PATCH] add cancelled for platinium membership on front page Signed-off-by: Toshaan Bharvani --- themes/openpowerfoundation/layouts/index.html | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/themes/openpowerfoundation/layouts/index.html b/themes/openpowerfoundation/layouts/index.html index 41556de..8b6664b 100644 --- a/themes/openpowerfoundation/layouts/index.html +++ b/themes/openpowerfoundation/layouts/index.html @@ -4,6 +4,7 @@ {{ $promobackgroundimagelocation := (printf "%s/%s" "images/home/" $promobackgroundimagename) }} {{ $promobackgroundimageresource := resources.Get $promobackgroundimagelocation }} {{ $promobackgroundimage := $promobackgroundimageresource.Resize "3840x2160 webp" }} +{{ $now := now.Format "20060102" }}

{{ .Param "promo.header" }}

@@ -75,14 +76,24 @@ {{ range where .Site.RegularPages "Section" "members" }} {{ $level := .Param "level" }} {{ if eq $level "platinum" }} - {{ if .Param "image" }} - {{ $imagename := .Param "image" }} - {{ $imagelocation := (printf "%s/%s" "images/members/" $imagename) }} - {{ $imageresource := resources.Get $imagelocation }} - {{ $image := $imageresource.Fit "185x102 Center webp" }} -
- {{ .Title }} -
+ {{ $memberstatus := true }} + {{ $cancelled := now.Format "20060102" }} + {{ if isset .Params "cancelled" }} + {{ $cancelled = time (.Param "cancelled") | dateFormat "20060102" }} + {{ if lt $cancelled $now }} + {{ $memberstatus = false }} + {{ end }} + {{ end }} + {{ if eq $memberstatus true }} + {{ if .Param "image" }} + {{ $imagename := .Param "image" }} + {{ $imagelocation := (printf "%s/%s" "images/members/" $imagename) }} + {{ $imageresource := resources.Get $imagelocation }} + {{ $image := $imageresource.Fit "185x102 Center webp" }} +
+ {{ .Title }} +
+ {{ end }} {{ end }} {{ end }} {{ end }}