gcg-website/layouts/schulchronik/single.html

94 lines
3.7 KiB
HTML
Raw Normal View History

2022-03-18 13:35:57 +01:00
{{ define "main" }}
2023-06-11 21:13:11 +02:00
<section class="section">
2023-07-29 13:16:25 +02:00
<!-- TODO: everything -->
2022-03-18 13:35:57 +01:00
<div class="container">
2023-07-29 13:16:25 +02:00
{{ if or .Params.cantorpreisträger (where (where .Site.RegularPages "Title" (print "Abiturienten " .Params.Title ) ) "Type" "=" "abiturienten") }}
<div class="card-group">
{{ range where (where .Site.RegularPages "Title" .Params.Title ) "Type" "=" "cantorpreis" }}
<div class="card d-flex flex-row flex-wrap">
<div class="flex-shrink-0">
<a href="{{ .Permalink }}"><img src="{{ .Params.Image | relURL }}" class="rounded-circle m-3 object-cover" height="128px" width="128px"></a>
2023-01-11 11:32:19 +01:00
</div>
2023-07-29 13:16:25 +02:00
<div class="flex-grow card-body min-w-0">
<a href="/cantorpreis"><h3 class="card-title">Cantorpreisträger:in</h3></a>
<a href="{{ .Permalink }}"><p class="h4 card-text">{{ .Params.name }}</p></a>
</div>
2023-01-11 11:32:19 +01:00
</div>
{{ end }}
2023-07-29 13:16:25 +02:00
{{ range where (where .Site.RegularPages "Title" (print "Abiturienten " .Params.Title ) ) "Type" "=" "abiturienten" }}
<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>
{{ $abiturdurchschnitte := getJSON "static/data/abiturdurchschnitte.json" }}
{{ range $abiturdurchschnitte.abiturdurchschnitte }}
{{ if eq (string (index . "jahr")) "2008" }}<a href="/chronikseiten/abiturdurchschnitte"><p class="h4 card-text">Abiturdurchschnitt: {{ .schnitt }}</p></a>{{ end }}
{{ end }}
</div>
<div class="">
<a href="{{ .Permalink }}">
<img src="{{ .Params.Image | relURL }}" class="rounded-circle object-cover m-3" width="128px" height="128px">
</a>
</div>
2022-03-18 13:35:57 +01:00
</div>
2023-07-29 13:16:25 +02:00
{{ end }}
{{ end }}
{{ range .Params.topics }}
{{ partial "modal" . }}
{{ end }}
{{ if and .Params.pretext (ne .Params.pretext "\n\n\n") }}
{{ partial "modal" (dict "title" .Title "content" .Params.pretext) }}
{{ end }}
<div id="wc-canvas"></div>
{{ $topics := slice }}
{{ if .Params.pretext }}
{{ $topics = $topics | append (slice (slice .Params.Title 200 (md5 .Title))) }}
{{ else }}
{{ $topics = $topics | append (slice (slice .Params.Title 200)) }}
{{ end }}
{{ range .Params.topics }}
{{ if .superhaufen.enable }}
{{ $topics = $topics | append (slice (slice .title 30 (.superhaufen.link | urlize) "superhaufen" )) }}
{{ else }}
{{ $topics = $topics | append (slice (slice .title 30 (md5 .title) )) }}
{{ end }}
{{ end }}
<script>
WordCloud(
document.getElementById('wc-canvas'),
{
click: function (item) {
if (item[1] != 200 || (item[1] == 200 && item[2] == '{{ md5 .Title }}')) {
if( item[3] == "superhaufen" ) {
window.location.href = "{{ `/superhaufen/` | relURL }}" + item[2];
} else {
$('#' + item[2]).modal('show');
}
}
},
color: function (word, weight) {
return (weight === 200) ? '#ffbc3b' : '#1a1a37';
},
/* hover: function(item, dimension, event) {
item && item[2] ? event.target.style.textDecorationLine = "underline" : null
},*/
fontFamily: 'Ubuntu, sans-serif',
fontWeight: 700,
list: JSON.parse("{{ $topics | jsonify }}"),
shrinkToFit: true,
gridSize: 50,
rotateRatio: 0,
shuffle: false,
shape: "square",
ellipticity: 1,
clearCanvas: true
}
);
</script>
{{ .Content }}
</div>
2022-03-18 13:35:57 +01:00
</div>
</section>
{{ end }}