{{ $event := .event }} {{ $layout := .layout | default "list" }} {{ $heading := .heading | default "h2" }} {{ $heading_tag := (dict "open" ((printf "<%s itemprop='name' class='event-title'>" $heading) | safeHTML) "close" ((printf "" $heading) | safeHTML) ) }} {{ $index := .index }} {{ $alternate := .alternate }} {{ $show_summary := .show_summary }} {{ $show_category := .show_category }} {{ $show_status := .show_status }} {{ with $event }}
{{- $title := partial "PrepareHTML" .Title -}} {{ if .Params.subtitle }}
{{ end }} {{ $heading_tag.open }} {{ $title }} {{ $heading_tag.close }} {{ if .Params.subtitle }}

{{ .Params.subtitle }}

{{ end }} {{ if (or .Params.dates.computed.two_lines.short .Params.dates.from.hour .Params.dates.to.hour) }}
{{ partial "PrepareHTML" .Params.dates.computed.two_lines.short }} {{- if (or .Params.dates.from.hour .Params.dates.to.hour) }}
{{- if .Params.dates.from.hour }} {{ .Params.dates.from.hour }} {{ end -}} {{- if .Params.dates.to.hour }} {{ .Params.dates.to.hour }} {{ end -}}
{{ end -}}
{{ end }} {{ if and .Params.events_categories $show_status }}

{{ if eq .Params.dates.status "current"}} {{- i18n "blocks.events.current" -}} {{ else if eq .Params.dates.status "future" }} {{- i18n "blocks.events.future" -}} {{ else if eq .Params.dates.status "archive" }} {{- i18n "blocks.events.archive" -}} {{ end }}

{{ end }} {{ if and (site.Params.events.index.show_description) ($show_summary) }} {{- if (partial "GetTextFromHTML" .Params.summary) -}}

{{ partial "GetTruncateContent" ( dict "text" .Params.summary "length" site.Params.events.index.truncate_description ) }}

{{- end -}} {{ if and .Params.events_categories $show_category }}

{{- range $index, $category := .GetTerms "events_categories" -}} {{- $category.Title -}} {{- end -}}

{{ end }} {{- end -}} {{ if eq $layout "large" }} {{ 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 }}