{{ $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 }} {{ $options := .options }} {{ with $event }}
{{- $title := partial "PrepareHTML" .Title -}} {{ if and $options.subtitle .Params.subtitle }}
{{ end }} {{ $heading_tag.open }} {{ $title }} {{ $heading_tag.close }} {{ if and $options.subtitle .Params.subtitle }}

{{ partial "PrepareText" .Params.subtitle }}

{{ end }} {{ if and $options.dates (or .Params.dates.computed.short .Params.dates.computed.two_lines.short .Params.dates.from.hour .Params.dates.to.hour) }}
{{ $date_format := .Params.dates.computed.two_lines.short }} {{ if ne $layout "list" }} {{ $date_format = .Params.dates.computed.short }} {{ end }} {{ partial "PrepareHTML" $date_format }} {{- 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.dates.status $options.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 $options.summary }} {{- if (partial "GetTextFromHTML" .Params.summary) -}}

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

{{ if eq $layout "large" }} {{ end }}
{{- end -}} {{ end }} {{ if $options.categories }} {{ partial "commons/categories" ( dict "context" . "kind" "event" )}} {{- end -}}
{{- if and $options.image .Params.image -}} {{- partial "commons/image.html" (dict "image" .Params.image "sizes" site.Params.image_sizes.sections.events.item ) -}} {{- else -}} {{- partial "commons/image-default.html" "events" -}} {{- end -}}
{{ end }}