gcg-website/layouts/schulchronik/single.html
Denys Konovalov 02c5040281
All checks were successful
website-main / prod-build (push) Successful in 15s
website-main / test-build (push) Successful in 4s
Kreative Haufen in CSS (#254)
Schließt #211

Reviewed-on: #254
2024-01-02 21:55:31 +01:00

67 lines
2.7 KiB
HTML

{{ define "main" }}
{{ range .Params.topics }}
{{ partial "modal" . }}
{{ end }}
{{ if .Params.pretext.enable }}
{{ partial "modal" (dict "title" .Title "content" .Params.pretext.content) }}
{{ end }}
<section class="section" data-pagefind-body>
<div class="container">
{{ if or .Params.cantorpreisträger (where .Site.RegularPages "Title" (print "Abiturienten " .Params.Title ) ) }}
<div class="card-group">
{{ range where (where .Site.RegularPages "Title" .Params.Title ) "Type" "=" "cantorpreis" }}
<div class="card d-flex flex-row flex-wrap">
<a href="{{ .Permalink }}">
<img src="{{ .Params.Image | relURL }}" class="rounded-circle object-cover m-3" width="128px" height="128px">
</a>
<div class="flex-grow card-body min-w-0">
<a href="/cantorpreis"><h3 class="card-title">Cantorpreisträger</h3></a>
<a href="{{ .Permalink }}" class="h4 card-text">{{ .Params.name }}</a>
</div>
</div>
{{ end }}
{{ range where .Site.RegularPages "Title" (print "Abiturienten " .Params.Title ) }}
<div class="card d-flex flex-row flex-wrap-reverse">
<div class="flex-grow card-body min-w-0">
<a href="{{ .Permalink }}"><h3 class="card-title">{{ .Title }}</h3></a>
{{ range (getJSON "static/data/abiturdurchschnitte.json").abiturdurchschnitte }}
{{ if eq (string .jahr) $.Title }}<a href="/chronikseiten/abiturdurchschnitte" class="h4 card-text">Abiturdurchschnitt: {{ .schnitt }}</a>{{ end }}
{{ end }}
</div>
<a href="{{ .Permalink }}">
<img src="{{ .Params.Image | relURL }}" class="rounded-circle object-cover m-3" width="128px" height="128px">
</a>
</div>
{{ end }}
</div>
{{ end }}
<div class="kh-parent">
<div class="kh-jahr h1"
{{ if .Params.pretext.enable }}
onclick="$('{{ print `#` (md5 .Title) }}').modal('show')"
{{ end }}>
<span>{{ .Title }}</span>
</div>
{{ $topics := slice }}
{{ range .Params.topics }}
{{ $topics = $topics | append (dict "titleLength" (len .title) "topic" .) }}
{{ end }}
{{ range $id, $topic := sort $topics "titleLength" "desc" }}
<div class="kh h3" data-id="{{ $id }}"
{{ if not $topic.topic.superhaufen.enable }}
onclick="$('#{{ md5 $topic.topic.title }}').modal('show');"
{{ else }}
onclick="window.location = '{{ print (`/superhaufen/` | relURL ) ($topic.topic.superhaufen.link | urlize) }}';"
{{ end }}>
<span>{{ $topic.topic.title | safeHTML }}</span>
</div>
{{ end }}
</div>
</div>
</section>
{{ end }}