{{ $event := .event }} {{ $layout := .layout | default "list" }} {{ $heading := .heading | default "h2" }} {{ $heading_tag := (dict "open" ((printf "<%s itemprop='headline' 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.categories) ($show_status) }}

{{ .Params.dates.status }}

{{ end }} {{ if and (site.Params.events.index.show_description) ($show_summary) }} {{- 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 -}} {{ if and (.Params.categories) ($show_category) }}

{{- range $index, $category := .GetTerms "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 }}