event listing as a timeline

Signed-off-by: Toshaan Bharvani <toshaan@vantosh.com>
archetype-theme-transition
Toshaan Bharvani 3 years ago
parent 8d969a3940
commit 3ff03f81fe

@ -1,4 +1,4 @@
$primary: #007aad; $primary: #2566f4;
$dark-primary: #303F9F; $dark-primary: #303F9F;
$light-primary: #000000; $light-primary: #000000;
$text: #ffffff; $text: #ffffff;

@ -1,60 +1,36 @@
{{ partial "header.html" . }} {{ partial "header.html" . }}

{{ partial "navbar.html" . }} {{ partial "navbar.html" . }}


<main id="main" class="main events" > <main id="main">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<h1 class="section-header my-3 my-md-5 pb-2 text-center">{{ .Title }}</h1> <div class="col-md-12 text-center">
{{ $.Scratch.Set "pre" true }} <h1 class="section-title">{{ .Title }}</h1>
{{ $.Scratch.Set "post" true }} <p>{{ .Content }}</p>
{{ range .Pages.ByDate.Reverse }} </div>
{{ $eventdate := .Param "eventdate" }} </div>
{{ $t := (time $eventdate)}} <div class="row">
{{ if and ($t.After now) ( $.Scratch.Get "pre")}} <div class="col-md-12">
<h2>Upcoming Events</h2> <section class="timeline">
{{ $.Scratch.Set "pre" false }} <div class="container" style="text-align: left!important">
{{ end }} {{ range .Pages.ByDate.Reverse }}
{{ if and ($t.Before now) ($.Scratch.Get "post")}} <div class="timeline-item">
<h2>Past Events</h2> <div class="timeline-img"></div>
{{ $.Scratch.Set "post" false }} <div class="timeline-content js--fadeInLeft">
{{ end }} <h2><a href="{{ .Permalink }}"><span class="post-title">{{ .Title }}</span></a></h2>
<article class="post__article row"> {{ $eventdate := .Param "eventdate" }}
<div class="col-md-6 pt-3 mb-3 mb-lg-0"> <div class="date">{{ dateFormat "2 January 2006" $eventdate }}</div>
{{ if .Param "image" }} <p>{{ .Summary }}</p>
{{ $imagename := .Param "image" }} </div>
{{ $imagelocation := (printf "%s/%s" "images/events/" $imagename) }}
{{ $imageresource := resources.Get $imagelocation }}
{{ $image := $imageresource }}
<img class="img-fluid" src="{{ $image.RelPermalink }}" alt="{{ .Param "title" }}" title="{{ .Param "title" }}">
{{ else }}
{{ .Param "title" }}
{{ end }}
</div>
<div class="col-md-6">
<h2>{{ .Param "title" }}</h2>
<p><b>
{{ dateFormat "January 2, 2006" $eventdate }}</b><br>
<b>{{ .Param "eventtime" }}</b><br>
<b>{{ .Param "eventcalendar" }}</b>
</p>
<p>{{ .Content }}</p>
<p>
{{ if and ($t.After now) }}
<a class="btn-outline-primary btn-sm btn" href="{{ .Param "link" }}">Registration</a>
{{ else }}
<a class="btn-outline-primary btn-sm btn" href="{{ .Param " link" }}">Access event content</a>
{{ end }}
</p>
</div> </div>
</article> {{ end }}
{{ end }} </div>
</div> </section>
</div>
</div>
</div>
</section>
</main> </main>


<script>
var today = new Date();
var date = today.getFullYear()+'-'+today.getMonth()+'-'+today.getDate();
</script>


{{ partial "footer.html" . }} {{ partial "footer.html" . }}
Loading…
Cancel
Save