{{- $block := .block }} {{- $block_class := partial "GetBlockClass" .block -}} {{- with .block.data -}} {{- $show_summary := .show_summary -}} {{- $show_category := .show_category -}} {{- $show_status := .show_status -}} {{- $layout := .layout | default "list" -}}
{{ $events_page := site.GetPage "/events" }} {{ $link := $events_page.Permalink }} {{ if .category }} {{ $term := site.GetPage (printf "/events_categories%s" .category) }} {{ $link = $term.Permalink }} {{ end }} {{ partial "blocks/top.html" (dict "title" $block.title "heading_level" $block.ranks.self "description" .description "link" $link )}} {{ if .events }}
{{ range .events }} {{ $event := site.GetPage .file }} {{ with $event }} {{ partial "events/event" (dict "event" . "layout" $layout "show_summary" $show_summary "show_category" $show_category "show_status" $show_status "heading" (printf "h%d" $block.ranks.children) ) }} {{ end }} {{ end }}
{{ else if .no_event_message }}

{{ partial "PrepareHTML" .no_event_message }}

{{ end }}
{{ end -}}