{{- $block := .block }} {{- $term := false -}} {{- $block_class := partial "GetBlockClass" .block -}} {{- with .block.data -}} {{- $show_summary := .show_summary -}} {{- $show_category := .show_category -}} {{- $show_status := .show_status -}} {{- $layout := .layout | default "list" -}} {{ if .category }} {{- $term = site.GetPage (printf "/posts_categories%s" .category) -}} {{ end }}
{{ $events_page_links := false }} {{- if $term }} {{ $events_page_links = $term.Permalink }} {{- else -}} {{ $events_page := site.GetPage "/posts" }} {{ $events_page_links = $events_page.Permalink }} {{- end -}} {{ partial "blocks/top.html" (dict "title" $block.title "heading_level" $block.ranks.self "description" .description "link" $events_page_links )}} {{ 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 -}}