Omphaloskepsis-2/layouts/partials/cv/organisation/organisation-items-tiles.html.tmpl

37 lines
1.1 KiB
Cheetah
Raw Permalink Normal View History

2024-02-04 01:40:15 +00:00
<!--
Renders related items as tiles.
@params section_title Title of the sub-section to show (e.g. "Blog Posts").
@params organisation_title Title of the organisation.
@params content Related items.
-->
{{- $section_title := .section_title -}}
{{- $organisation_title := .organisation_title -}}
{{- $content := .content -}}
{{- if gt ( len $content ) 4 -}}
<details class="related-items related-items--tiles related-items--collapsible">
<summary>
{{- else -}}
<div id="{{ $section_title | anchorize }}" class="related-items related-items--tiles">
{{- end -}}
<h2 class="subheading related-items-title">{{ $section_title }} ({{ len $content }})</h2>
<div class="index">
{{ range first 4 $content }}
{{ partialCached "item-tile.html" . ( print $organisation_title "_" $section_title "_" .Title ) }}
{{ end }}
</div>
{{- if gt ( len $content ) 4 -}}
</summary>
<div class="index">
{{ range after 4 $content }}
{{ partial "item-tile.html" . }}
{{ end }}
</div>
</details>
{{ else }}
</div>
{{ end }}