{{ $event := .event }} {{ $layout := .layout | default "list" }} {{ $heading_level := .heading_level | default 3 }} {{ $is_sub_event := .is_sub_event }} {{ $is_sup_event := .is_sup_event }} {{ $with_more := .with_more }} {{ $heading_tag := (dict "open" ((printf "" $heading_level) | safeHTML) "close" ((printf "" $heading_level) | safeHTML) ) }} {{ $index := .index }} {{ $alternate := .alternate }} {{ $options := .options }} {{ with $event }} {{ $class := "event" }} {{ if and .Params.image $options.image }} {{ $class = printf "%s event--with-image" $class }} {{ end -}} {{ if .Params.children }} {{ $class = printf "%s event--parent" $class }} {{ end -}} {{ if .Params.parent }} {{ $class = printf "%s event--child" $class }} {{ end -}} {{ $dates := .Params.dates }}
{{- $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 eq $layout "agenda" }} {{ with .Params.current_time_slot }} {{ partial "events/partials/event/hours.html" . }} {{ end }} {{ end }} {{ if $options.dates }} {{ partial "events/partials/event/schedule.html" (dict "dates" .Params.dates "on_two_lines" (ne $layout "list") )}} {{ end }} {{ if and $dates.status $options.status }} {{ partial "events/partials/event/status.html" $dates.status }} {{ end }} {{ if and $options.summary .Params.summary }}
{{ partial "GetRichSummary" ( dict "summary" .Params.summary "kind" "events" )}} {{ if eq $layout "large" }} {{ end }}
{{ end }} {{ if $options.categories }} {{ partial "commons/categories" ( dict "context" . "kind" "event" )}} {{- end -}} {{ if $with_more }} {{ partial "commons/item/more.html" . }} {{- end -}}
{{- if and $options.image .Params.image -}} {{ $sizes := index site.Params.image_sizes.blocks.events $layout }} {{- partial "commons/image.html" (dict "image" .Params.image "sizes" $sizes ) -}} {{- else -}} {{- partial "commons/image-default.html" "events" -}} {{- end -}}
{{ end }}