gcg-website/layouts/fachbereich/single.html
2023-05-04 14:38:48 +02:00

70 lines
2.4 KiB
HTML

{{ define "main" }}
<section class="section-sm pb-0">
<div class="container">
<div class="row">
<div class="col-12 mb-4 content">
{{ .Content }}
</div>
</div>
</div>
<div class="container">
<div class="row">
{{ range .Params.tiles }}
<div id="{{ md5 .title }}" class="modal">
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ .title }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="content">
{{ .content | markdownify }}
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-6">
<div class="card border-primary rounded-0 hover-shadow mb-5">
<div class="container fb-tile-color" style="background-color:{{ .bg_color }};">
<i class="{{ .icon }} fb-tile-icon" style="color: {{ .font_color }};"></i>
</div>
<div class="card-body">
<h4 class="card-title">{{ .title | truncate 32 }}</h4>
<button type="button" class="btn btn-primary btn-sm" onclick="$('#{{ md5 .title }}').modal('show');">{{
i18n "show_more"}}</button>
</div>
</div>
</div>
{{ end }}
</div>
</div>
</section>
<section class="section pt-0 pb-0">
<div class="container">
<div class="row">
<div class="col-12">
<h2 class="section-title">Aktuelles aus dem Fach {{ .Title }}</h3>
</div>
</div>
<div class="row">
{{ $news := (where .Site.RegularPages "Type" "post") | intersect (where .Site.RegularPages ".Params.subjects"
"intersect" (slice .Title) ) }}
{{ range first 3 $news }}
<div class="col-lg-4 col-sm-6 mb-5">
{{ .Render "post"}}
</div>
{{ end }}
{{ if eq (len $news) 0 }}
<p class="col-12">Leider wurden noch keine Artikel zu diesem Fach veröffentlicht. Folgen Sie dem Georg-Cantor-Gymnasium über eines der Informationskanäle, um stets auf dem neusten Stand zu bleiben!</p>
{{ end }}
</div>
</div>
</section>
{{ end }}