add cancelled for platinium membership on front page

Signed-off-by: Toshaan Bharvani <toshaan@vantosh.com>
jamesk-ocp-china-day-guest-blog
Toshaan Bharvani 1 year ago
parent 7facfb03be
commit f8f33d4bc9

@ -4,6 +4,7 @@
{{ $promobackgroundimagelocation := (printf "%s/%s" "images/home/" $promobackgroundimagename) }} {{ $promobackgroundimagelocation := (printf "%s/%s" "images/home/" $promobackgroundimagename) }}
{{ $promobackgroundimageresource := resources.Get $promobackgroundimagelocation }} {{ $promobackgroundimageresource := resources.Get $promobackgroundimagelocation }}
{{ $promobackgroundimage := $promobackgroundimageresource.Resize "3840x2160 webp" }} {{ $promobackgroundimage := $promobackgroundimageresource.Resize "3840x2160 webp" }}
{{ $now := now.Format "20060102" }}
<section class="home promo__section d-flex flex-column justify-content-center" style="background-image:url({{ $promobackgroundimage.RelPermalink }})" > <section class="home promo__section d-flex flex-column justify-content-center" style="background-image:url({{ $promobackgroundimage.RelPermalink }})" >
<div class="promo__container container text-center"> <div class="promo__container container text-center">
<h1>{{ .Param "promo.header" }}</h1> <h1>{{ .Param "promo.header" }}</h1>
@ -75,14 +76,24 @@
{{ range where .Site.RegularPages "Section" "members" }} {{ range where .Site.RegularPages "Section" "members" }}
{{ $level := .Param "level" }} {{ $level := .Param "level" }}
{{ if eq $level "platinum" }} {{ if eq $level "platinum" }}
{{ if .Param "image" }} {{ $memberstatus := true }}
{{ $imagename := .Param "image" }} {{ $cancelled := now.Format "20060102" }}
{{ $imagelocation := (printf "%s/%s" "images/members/" $imagename) }} {{ if isset .Params "cancelled" }}
{{ $imageresource := resources.Get $imagelocation }} {{ $cancelled = time (.Param "cancelled") | dateFormat "20060102" }}
{{ $image := $imageresource.Fit "185x102 Center webp" }} {{ if lt $cancelled $now }}
<div class="col-md-2 pb-3 pb-lg-0 text-valign-center"> {{ $memberstatus = false }}
<img class="img-fluid" src="{{ $image.RelPermalink }}" width="180" height="102" alt="{{ .Title }}"> {{ end }}
</div> {{ 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" }}
<div class="col-md-2 pb-3 pb-lg-0 text-valign-center">
<img class="img-fluid" src="{{ $image.RelPermalink }}" width="180" height="102" alt="{{ .Title }}">
</div>
{{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}

Loading…
Cancel
Save