add popup banner format
All checks were successful
Website Prod/Test / Produktivumgebung (push) Successful in 16s
Website Prod/Test / Testumgebung (push) Successful in 8s

This commit is contained in:
Denys Konovalov 2025-01-16 12:05:19 +01:00
parent 54d7c00a45
commit edd6b67125
3 changed files with 20 additions and 10 deletions

View File

@ -1,16 +1,14 @@
top_banner:
enable: true
text: >+
text: |
Unser früherer Schüler Dominic Wagner verunglückte mit 17 Jahren schwer.
Seitdem braucht er 1:1 Pflege. Bitte unterstützen Sie die Finanzierung
dafür:
[https://www.gofundme.com/f/eigenanteil-der-pflegekosten](https://www.gofundme.com/f/eigenanteil-der-pflegekosten)
color: "#19aa96"
font_color: "#ffffff"
icon: plus-box
large: true
temporarily:
enable: false
start_date: 2024-11-29

View File

@ -85,9 +85,14 @@
</header>
{{ $top_banner := .Site.Data.homepage.top_banner }}
{{ if and $top_banner.enable }}
{{ if or (not $top_banner.temporarily.enable) (and $top_banner.temporarily.enable (and (le ($top_banner.temporarily.start_date | time.AsTime) now) (ge ($top_banner.temporarily.end_date | time.AsTime) now))) }}
{{ with $top_banner }}
{{ if and $top_banner.enable }}
{{ if or (not $top_banner.temporarily.enable) (and $top_banner.temporarily.enable (and (le ($top_banner.temporarily.start_date | time.AsTime) now) (ge ($top_banner.temporarily.end_date | time.AsTime) now))) }}
{{ with $top_banner }}
{{ if .large }}
{{ $title := "Willkommen auf der Website des Georg-Cantor-Gymnasiums!" }}
{{ partial "modal" (dict "title" $title "content" (.text | markdownify)) }}
<script>$(window).on("DOMContentLoaded", () => $('#{{ md5 $title }}').modal('show'));</script>
{{ else }}
<div id="top-banner" class="p-3" style="background: {{ .color }}" data-pagefind-ignore>
<div class="container">
<div class="no-gutters align-items-center">
@ -95,8 +100,9 @@
</div>
</div>
</div>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
<div id="pagefind-search" class="modal fade" data-pagefind-ignore>

View File

@ -57,6 +57,12 @@ const SettingsCollection = {
required: false,
},
IconList,
{
name: "large",
label: "Popup-Fenster (Vollbild)",
widget: "boolean",
required: false,
},
{
name: "temporarily",
label: "Zeitschaltung",