Skip to content
Snippets Groups Projects
agenda.html 3.05 KiB
Newer Older
Olivia206's avatar
Olivia206 committed
{{- $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 }}

  {{ 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 }}
Olivia206's avatar
Olivia206 committed
          <article class='event' itemprop="events" itemscope itemtype="https://schema.org/Event">
Olivia206's avatar
Olivia206 committed
              <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 -}}