gcg-website/layouts/schulchronik/single.html

103 lines
4.2 KiB
HTML
Raw Normal View History

2022-03-18 13:35:57 +01:00
{{ define "main" }}
<section class="section-sm">
<div class="container">
<div class="row">
<div class="col-12 mb-4">
{{ if or .Params.Cantorpreisträger (where (where .Site.RegularPages "Title" (print "Abiturienten " .Params.Title ) ) "Type" "=" "abiturienten") }}
2023-01-11 11:32:19 +01:00
<div class="col-12">
<div class="card-group">
{{ range where (where .Site.RegularPages "Title" .Params.Title ) "Type" "=" "cantorpreis" }}
<div class="card">
<div class="row">
<div class="col-md-3 col-4">
<a href="{{ .Permalink }}"><img src="{{ .Params.Image | relURL }}" class="img-fluid rounded w-100" style="height:150px; object-fit: cover;"></a>
</div>
<div class="col-md-9 col-8 card-body">
<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>
</div>
{{ end }}
{{ range where (where .Site.RegularPages "Title" (print "Abiturienten " .Params.Title ) ) "Type" "=" "abiturienten" }}
<div class="card pe-0">
<div class="row">
<div class="col-7 card-body ps-4">
<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="col-5">
<a href="{{ .Permalink }}">
<img src="{{ .Params.Image | relURL }}" class="img-fluid rounded align-self-end w-100" style="height: 150px;object-fit: cover;">
</a>
</div>
</div>
</div>
{{ end }}
2023-01-11 11:32:19 +01:00
</div>
</div>
{{ end }}
2023-01-03 11:55:46 +00:00
{{ range .Params.topics }}
{{ partial "modal" . }}
2023-01-03 11:55:46 +00:00
{{ end }}
2023-02-09 19:58:09 +01:00
{{ if and .Params.pretext (ne .Params.pretext "\n\n\n") }}
{{ partial "modal" (dict "title" .Title "content" .Params.pretext) }}
2023-01-03 11:55:46 +00:00
{{ end }}
<div id="wc-canvas" class="wc-canvas"></div>
2023-02-28 08:37:51 +01:00
{{ $topics := slice }}
{{ if .Params.pretext }}
2023-04-23 14:14:40 +02:00
{{ $topics = $topics | append (slice (slice .Params.Title 200 (md5 .Title))) }}
2023-02-28 08:37:51 +01:00
{{ else }}
2023-04-23 14:14:40 +02:00
{{ $topics = $topics | append (slice (slice .Params.Title 200)) }}
2023-02-28 08:37:51 +01:00
{{ end }}
2023-01-03 11:55:46 +00:00
{{ range .Params.topics }}
2023-02-28 09:33:57 +01:00
{{ if .superhaufen.enable }}
2023-04-23 14:14:40 +02:00
{{ $topics = $topics | append (slice (slice .title 30 (.superhaufen.link | urlize) "superhaufen" )) }}
2023-02-28 08:37:51 +01:00
{{ else }}
2023-04-23 14:14:40 +02:00
{{ $topics = $topics | append (slice (slice .title 30 (md5 .title) )) }}
2023-02-28 08:37:51 +01:00
{{ end }}
2023-01-03 11:55:46 +00:00
{{ end }}
<script>
WordCloud(
document.getElementById('wc-canvas'),
{
click: function (item) {
if (item[1] != 200 || (item[1] == 200 && item[2] == '{{ md5 .Title }}')) {
2023-02-28 08:37:51 +01:00
if( item[3] == "superhaufen" ) {
2023-02-28 09:33:57 +01:00
window.location.href = "{{ `/superhaufen/` | relLangURL }}" + item[2];
2023-02-28 08:37:51 +01:00
} else {
$('#' + item[2]).modal('show');
}
2023-01-03 11:55:46 +00:00
}
},
color: function (word, weight) {
2023-02-28 08:37:51 +01:00
return (weight === 200) ? '#ffbc3b' : '#1a1a37';
},
/* hover: function(item, dimension, event) {
2023-02-28 08:37:51 +01:00
item && item[2] ? event.target.style.textDecorationLine = "underline" : null
},*/
2023-04-23 14:14:40 +02:00
fontFamily: 'Rubik, sans-serif',
2023-02-09 19:58:09 +01:00
fontWeight: 700,
2023-04-23 14:14:40 +02:00
list: JSON.parse("{{ $topics | jsonify }}"),
2023-01-03 11:55:46 +00:00
shrinkToFit: true,
2023-02-28 08:37:51 +01:00
gridSize: 50,
2023-01-03 11:55:46 +00:00
rotateRatio: 0,
2023-02-28 08:37:51 +01:00
shuffle: false,
shape: "square",
ellipticity: 1,
clearCanvas: true
2023-01-03 11:55:46 +00:00
}
);
</script>
2022-03-18 13:35:57 +01:00
{{ .Content }}
</div>
</div>
</div>
</section>
{{ end }}