{{ $event := .event }} {{ $layout := "list" }} {{ $layout = .layout }} {{- $direction := "" -}} {{ $heading := .heading | default "h2" }} {{ $heading_tag := (dict "open" ((printf "<%s itemprop='headline'>" $heading) | safeHTML) "close" ((printf "" $heading) | safeHTML) ) }} {{ $index := .index }} {{ $alternate := .alternate }} {{ with $event }} {{ if .Params.image }} {{- $direction = partial "GetImageDirection" .Params.image -}} {{ end }}
{{- $title := partial "PrepareHTML" .Title -}} {{ $heading_tag.open }} {{ $title }} {{ $heading_tag.close }} {{ if eq $layout "large" }}
{{ .Params.dates.computed.short }}
{{ if .Params.dates.from.hour }} {{ .Params.dates.from.hour }} {{ end }} {{ if .Params.dates.to.hour }} {{ .Params.dates.to.hour }} {{ end }}
{{ if site.Params.events.index.show_description }} {{- if (partial "GetTextFromHTML" .Params.summary) -}}

{{ 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 }}

{{- end -}} {{- end -}} {{ end }}
{{ if ne $layout "large" }}
{{ .Params.dates.computed.short }}
{{ if .Params.dates.from.hour }} {{ .Params.dates.from.hour }} {{ end }} {{ if .Params.dates.to.hour }} {{ .Params.dates.to.hour }} {{ end }}
{{ if and (site.Params.events.index.show_description) (eq $layout "grid") }} {{- if (partial "GetTextFromHTML" .Params.summary) -}}

{{ 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 }}

{{- end -}} {{- end -}} {{ end }}
{{- 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 -}}
{{ end }}