From f0bf7145fc469d8962ad79b86fbd6e9554f7bc70 Mon Sep 17 00:00:00 2001
From: Olivia206 <olivia.simonet206@gmail.com>
Date: Thu, 14 Sep 2023 14:55:57 +0200
Subject: [PATCH] added agenda file

---
 layouts/partials/blocks/templates/agenda.html | 84 +++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 layouts/partials/blocks/templates/agenda.html

diff --git a/layouts/partials/blocks/templates/agenda.html b/layouts/partials/blocks/templates/agenda.html
new file mode 100644
index 00000000..f97d2cc4
--- /dev/null
+++ b/layouts/partials/blocks/templates/agenda.html
@@ -0,0 +1,84 @@
+{{- $template := .block.template -}}
+{{- $position := .block.position -}}
+{{- $title := .block.title -}}
+
+{{- with .block.data }}
+
+  {{ $event := .event }}
+  {{- $direction := "" -}}
+  {{ $heading := .heading | default "h2" }}
+  {{ $heading_tag := (dict 
+      "open" ((printf "<%s itemprop='headline'>" $heading) | safeHTML)
+      "close" ((printf "</%s>" $heading) | safeHTML)
+      ) }}
+  {{ $index := .index }}
+  {{ $alternate := .alternate }}
+
+  {{ with $event }}
+    {{ if .Params.image }}
+      {{- $direction = partial "GetImageDirection" .Params.image -}}
+    {{ end }}
+
+    <div itemscope itemtype="http://schema.org/Blog" class="block block-agenda--list block-agenda{{ if $title }} block-with-title{{ end }}">
+      <div class="container">
+        <div class="block-content">
+          {{ if or $title .description }}
+            <div class="top">
+              {{ if $title }}
+                <p class="block-title">{{ partial "PrepareHTML" $title }}</p>
+              {{ end }}
+              {{- if .description }}
+                <div class="description">
+                  {{ partial "PrepareHTML" .description }}
+                </div>
+              {{ end -}}
+            </div>
+          {{ end -}}
+          {{ range .events }}
+          <article class='event {{ if $alternate }}{{ $direction }} {{if not (modBool $index 2)}}left{{ else}}right{{end}}{{end}}' itemprop="events" itemscope itemtype="https://schema.org/Event">
+              <div class="event-content">
+                {{- $title := partial "PrepareHTML" .Title -}}
+            
+                {{ $heading_tag.open }}
+                  <a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a>
+                {{ $heading_tag.close }}
+            
+                {{ if site.Params.events.index.show_description }}
+                  {{- if (partial "GetTextFromHTML" .Params.summary) -}}
+                    <p itemprop="articleBody">
+                      {{ if site.Params.events.index.truncate_description }}
+                        {{ partial "GetTruncateContent" ( dict 
+                          "text" .Params.summary
+                          "length" site.Params.events.index.truncate_description
+                          ) }}
+                      {{ else }}
+                        {{ partial "PrepareText" .Params.summary }}
+                      {{ end }}
+                    </p>
+                  {{- end -}}
+                {{- end -}}
+              </div>
+            
+              <div class="event-dates">
+                {{ .Params.dates.computed.short }}
+              </div>
+            
+              <div class="media">
+                {{- if .Params.image -}}
+                  {{- partial "commons/image.html"
+                        (dict
+                          "image"    .Params.image
+                          "sizes"    site.Params.image_sizes.sections.events.item
+                        ) -}}
+                {{- else if site.Params.events.default_image -}}
+                  {{- partial "commons/image-default.html" -}}
+                {{- end -}}
+              </div>
+          </article>
+          {{ end -}}
+        </div>
+      </div>
+    </div>
+
+  {{ end -}}
+{{ end -}}
-- 
GitLab