CMS refactor

This commit is contained in:
Denys Konovalov 2023-05-29 16:22:34 +02:00
parent 09a33fd70c
commit b66a27e3b9
110 changed files with 4668 additions and 3736 deletions

@ -268,12 +268,13 @@ languages:
languageName: De
languageCode: de-de
contentDir: content/german
weight: 2
home: Startseite
weight: 1
copyright: "Copyright © 2023 Georg-Cantor-Gymnasium Halle (Saale). Made
with :heart: and [Hugo](https://gohugo.io)."
impressumURL: pages/impressum
dseURL: pages/datenschutz
params:
home: Startseite
impressumURL: pages/impressum
dseURL: pages/datenschutz
privacy:
disqus:
disable: true

@ -4,7 +4,8 @@ date: 2023-04-19T12:55:48.540+02:00
draft: false
description: ""
image: /media/wettbewerbe/bwfs.webp
author: Frau Berthelmann
author:
- frau-berthelmann
categories:
- Wettbewerbe
- Fremdsprachen

@ -4,7 +4,8 @@ date: 2022-10-24T14:40:47.927Z
draft: false
description: ""
image: /media/image.webp
author: Schulleitung
author:
- schulleitung
categories:
- Veranstaltungen
subjects: []

@ -4,7 +4,8 @@ date: 2023-03-03T00:00:00.000+01:00
draft: false
description: ""
image: /media/blog/2023/cantorpreis/cp23_01.webp
author: Herr Berger
author:
- herr-berger
categories:
- Traditionen
- Veranstaltungen

@ -4,7 +4,8 @@ date: 2023-03-03T12:08:52+01:00
draft: false
description: ""
image: /media/blog/2023/modul-chemie-11.webp
author: Chiamaka Michelle Okoro
author:
- chiamaka-michelle-okoro
categories:
- Naturwissenschaften
subjects:

@ -4,7 +4,8 @@ date: 2023-02-23T17:01:33+01:00
draft: false
description: ""
image: /media/blog/2023/modul-chemie.webp
author: Erik Zschoche
author:
- erik-zschoche
categories:
- Naturwissenschaften
subjects:

@ -4,7 +4,8 @@ date: 2023-04-11T21:26:25.198+02:00
draft: false
description: ""
image: /media/image.webp
author: Frau Henke
author:
- frau-henke
categories:
- Naturwissenschaften
- Wettbewerbe

@ -4,7 +4,8 @@ date: 2023-03-13T22:02:51+01:00
draft: false
description: ""
image: /media/wettbewerbe/pho.webp
author: Denys Konovalov
author:
- denys-konovalov
categories:
- Naturwissenschaften
- Wettbewerbe

@ -4,7 +4,8 @@ date: 2023-01-22T16:14:48+01:00
draft: false
description: ""
image: /media/blog/gypt.webp
author: Denys Konovalov
author:
- denys-konovalov
categories:
- Wettbewerbe
- Naturwissenschaften

@ -4,7 +4,8 @@ date: 2023-02-03T07:48:30+01:00
draft: false
description: ""
image: /media/wettbewerbe/chemkids.webp
author: Herr Berger
author:
- herr-berger
categories:
- Wettbewerbe
- Naturwissenschaften

@ -4,7 +4,8 @@ date: 2023-02-21T09:44:35+01:00
draft: false
description: ""
image: /media/wettbewerbe/icho.webp
author: Herr Berger
author:
- herr-berger
categories:
- Wettbewerbe
- Naturwissenschaften

@ -4,7 +4,8 @@ date: 2023-02-14T21:49:04+01:00
draft: false
description: ""
image: /media/wettbewerbe/ipho.webp
author: Frau Bachran
author:
- frau-bachran
categories:
- Naturwissenschaften
- Wettbewerbe

@ -4,7 +4,8 @@ date: 2023-03-05T18:47:59+01:00
draft: false
description: ""
image: /media/blog/festwoche.webp
author: Herr Berger
author:
- herr-berger
categories:
- Veranstaltungen
- Traditionen

@ -4,7 +4,8 @@ date: 2022-10-19T16:04:15.580Z
draft: false
description: ""
image: /media/image.webp
author: Frau Schapitz
author:
- frau-schapitz
categories:
- Sonstiges
- Informatik/Technik

@ -4,7 +4,8 @@ date: 2022-11-24T09:41:02.882Z
draft: false
description: ""
image: /media/image.webp
author: Herr Berger
author:
- herr-berger
categories:
- Veranstaltungen
subjects: []

@ -4,7 +4,8 @@ date: 2023-01-27T21:42:51+01:00
draft: false
description: ""
image: /media/wettbewerbe/biber.webp
author: Herr Berger
author:
- herr-berger
categories:
- Wettbewerbe
- Informatik/Technik

@ -4,7 +4,8 @@ date: 2023-05-21T17:34:47.943+02:00
draft: false
description: ""
image: /media/blog/2023/jufo_bundesfinale_bremen_23/jufo_bf23_01.webp
author: Frau Felke
author:
- frau-felke
categories:
- Wettbewerbe
- Naturwissenschaften

@ -4,7 +4,8 @@ date: 2023-02-22T11:08:22+01:00
draft: false
description: ""
image: /media/wettbewerbe/jufo.webp
author: Frau Felke
author:
- frau-felke
categories:
- Wettbewerbe
- Naturwissenschaften

@ -4,7 +4,8 @@ date: 2023-03-31T09:42:39.466+02:00
draft: false
description: ""
image: /media/wettbewerbe/jufo.webp
author: Frau Felke
author:
- frau-felke
categories:
- Wettbewerbe
- Naturwissenschaften

@ -4,7 +4,8 @@ date: 2023-04-12T22:40:16.690+02:00
draft: false
description: ""
image: /media/wettbewerbe/kanguru.webp
author: Frau Jacob
author:
- frau-jacob
categories:
- Wettbewerbe
- Mathematik

@ -4,7 +4,8 @@ date: 2023-05-03T07:53:14.221+02:00
draft: false
description: ""
image: /media/wettbewerbe/jugenddebattiert.webp
author: Herr Berger
author:
- herr-berger
categories:
- Deutsch
- Gesellschaftswissenschaften

@ -4,7 +4,8 @@ date: 2023-03-19T14:08:31+01:00
draft: false
description: ""
image: /media/blog/2023/lernfahrt_geschichte.webp
author: Frau Krug
author:
- frau-krug
categories:
- Gesellschaftswissenschaften
subjects:

@ -5,7 +5,8 @@ draft: false
description: Der Schülerwettbewerb unter der Schirmherrschaft des
Bildungsministeriums geht in die nächste Runde.
image: /media/blog/mia.webp
author: Denys Konovalov
author:
- denys-konovalov
categories:
- Wettbewerbe
- Mathematik

@ -4,7 +4,8 @@ date: 2023-02-28T22:44:44+01:00
draft: false
description: ""
image: /media/wettbewerbe/mo.webp
author: Herr Berger
author:
- herr-berger
categories:
- Wettbewerbe
- Mathematik

@ -4,7 +4,8 @@ date: 2023-04-23T14:18:13.497+02:00
draft: false
description: ""
image: /media/blog/2023/abitag/04.webp
author: Herr Berger
author:
- herr-berger
categories:
- Traditionen
tags:

@ -4,7 +4,8 @@ date: 2023-01-24T08:18:02+01:00
draft: false
description: ""
image: /media/image.webp
author: Herr Berger
author:
- herr-berger
categories:
- Musik
- Deutsch

@ -4,7 +4,8 @@ date: 2022-12-10T12:30:33+01:00
draft: false
description: ""
image: /media/image.webp
author: Frau Krug
author:
- frau-krug
categories:
- Musik
- Traditionen

@ -4,7 +4,8 @@ date: 2023-03-15T09:05:16+01:00
draft: false
description: ""
image: /media/wettbewerbe/jugenddebattiert.webp
author: Frau Opel-Fritzlar
author:
- frau-opel-fritzlar
categories:
- Wettbewerbe
- Deutsch

@ -4,7 +4,8 @@ date: 2023-03-21T07:56:46+01:00
draft: false
description: ""
image: /media/blog/rezi_wettstreit.webp
author: Herr Berger
author:
- herr-berger
categories:
- Wettbewerbe
- Traditionen

@ -4,7 +4,8 @@ date: 2023-02-11T11:28:18+01:00
draft: false
description: ""
image: /media/wettbewerbe/jugenddebattiert.webp
author: Frau Schulz
author:
- frau-schulz
categories:
- Wettbewerbe
- Gesellschaftswissenschaften

@ -4,7 +4,8 @@ date: 2023-02-21T20:09:03+01:00
draft: false
description: ""
image: /media/blog/2023/skilager.webp
author: Frau Tuppack
author:
- frau-tuppack
categories:
- Traditionen
- Sport

@ -4,7 +4,8 @@ date: 2023-01-19T19:13:48+01:00
draft: false
description: ""
image: /media/blog/2023/spezilager/01.webp
author: Franziska Berner
author:
- franziska-berner
categories:
- Wettbewerbe
- Mathematik

@ -4,7 +4,8 @@ date: 2023-05-16T21:40:40.773+02:00
draft: false
description: ""
image: /media/blog/2023/tdk.webp
author: Herr Berger
author:
- herr-berger
categories:
- Traditionen
- Schülerrat

@ -4,7 +4,8 @@ date: 2023-01-24T15:13:45+01:00
draft: false
description: ""
image: /media/wettbewerbe/toefl.webp
author: Herr Berger
author:
- herr-berger
categories:
- Wettbewerbe
- Fremdsprachen

@ -4,7 +4,8 @@ date: 2023-05-03T16:11:27.148+02:00
draft: false
description: ""
image: /media/image.webp
author: Denys Konovalov
author:
- denys-konovalov
categories:
- Schülerrat
tags:

@ -4,7 +4,8 @@ date: 2022-12-12T12:00:43.329Z
draft: false
description: ""
image: /media/blog/vlw.webp
author: Herr Berger
author:
- herr-berger
categories:
- Wettbewerbe
- Deutsch

@ -4,7 +4,8 @@ date: 2022-12-20T20:40:32.790Z
draft: false
description: ""
image: /media/blog/weihnachten.webp
author: Herr Berger
author:
- herr-berger
categories:
- Traditionen
- Schülerrat

@ -4,7 +4,8 @@ date: 2023-03-30T11:07:03.082+02:00
draft: false
description: ""
image: /media/image.webp
author: Herr Berger
author:
- herr-berger
categories:
- Wettbewerbe
- Naturwissenschaften

@ -1,6 +1,7 @@
enable: true
title: Ausblick auf die Woche
author: Frau Felke
author:
- frau-felke
image: /media/ausblick.webp
content: >
Wir hoffen, dass alle erholt aus den Ferien kommen und frisch in die letzte

@ -99,11 +99,13 @@ about:
blog:
enable: true
title: Aktuelles
number: 2
success_banner:
enable: true
image: media/home/success_banner.webp
feature_item:
- name: Mathematik-Olympiade
- type: image
name: Mathematik-Olympiade
content: >
In der Landesrunde der [Mathematikolympiade
2023](https://cantorgymnasium.de/blog/mathematik-olympiade-landesrunde-2023/)
@ -121,8 +123,8 @@ success_banner:
an Schüler unserer Schule verliehen.
image: media/home/mo.webp
icon: ""
- name: Physikolympiade
- type: image
name: Physikolympiade
image: media/home/po.webp
content: >
In der [Landesphysikolympiade
@ -140,32 +142,36 @@ success_banner:
an Schüler unserer Schule verliehen.
icon: ""
- name: Chemieolympiade
- type: image
name: Chemieolympiade
image: media/home/icho.webp
content: >
Ein Schüler unserer Schule bekam die Bronzemedaille in der
Internationalen Chemieolympiade 2020 verliehen. Ein weiterer Schüler
unserer Schule wurde für die Nationalmannschaft für die IChO 2021
ausgewählt.
icon: ""
- content: >
- type: image
content: >
Ein Schüler unserer Schule bekam in der Endrunde von "Chemie - die
stimmt!" 2021 den ersten Platz in drei Kategorien.
name: Chemie - die stimmt!
image: media/home/cds.webp
icon: ""
- name: Und viel mehr ...
- type: icon
name: Und viel mehr ...
icon: mdi mdi-trophy-outline
content: >
Durch umfassende Begabtenförderungsangebote sind unsere Schüler bei
vielen Wettbewerben erfolgreich. Diese umfassen erweiterte Stoffgebiete,
Spezialistenlager und begabtenfördernde Ganztagsangebote.
img: false
image: ""
- type: image
name: uztr
image: /media/logo_lg_blue.webp
content: |
ttttt
ganztagsangebote:
enable: true
title: Unsere Ganztagsangebote
number: 6
cta:
enable: true
title: Interessiert ?
@ -195,6 +201,7 @@ info:
termine:
enable: true
title: Anstehende Termine
number: 1
digitalpakt:
enable: true
title: DigitalPakt Schule

@ -5,7 +5,8 @@
<div class="col-6"><i class="mdi mdi-calendar-today me-2"></i>{{ time.Format "02. Jan 2006" .PublishDate }}</div>
<div class="col-6 text-truncate">
<i class="mdi mdi-fountain-pen-tip me-2"></i>
{{ range where (where .Site.RegularPages "Type" "author") "Title" .Params.author }}
{{ range $index, $elements := where (where .Site.RegularPages "Type" "author") "File.BaseFileName" "in" .Params.author }}
{{ if ne $index 0 }}, {{ end }}
{{ if .Params.simplified }}
{{ .Title }}
{{ else }}

@ -12,7 +12,8 @@
<div class="row mb-3">
<div class="col-6 mb-md-0 text-light">
<span class="fw-bold me-1">{{ i18n "posted_by" }}:</span>
{{ range where (where .Site.RegularPages "Type" "author") "Title" .Params.author }}
{{ range $index, $elements := where (where .Site.RegularPages "Type" "author") "File.BaseFileName" "in" .Params.author }}
{{ if ne $index 0 }}, {{ end }}
{{ if .Params.simplified }}
{{ .Title }}
{{ else }}
@ -28,7 +29,7 @@
<div class="row">
<div class="col-12 mb-md-0 text-light">
<span class="fw-bold me-1">{{ i18n "category" }}:</span>
{{ range $index, $elements:= .Params.categories }}
{{ range $index, $elements := .Params.categories }}
{{ if ne $index 0 }}, {{ end }}
<a href="{{ `categories/` | relLangURL }}{{ . | urlize | lower }}">{{ . | title }}</a>
{{ end }}

@ -122,9 +122,10 @@
<img class="card-img-top rounded-0" src="{{ $data.ausblick.image | relURL }}" alt="{{ $data.ausblick.title }}" onclick="$('#{{ md5 $data.ausblick.title }}').modal('show');">
<div class="card-body d-flex flex-column">
<div class="row mb-2">
<div class="col-6">
<div class="col-12">
<i class="mdi mdi-fountain-pen-tip me-2"></i>
{{ range where (where .Site.RegularPages "Type" "author") "Title" $data.ausblick.author }}
{{ range $index, $elements := where (where .Site.RegularPages "Type" "author") "File.BaseFileName" "in" $data.ausblick.author }}
{{ if ne $index 0 }}, {{ end }}
{{ if .Params.simplified }}
{{ .Title }}
{{ else }}
@ -140,7 +141,7 @@
</div>
</div>
</div>
{{ range first 2 (where .Site.RegularPages "Type" "post")}}
{{ range first (int $data.homepage.blog.number) (where .Site.RegularPages "Type" "post")}}
<div class="col-lg-4 col-sm-6 mb-4 mb-lg-0 d-flex align-items-stretch">
{{ .Render "card" }}
</div>
@ -194,7 +195,7 @@
</div>
</div>
<div class="row justify-content-center">
{{ range first 6 (where .Site.RegularPages "Type" "ganztagsangebote" | shuffle)}}
{{ range first (int $data.homepage.ganztagsangebote.number) (where .Site.RegularPages "Type" "ganztagsangebote" | shuffle)}}
<div class="col-lg-4 col-sm-6">
{{ .Render "ganztag" }}
</div>
@ -258,7 +259,7 @@
{{ end }}
{{ end }}
{{ range first 3 $events }}
{{ range first (int $data.homepage.termine.number) $events }}
{{ partial "termin" . }}
{{ end }}

File diff suppressed because it is too large Load Diff

@ -2,53 +2,55 @@ import { MarkdownProps } from "../props.js";
import { DraftBoolean, Title } from "./widgets.js";
const AbiturientenCollection = {
name: "abiturienten",
label: "Abiturienten",
label_singular: "Abiturjahrgang",
description: "Hier kann die Übersicht der Abiturjahrgänge bearbeitet werden. Dieser Bereich wird von der Schulchronik verwaltet.",
icon: "graduation-cap",
folder: "content/german/abiturienten",
filter: {
field: "type",
value: "abiturienten"
name: "abiturienten",
label: "Abiturienten",
label_singular: "Abiturjahrgang",
description:
"Hier kann die Übersicht der Abiturjahrgänge bearbeitet werden. Dieser Bereich wird von der Schulchronik verwaltet.",
icon: "graduation-cap",
folder: "content/german/abiturienten",
filter: {
field: "type",
value: "abiturienten",
},
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
summary_fields: ["title", "draft"],
sortable_fields: {
fields: ["title"],
default: {
field: "title",
direction: "Descending",
},
create: true,
editor: {
preview: true,
frame: true
},
fields: [
Title(false),
DraftBoolean,
{
name: "image",
label: "Bild",
widget: "image",
default: "/media/image.webp",
required: false,
},
summary_fields: ["title", "draft"],
sortable_fields: {
fields: ["title"],
default: {
field: "title",
direction: "Descending"
}
{
name: "type",
label: "Typ",
widget: "hidden",
default: "abiturienten",
},
fields: [
Title(false),
DraftBoolean,
{
name: "image",
label: "Bild",
widget: "image",
default: "/media/image.webp",
required: false
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "abiturienten"
},
{
name: "body",
label: "Text",
widget: "markdown",
required: false,
...MarkdownProps
}
]
{
name: "body",
label: "Text",
widget: "markdown",
required: false,
...MarkdownProps,
},
],
};
export default AbiturientenCollection;
export default AbiturientenCollection;

@ -0,0 +1,100 @@
import { MarkdownProps, PatternEmail } from "../props.js";
import { DescriptionText } from "./widgets.js";
const AuthorCollection = {
name: "author",
label: "Autoren",
label_singular: "Autor",
description:
"Autoren können einem Blogartikel zugewiesen werden. Wir unterscheiden in aktive und inaktive sowie vereinfachte Autoren, welche nur mit dem Namen angezeigt werden, und erweiterte Autoren, für die eine Übersichtsseite angelegt wird.Autoren können einem Blogartikel zugewiesen werden.",
icon: "user",
folder: "content/german/author",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: {
field: "type",
value: "author",
},
view_filters: [
{
label: "aktiv",
field: "active",
pattern: true,
},
{
label: "inaktiv",
field: "active",
pattern: false,
},
{
label: "einfach",
field: "simplified",
pattern: true,
},
{
label: "erweitert",
field: "simplified",
pattern: false,
},
],
view_groups: [
{
label: "vereinfacht",
field: "simplified",
},
{
label: "aktiv",
field: "active",
},
],
summary_fields: ["title", "active", "simplified", "body"],
fields: [
{
name: "title",
label: "Name",
widget: "string",
required: true,
},
DescriptionText,
{
name: "email",
label: "E-Mail-Adresse",
widget: "string",
required: false,
...PatternEmail,
},
{
name: "image",
label: "Bild",
widget: "image",
required: false,
default: "/media/authors/gcg.webp",
},
{
name: "simplified",
label: "vereinfacht",
widget: "boolean",
required: false,
},
{
name: "active",
label: "aktiv",
widget: "boolean",
required: false,
default: true,
},
{
name: "body",
label: "Beschreibung",
widget: "markdown",
required: false,
...MarkdownProps,
},
],
};
export default AuthorCollection;

@ -0,0 +1,62 @@
import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const BegabteCollection = {
name: "begabte",
label: "Begabtenförderung",
label_singular: "Begabtenförderungsangebot",
description:
"Hier kann die Übersicht der Begabtenförderungsangebote bearbeitet werden.",
icon: "pi",
folder: "content/german/begabte",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: {
field: "type",
value: "begabte",
},
summary_fields: ["title", "draft", "body"],
fields: [
Title(false),
DraftBoolean,
DescriptionText,
{
name: "image",
label: "Titelbild",
widget: "image",
required: true,
default: "/media/image.webp",
},
{
name: "class",
label: "Klassenstufe(n)",
widget: "string",
required: true,
},
{
name: "web_url",
label: "Website",
widget: "string",
required: false,
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "begabte",
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: true,
...MarkdownProps,
},
],
};
export default BegabteCollection;

@ -0,0 +1,114 @@
import { DateFormat, MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const BlogCollection = {
name: "blog",
label: "Aktuelles",
label_singular: "Artikel",
description:
'Diese Artikel werden im Bereich "Aktuelles" auf der Schulhomepage angezeigt. Sie können sowohl direkt veröffentlicht, als auch als Entwurf gespeichert werden.',
icon: "news",
folder: "content/german/blog",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: {
field: "type",
value: "post",
},
view_groups: [
{
label: "Entwurf",
field: "draft",
},
],
sortable_fields: {
fields: ["date", "title"],
default: {
field: "date",
direction: "Descending",
},
},
summary_fields: ["date", "title", "draft", "author", "body"],
fields: [
Title(false),
{
name: "date",
label: "Datum",
widget: "datetime",
required: true,
...DateFormat,
},
DraftBoolean,
DescriptionText,
{
name: "image",
label: "Titelbild",
widget: "image",
required: true,
default: "/media/image.webp",
},
{
name: "author",
label: "Autor(en)",
hint: "Verwaltet im Autoren-Bereich. Mehrere Autoren werden in alphabetischer Reihenfolge aufgelistet.",
widget: "relation",
collection: "author",
value_field: "{{slug}}",
search_fields: ["{{title}}"],
display_fields: ["{{title}}"],
multiple: true,
required: true,
},
{
name: "categories",
label: "Kategorien",
hint: "Verwaltet in den Einstellungen",
widget: "relation",
collection: "settings",
file: "data-categories",
value_field: "blog.*",
search_fields: ["blog.*"],
display_fields: ["blog.*"],
multiple: true,
required: true,
},
{
name: "subjects",
label: "Fächer",
hint: "Verwaltet in den Einstellungen",
widget: "relation",
collection: "settings",
file: "data-categories",
value_field: "subjects.*",
search_fields: ["subjects.*"],
display_fields: ["subjects.*"],
multiple: true,
required: true,
},
{
name: "tags",
label: "Tags",
widget: "list",
delimiter: ",",
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "post",
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: true,
...MarkdownProps,
},
],
};
export default BlogCollection;

@ -2,70 +2,72 @@ import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const CantorforaCollection = {
name: "cantorfora",
label: "Cantorfora",
label_singular: "Cantorforum",
description: "Hier kann die Übersicht der Cantorfora bearbeitet werden. Dieser Bereich wird von der Schulchronik verwaltet.",
icon: "presentation",
folder: "content/german/cantorfora",
filter: {
field: "type",
value: "cantorfora"
name: "cantorfora",
label: "Cantorfora",
label_singular: "Cantorforum",
description:
"Hier kann die Übersicht der Cantorfora bearbeitet werden. Dieser Bereich wird von der Schulchronik verwaltet.",
icon: "presentation",
folder: "content/german/cantorfora",
filter: {
field: "type",
value: "cantorfora",
},
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
view_groups: [
{
label: "Entwürfe",
field: "draft",
},
create: true,
editor: {
preview: true,
frame: true
],
summary_fields: ["title", "draft", "description"],
sortable_fields: {
fields: ["index", "title"],
default: {
field: "index",
direction: "Descending",
},
view_groups: [
{
label: "Entwürfe",
field: "draft"
}
],
summary_fields: ["title", "draft", "description"],
sortable_fields: {
fields: ['index', 'title'],
default: {
field: "index",
direction: "Descending"
}
},
fields: [
Title(false),
{
name: "index",
label: "Laufindex",
hint: "Nummer des Cantorforums",
widget: "number",
value_type: "int",
min: 1,
step: 1,
required: true,
},
fields: [
Title(false),
{
name: "index",
label: "Laufindex",
hint: "Nummer des Cantorforums",
widget: "number",
value_type: "int",
min: 1,
step: 1,
required: true
},
DraftBoolean,
DescriptionText,
{
name: "image",
label: "Titelbild",
widget: "image",
default: "/media/image.webp",
required: true
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "cantorfora"
},
{
name: "body",
label: "Text",
widget: "markdown",
required: true,
...MarkdownProps
}
]
DraftBoolean,
DescriptionText,
{
name: "image",
label: "Titelbild",
widget: "image",
default: "/media/image.webp",
required: true,
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "cantorfora",
},
{
name: "body",
label: "Text",
widget: "markdown",
required: true,
...MarkdownProps,
},
],
};
export default CantorforaCollection;
export default CantorforaCollection;

@ -2,65 +2,67 @@ import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean } from "./widgets.js";
const CantorpreisCollection = {
name: "cantorpreis",
label: "Cantorpreisträger",
description: "Hier sind alle Cantorpreisträger aufgelistet. Dieser Bereich wird von der Schulchronik verwaltet.",
icon: "award",
folder: "content/german/cantorpreis",
filter: {
field: "type",
value: "cantorpreis"
name: "cantorpreis",
label: "Cantorpreisträger",
description:
"Hier sind alle Cantorpreisträger aufgelistet. Dieser Bereich wird von der Schulchronik verwaltet.",
icon: "award",
folder: "content/german/cantorpreis",
filter: {
field: "type",
value: "cantorpreis",
},
sortable_fields: {
fields: ["title", "name"],
default: {
field: "title",
direction: "Descending",
},
sortable_fields: {
fields: ['title', 'name'],
default: {
field: "title",
direction: "Descending"
}
},
summary: "{{title}} - {{name}}",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
summary_fields: ["title", "name", "draft", "body"],
fields: [
{
name: "title",
label: "Jahr",
widget: "string",
required: true,
},
summary: "{{title}} - {{name}}",
create: true,
editor: {
preview: true,
frame: true
{
name: "name",
label: "Name",
widget: "string",
required: true,
},
summary_fields: ["title", "name", "draft", "body"],
fields: [
{
name: "title",
label: "Jahr",
widget: "string",
required: true
},
{
name: "name",
label: "Name",
widget: "string",
required: true
},
DraftBoolean,
DescriptionText,
{
name: "image",
label: "Bild",
widget: "image",
default: "/media/image.webp",
required: false
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "cantorpreis"
},
{
name: "body",
label: "Text",
widget: "markdown",
required: false,
...MarkdownProps
}
]
DraftBoolean,
DescriptionText,
{
name: "image",
label: "Bild",
widget: "image",
default: "/media/image.webp",
required: false,
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "cantorpreis",
},
{
name: "body",
label: "Text",
widget: "markdown",
required: false,
...MarkdownProps,
},
],
};
export default CantorpreisCollection;
export default CantorpreisCollection;

@ -2,110 +2,111 @@ import { MarkdownProps } from "../props.js";
import { DraftBoolean, EnableBoolean } from "./widgets.js";
const ChronikjahreCollection = {
name: "chronikjahre",
description: "Hier können die Chronikjahre bearbeitet werden. Dieser Bereich wird von der Schulchronik verwaltet.",
icon: "schulchronik",
label: "Chronikjahre",
label_singular: "Chronikjahr",
folder: "content/german/schulchronik",
filter: {
field: "type",
value: "schulchronik"
name: "chronikjahre",
description:
"Hier können die Chronikjahre bearbeitet werden. Dieser Bereich wird von der Schulchronik verwaltet.",
icon: "schulchronik",
label: "Chronikjahre",
label_singular: "Chronikjahr",
folder: "content/german/schulchronik",
filter: {
field: "type",
value: "schulchronik",
},
create: true,
editor: {
preview: false,
size: "half",
},
summary_fields: ["title", "draft", "cantorpreisträger", "topics"],
sortable_fields: {
fields: ["title"],
default: {
field: "title",
direction: "Descending",
},
create: true,
editor: {
preview: false
},
fields: [
{
name: "title",
label: "Jahr",
widget: "string",
},
summary_fields: ["title", "draft", "cantorpreisträger", "topics"],
sortable_fields: {
fields: ['title'],
default: {
field: "title",
direction: "Descending"
}
DraftBoolean,
{
name: "type",
label: "Typ",
widget: "hidden",
default: "schulchronik",
},
fields: [
{
name: "pretext",
label: "Einleitung",
hint: "Text für die Jahreszahl",
widget: "markdown",
required: false,
...MarkdownProps,
},
{
name: "topics",
label: "Kreative Haufen",
label_singular: "Haufen",
widget: "list",
required: false,
collapsed: true,
fields: [
{
name: "title",
label: "Jahr",
widget: "string"
},
DraftBoolean,
{
name: "type",
label: "Typ",
widget: "hidden",
default: "schulchronik"
name: "title",
label: "Titel",
widget: "string",
required: true,
},
{
name: "pretext",
label: "Einleitung",
hint: "Text für die Jahreszahl",
widget: "markdown",
required: false,
...MarkdownProps
name: "content",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps,
},
{
name: "topics",
label: "Kreative Haufen",
label_singular: "Haufen",
widget: "list",
required: false,
collapsed: true,
fields: [
{
name: "title",
label: "Titel",
widget: "string",
required: true,
},
{
name: "content",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps
},
{
name: "superhaufen",
label: "Superhaufen",
widget: "object",
required: false,
fields: [
EnableBoolean,
{
name: "link",
label: "Superhaufen",
widget: "relation",
collection: "superhaufen",
search_fields: ["title"],
value_field: "title",
required: false,
collapsed: true
}
]
}
]
name: "superhaufen",
label: "Superhaufen",
widget: "object",
required: false,
fields: [
EnableBoolean,
{
name: "link",
label: "Superhaufen",
widget: "relation",
collection: "superhaufen",
search_fields: ["title"],
value_field: "title",
required: false,
collapsed: true,
},
],
},
{
name: "cantorpreisträger",
label: "Cantorpreisträger",
widget: "relation",
collection: "cantorpreis",
search_fields: ["jahr", "name"],
value_field: "name",
required: false
},
{
name: "body",
label: "Text",
hint: "Erscheint zusätzlich zu den Kreativen Haufen",
widget: "markdown",
required: false,
...MarkdownProps
}
],
},
{
name: "cantorpreisträger",
label: "Cantorpreisträger",
widget: "relation",
collection: "cantorpreis",
search_fields: ["jahr", "name"],
value_field: "name",
required: false,
},
{
name: "body",
label: "Text",
hint: "Erscheint zusätzlich zu den Kreativen Haufen",
widget: "markdown",
required: false,
...MarkdownProps,
},
],
};
]
}
export default ChronikjahreCollection;
export default ChronikjahreCollection;

@ -2,55 +2,57 @@ import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const ChronikseitenCollection = {
name: "chronikseiten",
label: "Chronikseiten",
label_singular: "Zusatzseite (Chronik)",
description: "Chronikseiten entsprechen von der Funktionalität herkömmlichen Zusatzseiten, sind allerdings der Schulchronik vorbehalten.",
icon: "page-add",
folder: "content/german/chronikseiten",
create: true,
editor: {
preview: true,
frame: true
name: "chronikseiten",
label: "Chronikseiten",
label_singular: "Zusatzseite (Chronik)",
description:
"Chronikseiten entsprechen von der Funktionalität herkömmlichen Zusatzseiten, sind allerdings der Schulchronik vorbehalten.",
icon: "page-add",
folder: "content/german/chronikseiten",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: {
field: "type",
value: "pages",
},
summary_fields: ["title", "draft", "aliases", "body"],
fields: [
Title(false),
DraftBoolean,
DescriptionText,
{
name: "type",
label: "Typ",
widget: "hidden",
default: "pages",
},
filter: {
field: "type",
value: "pages"
{
name: "aliases",
label: "Aliase",
label_singular: "Alias",
widget: "list",
collapsed: true,
required: false,
fields: [
{
name: "alias",
label: "Alias",
widget: "string",
},
],
},
summary_fields: ["title", "draft", "aliases", "body"],
fields: [
Title(false),
DraftBoolean,
DescriptionText,
{
name: "type",
label: "Typ",
widget: "hidden",
default: "pages"
},
{
name: "aliases",
label: "Aliase",
label_singular: "Alias",
widget: "list",
collapsed: true,
required: false,
fields: [
{
name: "alias",
label: "Alias",
widget: "string"
}
]
},
{
name: "body",
label: "Text",
widget: "markdown",
required: false,
...MarkdownProps
}
]
}
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps,
},
],
};
export default ChronikseitenCollection;
export default ChronikseitenCollection;

@ -0,0 +1,65 @@
import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const FormsCollection = {
name: "forms",
label: "Dokumente",
label_singular: "Dokument",
description:
"Hier sind Formulare, Vorlagen und andere Dokumente zu hinterlegen.",
icon: "document",
folder: "content/german/forms",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: {
field: "type",
value: "forms",
},
summary_fields: ["title", "draft"],
fields: [
Title(false),
DraftBoolean,
DescriptionText,
{
name: "files",
label: "Dateien",
label_singular: "Datei",
widget: "list",
required: false,
collapsed: true,
fields: [
{
name: "title",
label: "Bezeichnung",
widget: "string",
required: true,
},
{
name: "link",
label: "Datei",
widget: "file",
required: true,
},
],
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "forms",
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps,
},
],
};
export default FormsCollection;

@ -0,0 +1,92 @@
import { MarkdownProps } from "../props.js";
import { Title, DescriptionText, DraftBoolean } from "./widgets.js";
const GanztagCollection = {
name: "ganztagsangebote",
label: "Ganztag",
label_singular: "Arbeitsgemeinschaft",
description:
"Hier kann die Übersicht der Ganztagsangebote bearbeitet werden.",
icon: "group",
folder: "content/german/ganztagsangebote",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: {
field: "type",
value: "ganztagsangebote",
},
summary_fields: ["title", "draft", "category", "schedule", "room"],
fields: [
Title(false),
DraftBoolean,
DescriptionText,
{
name: "image",
label: "Titelbild",
widget: "image",
default: "/media/ganztagsangebote/image.webp",
required: true,
},
{
name: "category",
label: "Themebereich",
hint: "Verwaltet in den Einstellungen",
widget: "relation",
collection: "settings",
file: "data-categories",
value_field: "ganztag.*",
search_fields: ["ganztag.*"],
display_fields: ["ganztag.*"],
required: true,
},
{
name: "duration",
label: "Dauer",
widget: "string",
required: true,
},
{
name: "schedule",
label: "Tag/Stunden",
widget: "string",
required: true,
},
{
name: "class",
label: "Klassenstufen(n)",
widget: "string",
required: true,
},
{
name: "room",
label: "Raum",
widget: "string",
required: true,
},
{
name: "apply_url",
label: "Anmeldelink",
widget: "hidden",
default: "https://moodle.bildung-lsa.de/gcg/mod/choice/view.php?id=828",
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "ganztagsangebote",
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps,
},
],
};
export default GanztagCollection;

@ -0,0 +1,347 @@
import {
DataObject,
DateFormat,
MarkdownProps,
PatternEmail,
} from "../props.js";
import { DescriptionText, EnableBoolean, Title } from "./widgets.js";
const IndexPagesCollection = {
name: "index-pages",
label: "Hauptseiten",
label_singular: "Hauptseite",
description:
"Hauptseiten können nur manuell durch den Administrator angelegt und in die Website eingebunden werden. Über diesen Bereich ist die Änderung der Inhalte möglich.",
icon: "page",
editor: {
preview: true,
frame: true,
size: "half",
},
summary_fields: ["title", "description"],
files: [
{
name: "blog-index",
label: "Aktuelles",
file: "content/german/blog/_index.md",
fields: [Title(false), DescriptionText],
},
{
name: "about-index",
label: "Über die Schule",
file: "content/german/about/_index.md",
fields: [
Title(false),
DescriptionText,
{
name: "image",
label: "Bild",
widget: "image",
required: false,
},
{
name: "stats",
label: "Statistik",
...DataObject,
fields: [
EnableBoolean,
{
name: "zahlen",
label: "Elemente",
label_singular: "Element",
widget: "list",
required: false,
collapsed: false,
fields: [
{
name: "name",
label: "Bezeichnung",
widget: "string",
required: true,
},
{
name: "count",
label: "Zahl",
widget: "number",
value_type: "int",
min: 0,
step: 1,
required: true,
},
],
},
],
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps,
},
],
},
{
name: "anmeldung-index",
label: "Aufnahmeverfahren",
file: "content/german/anmeldung/_index.md",
fields: [
Title(false),
DescriptionText,
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps,
},
{
name: "elements",
label: "Abschnitte",
label_singular: "Abschnitt",
widget: "list",
required: false,
collapsed: true,
fields: [
Title(false),
{
name: "content",
label: "Inhalt",
widget: "markdown",
required: true,
...MarkdownProps,
},
],
},
],
},
{
name: "author-index",
label: "Autoren",
file: "content/german/author/_index.md",
fields: [Title(false), DescriptionText],
},
{
name: "anmeldeformular",
label: "Anmeldeformular",
file: "content/german/anmeldeformular/_index.md",
fields: [
Title(false),
DescriptionText,
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps,
},
],
},
{
name: "cantorpreis-index",
label: "Cantorpreis",
file: "content/german/cantorpreis/_index.md",
fields: [Title(false), DescriptionText],
},
{
name: "kontakt",
label: "Kontakt",
file: "content/german/kontakt/_index.md",
fields: [
Title(false),
DescriptionText,
{
name: "kontaktdaten",
label: "Kontaktdaten",
widget: "list",
required: true,
collapsed: true,
fields: [
{
name: "name",
label: "Name",
widget: "string",
required: true,
},
{
name: "position",
label: "Berufsbezeichnung",
widget: "string",
required: true,
},
{
name: "email",
label: "E-Mail-Adresse",
widget: "string",
required: true,
...PatternEmail,
},
],
},
],
},
{
name: "termine",
label: "Termine",
file: "content/german/termine/_index.md",
fields: [
Title(false),
DescriptionText,
{
name: "events",
label: "Termine",
label_singular: "Termin",
widget: "list",
required: true,
collapsed: true,
fields: [
{
name: "title",
label: "Bezeichnung",
widget: "string",
required: true,
},
{
name: "date",
label: "Datum/Startdatum",
widget: "datetime",
required: true,
...DateFormat,
},
{
name: "enddate",
label: "Enddatum",
hint: "Für mehrtägige Veanstaltungen, nur sichtbar wenn eingestellt",
widget: "datetime",
required: false,
...DateFormat,
},
{
name: "location",
label: "Ort",
widget: "string",
required: false,
},
],
},
],
},
{
name: "forms-index",
label: "Dokumente und Formulare",
file: "content/german/forms/_index.md",
fields: [Title(false), DescriptionText],
},
{
name: "ganztagsangebote-index",
label: "Unser Ganztagsbereich",
file: "content/german/ganztagsangebote/_index.md",
fields: [Title(false), DescriptionText],
},
{
name: "projektwoche-index",
label: "Projektwoche",
file: "content/german/projektwoche/_index.md",
fields: [Title(false), DescriptionText],
},
{
name: "wettbewerbe-index",
label: "Wettbewerbe",
file: "content/german/wettbewerbe/_index.md",
fields: [Title(false), DescriptionText],
},
{
name: "begabte-index",
label: "Begabtenförderung",
file: "content/german/begabte/_index.md",
fields: [Title(false), DescriptionText],
},
{
name: "abiturienten-index",
label: "Abiturienten",
file: "content/german/abiturienten/_index.md",
fields: [Title(false), DescriptionText],
},
{
name: "cantorfora-index",
label: "Cantorfora",
file: "content/german/cantorfora/_index.md",
fields: [
Title(false),
DescriptionText,
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps,
},
],
},
{
name: "schulchronik-index",
label: "Schulchronik",
file: "content/german/schulchronik/_index.md",
fields: [
Title(false),
DescriptionText,
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps,
},
{
name: "infocard",
label: "Zitatkarte",
...DataObject,
fields: [
EnableBoolean,
{
name: "image",
label: "Bild",
widget: "image",
required: false,
},
{
name: "quote",
label: "Zitat",
widget: "text",
required: false,
},
{
name: "author",
label: "Autor",
widget: "string",
required: false,
},
],
},
{
name: "links",
label: "Informationsseiten",
widget: "list",
required: false,
collapsed: true,
fields: [
{
name: "title",
label: "Bezeichnung",
widget: "string",
required: true,
},
{
name: "link",
label: "Link",
widget: "string",
required: true,
},
],
},
],
},
],
};
export default IndexPagesCollection;

@ -1,9 +1,37 @@
import SettingsCollection from "./settings-collection.js";
import IndexPagesCollection from "./index-pages.js";
import PagesCollection from "./pages.js";
import AuthorCollection from "./author.js";
import BlogCollection from "./blog.js";
import FormsCollection from "./forms.js";
import GanztagCollection from "./ganztag.js";
import WettbewerbeCollection from "./wettbewerbe.js";
import BegabteCollection from "./begabte.js";
import ProjektwocheCollection from "./projektwoche.js";
import ChronikjahreCollection from "./chronikjahre.js";
import SuperhaufenCollection from "./superhaufen.js";
import CantorpreisCollection from "./cantorpreis.js";
import AbiturientenCollection from "./abiturienten.js";
import CantorforaCollection from "./cantorfora.js";
import ChronikseitenCollection from "./chronikseiten.js";
import StatsCollection from "./stats.js";
export { SettingsCollection, ChronikjahreCollection, SuperhaufenCollection, CantorpreisCollection, AbiturientenCollection, CantorforaCollection, ChronikseitenCollection };
export {
SettingsCollection,
IndexPagesCollection,
PagesCollection,
AuthorCollection,
BlogCollection,
FormsCollection,
GanztagCollection,
WettbewerbeCollection,
BegabteCollection,
ProjektwocheCollection,
ChronikjahreCollection,
SuperhaufenCollection,
CantorpreisCollection,
AbiturientenCollection,
CantorforaCollection,
ChronikseitenCollection,
StatsCollection,
};

@ -0,0 +1,58 @@
import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const PagesCollection = {
name: "pages",
label: "Zusatzseiten",
label_singular: "Zusatzseite",
description:
"Zusatzseiten können direkt aus der grafischen Oberfläche heraus erstellt werden und sind unter https://cantorgymnasium.de/pages/[SEITENTITEL] einsehbar. Sie bestehen immer aus einem Titel, einer Metabeschreibung (kurzer Einstiegstext) und dem eigentlichen Inhalt. Einer Zusatzseite kann auch ein Alias, also eine alternative URL zugewiesen werden.",
icon: "page-add",
folder: "content/german/pages",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: {
field: "type",
value: "pages",
},
summary_fields: ["title", "draft", "aliases", "description"],
fields: [
Title(false),
DraftBoolean,
DescriptionText,
{
name: "type",
label: "Typ",
widget: "hidden",
default: "pages",
},
{
name: "aliases",
label: "Aliase",
label_singular: "Alias",
widget: "list",
collapsed: true,
required: false,
fields: [
{
name: "alias",
label: "Alias",
widget: "string",
},
],
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps,
},
],
};
export default PagesCollection;

@ -0,0 +1,73 @@
import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, IconList, Title } from "./widgets.js";
const ProjektwocheCollection = {
name: "projektwoche",
label: "Projektwochen",
label_singular: "Projektwoche",
description: "Hier kann die Übersicht der Projektwochen bearbeitet werden.",
icon: "projektwoche",
folder: "content/german/projektwoche",
filter: {
field: "type",
value: "projektwoche",
},
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
summary_fields: ["title", "draft", "tiles", "description"],
fields: [
Title(false),
DraftBoolean,
DescriptionText,
{
name: "type",
label: "Typ",
widget: "hidden",
default: "projektwoche",
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: false,
...MarkdownProps,
},
{
name: "tiles",
label: "Kacheln",
hint: "Die Vorschau zeigt nur die generierten Symbolkarten, NICHT die Inhalte.",
widget: "list",
required: false,
collapsed: true,
fields: [
Title(false),
{
name: "bg_color",
label: "Hintergrundfarbe",
widget: "color",
required: true,
},
IconList,
{
name: "font_color",
label: "Symbolfarbe",
widget: "color",
required: true,
},
{
name: "content",
label: "Inhalt",
widget: "markdown",
required: true,
...MarkdownProps,
},
],
},
],
};
export default ProjektwocheCollection;

File diff suppressed because it is too large Load Diff

@ -1,78 +0,0 @@
const StatistikCollection = {
name: "statistik",
label: "Statistik",
description: "Hier können statistische Daten bearbeitet werden. Dieser Bereich wird von der Schulchronik verwaltet.",
icon: "stats",
editor: {
preview: false
},
files: [
{
name: "abiturdurchschnitte",
label: "Abiturdurchschnitte",
file: "static/data/abiturdurchschnitte.json",
fields: [
{
name: "abiturdurchschnitte",
label: "Abiturdurchschnitte",
label_singular: "Abiturdurchschnitt",
widget: "list",
required: false,
fields: [
{
name: "jahr",
label: "Jahr",
widget: "number",
value_type: "int",
step: 1,
required: true
},
{
name: "schnitt",
label: "Schnitt",
widget: "number",
value_type: "float",
step: 0.01,
required: true
}
]
},
{
name: "schuelerzahlen",
label: "Schülerzahlen",
file: "static/data/schuelerzahlen.json",
fields: [
{
name: "schuelerzahlen",
label: "Schülerzahlen",
widget: "list",
required: false,
fields: [
{
name: "year",
label: "Jahr",
widget: "number",
required: true
},
{
name: "all",
label: "Gesamt",
widget: "number",
required: true
},
{
name: "girls",
label: "davon Mädchen",
widget: "number",
required: true
}
]
}
]
}
]
}
]
}
export default StatistikCollection;

@ -0,0 +1,83 @@
const StatsCollection = {
name: "statistik",
label: "Statistik",
description:
"Hier können statistische Daten bearbeitet werden. Dieser Bereich wird von der Schulchronik verwaltet.",
icon: "stats",
editor: {
preview: false,
size: "half",
},
files: [
{
name: "abiturdurchschnitte",
label: "Abiturdurchschnitte",
file: "static/data/abiturdurchschnitte.json",
fields: [
{
name: "abiturdurchschnitte",
label: "Abiturdurchschnitte",
label_singular: "Jahr",
widget: "list",
required: false,
fields: [
{
name: "jahr",
label: "Jahr",
widget: "number",
value_type: "int",
required: true,
},
{
name: "schnitt",
label: "Schnitt",
widget: "number",
value_type: "float",
step: 0.01,
required: true,
},
],
},
],
},
{
name: "schuelerzahlen",
label: "Schülerzahlen",
file: "static/data/schuelerzahlen.json",
fields: [
{
name: "schuelerzahlen",
label: "Schülerzahlen",
label_singular: "Jahr",
widget: "list",
required: false,
fields: [
{
name: "year",
label: "Jahr",
widget: "number",
value_type: "int",
required: true,
},
{
name: "all",
label: "Gesamtzahl",
widget: "number",
value_type: "int",
required: true,
},
{
name: "girls",
label: "davon Mädchen",
widget: "number",
value_type: "int",
required: true,
},
],
},
],
},
],
};
export default StatsCollection;

@ -2,100 +2,102 @@ import { MarkdownProps } from "../props.js";
import { DraftBoolean, EnableBoolean, Title } from "./widgets.js";
const SuperhaufenCollection = {
name: "superhaufen",
label: "Superhaufen",
description: "\"Superhaufen\" sind ein besonderer Bereich der Schulchronik, um besonders ausführliche Ereignisse darzustellen. Dieser Bereich wird von der Schulchronik verwaltet.",
icon: "superhaufen",
folder: "content/german/superhaufen",
filter: {
field: "type",
value: "superhaufen"
name: "superhaufen",
label: "Superhaufen",
description:
'"Superhaufen" sind ein besonderer Bereich der Schulchronik, um besonders ausführliche Ereignisse darzustellen. Dieser Bereich wird von der Schulchronik verwaltet.',
icon: "superhaufen",
folder: "content/german/superhaufen",
filter: {
field: "type",
value: "superhaufen",
},
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
summary_fields: ["title", "draft", "tiles"],
fields: [
Title(false),
DraftBoolean,
{
name: "type",
label: "Typ",
widget: "hidden",
default: "superhaufen",
},
create: true,
editor: {
preview: true,
frame: true,
},
summary_fields: ["title", "draft", "tiles"],
fields: [
{
name: "previous",
label: "Rückverlinkung",
widget: "object",
collapsed: true,
fields: [
EnableBoolean,
Title(false),
DraftBoolean,
{
name: "type",
label: "Typ",
widget: "hidden",
default: "superhaufen"
name: "link",
label: "Link",
widget: "string",
required: true,
},
],
},
{
name: "tiles",
label: "Kacheln",
hint: "Die Vorschau zeigt nur die generierten Symbolkarten, NICHT die Inhalte.",
widget: "list",
required: false,
collapsed: true,
fields: [
Title(false),
{
name: "bg_color",
label: "Hintergrundfarbe",
widget: "color",
required: true,
},
{
name: "previous",
label: "Rückverlinkung",
widget: "object",
collapsed: true,
fields: [
EnableBoolean,
Title(false),
{
name: "link",
label: "Link",
widget: "string",
required: true
}
]
name: "icon",
label: "Symbol",
widget: "string",
required: true,
},
{
name: "tiles",
label: "Kacheln",
hint: "Die Vorschau zeigt nur die generierten Symbolkarten, NICHT die Inhalte.",
widget: "list",
required: false,
collapsed: true,
fields: [
Title(false),
{
name: "bg_color",
label: "Hintergrundfarbe",
widget: "color",
required: true,
},
{
name: "icon",
label: "Symbol",
widget: "string",
required: true,
},
{
name: "font_color",
label: "Symbolfarbe",
widget: "color",
required: true,
},
{
name: "content",
label: "Inhalt",
widget: "markdown",
required: true,
...MarkdownProps
},
{
name: "unterhaufen",
label: "Unterhaufen",
widget: "list",
required: false,
collapsed: true,
fields: [
Title(false),
{
name: "content",
label: "Inhalt",
widget: "markdown",
required: true,
...MarkdownProps
}
]
}
]
}
]
}
name: "font_color",
label: "Symbolfarbe",
widget: "color",
required: true,
},
{
name: "content",
label: "Inhalt",
widget: "markdown",
required: true,
...MarkdownProps,
},
{
name: "unterhaufen",
label: "Unterhaufen",
widget: "list",
required: false,
collapsed: true,
fields: [
Title(false),
{
name: "content",
label: "Inhalt",
widget: "markdown",
required: true,
...MarkdownProps,
},
],
},
],
},
],
};
export default SuperhaufenCollection;
export default SuperhaufenCollection;

@ -0,0 +1,73 @@
import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const WettbewerbeCollection = {
name: "wettbewerbe",
label: "Wettbewerbe",
label_singular: "Wettbewerb",
description: "Hier kann die Übersicht der Wettbewerbe bearbeitet werden.",
icon: "trophy",
folder: "content/german/wettbewerbe",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: {
field: "type",
value: "wettbewerbe",
},
summary_fields: ["title", "draft", "category"],
fields: [
Title(false),
DraftBoolean,
DescriptionText,
{
name: "image",
label: "Titelbild",
widget: "image",
required: true,
default: "/media/image.webp",
},
{
name: "category",
label: "Fach",
hint: "Verwaltet in den Einstellungen",
widget: "relation",
collection: "settings",
file: "data-categories",
value_field: "contests.*",
search_fields: ["contests.*"],
display_fields: ["contests.*"],
required: true,
},
{
name: "class",
label: "Klassenstufe(n)",
widget: "string",
required: true,
},
{
name: "web_url",
label: "Website",
widget: "string",
required: false,
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "wettbewerbe",
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: true,
...MarkdownProps,
},
],
};
export default WettbewerbeCollection;

@ -1,30 +1,88 @@
import { DataObject } from "../props.js";
const EnableBoolean = {
name: "enable",
label: "Aktivieren",
widget: "boolean",
required: false
name: "enable",
label: "Aktivieren",
widget: "boolean",
required: false,
};
const DisableBoolean = {
name: "disable",
label: "Deaktivieren",
widget: "boolean",
required: false,
};
const DraftBoolean = {
name: "draft",
label: "Entwurf",
widget: "boolean",
default: false,
required: false
}
name: "draft",
label: "Entwurf",
widget: "boolean",
default: false,
required: false,
};
const Title = (optional = false) => ({
name: "title",
label: "Titel",
widget: "string",
required: !optional
name: "title",
label: "Titel",
widget: "string",
required: !optional,
});
const DescriptionText = {
name: "description",
label: "Beschreibung",
widget: "text",
required: false
name: "description",
label: "Beschreibung",
widget: "text",
required: false,
};
export { EnableBoolean, DraftBoolean, Title, DescriptionText };
const IconList = {
name: "icon",
label: "Symbol",
widget: "string",
required: false,
hint: "Liste unter https://assets.cantorgymnasium.de/fonts/mdi/v7/preview.html",
};
const PreviewNumber = {
name: "number",
label: "Anzahl",
hint: "Anzahl der Elemente, die auf der Startseite angezeigt werden sollen.",
widget: "number",
value_type: "int",
min: 0,
step: 1,
required: true,
};
const ButtonObject = {
name: "button",
label: "Button",
...DataObject,
fields: [
EnableBoolean,
{
name: "label",
label: "Aufschrift",
widget: "string",
required: false,
},
{
name: "link",
label: "Link",
widget: "string",
required: false,
},
],
};
export {
EnableBoolean,
DisableBoolean,
DraftBoolean,
Title,
DescriptionText,
IconList,
PreviewNumber,
ButtonObject,
};

@ -1,37 +1,71 @@
import { SettingsCollection } from "./collections/index.js";
import {
AbiturientenCollection,
AuthorCollection,
BegabteCollection,
BlogCollection,
CantorforaCollection,
CantorpreisCollection,
ChronikjahreCollection,
ChronikseitenCollection,
FormsCollection,
GanztagCollection,
IndexPagesCollection,
PagesCollection,
ProjektwocheCollection,
SettingsCollection,
StatsCollection,
SuperhaufenCollection,
WettbewerbeCollection,
} from "./collections/index.js";
const config = {
backend: {
name: "gitea",
repo: "gcg/gcg-website",
branch: "master",
api_root: "https://git.cantorgymnasium.de/api/v1",
base_url: "https://oauth.cantorgymnasium.de",
commit_messages: {
create: "{{collection}} {{slug}} erstellt",
update: "{{collection}} {{slug}} aktualisiert",
delete: "{{collection}} {{slug}} gelöscht",
updateMedia: "{{path}} hochgeladen",
deleteMedia: "{{path}} gelöscht"
}
backend: {
name: "gitea",
repo: "gcg/gcg-website",
branch: "master",
api_root: "https://git.cantorgymnasium.de/api/v1",
base_url: "https://oauth.cantorgymnasium.de",
commit_messages: {
create: "{{collection}} {{slug}} erstellt",
update: "{{collection}} {{slug}} aktualisiert",
delete: "{{collection}} {{slug}} gelöscht",
updateMedia: "{{path}} hochgeladen",
deleteMedia: "{{path}} gelöscht",
},
local_backend: true,
media_folder: "/static/media",
public_folder: "/media",
media_library: {
max_file_size: 10240000,
folder_support: true
},
site_url: "https://cantorgymnasium.de",
locale: "de",
slug: {
encoding: "ascii",
clean_accents: true,
sanitize_replacement: "-"
},
collections: [
SettingsCollection
]
},
local_backend: true,
media_folder: "/static/media",
public_folder: "/media",
media_library: {
max_file_size: 10240000,
folder_support: true,
},
site_url: "https://cantorgymnasium.de",
locale: "de",
slug: {
encoding: "ascii",
clean_accents: true,
sanitize_replacement: "-",
},
collections: [
SettingsCollection,
IndexPagesCollection,
PagesCollection,
AuthorCollection,
BlogCollection,
FormsCollection,
GanztagCollection,
WettbewerbeCollection,
BegabteCollection,
ProjektwocheCollection,
ChronikjahreCollection,
SuperhaufenCollection,
CantorpreisCollection,
AbiturientenCollection,
CantorforaCollection,
ChronikseitenCollection,
StatsCollection,
],
};
export default config;
export default config;

@ -1,56 +1,77 @@
const MarkdownProps = {
toolbar_buttons: {
main: [
'bold',
'italic',
'strikethrough',
'code',
'font',
'unordered-list',
'ordered-list',
'decrease-indent',
'increase-indent',
'insert-table',
'blockquote',
'file-link',
'code-block',
'shortcode',
],
empty: [],
selection: ['bold', 'italic', 'strikethrough', 'code', 'font', 'file-link', 'blockquote'],
table_empty: [
'bold',
'italic',
'strikethrough',
'code',
'insert-row',
'delete-row',
'insert-column',
'delete-column',
'delete-table',
'file-link',
'shortcode',
],
table_selection: [
'bold',
'italic',
'strikethrough',
'code',
'insert-row',
'delete-row',
'insert-column',
'delete-column',
'delete-table',
'file-link',
'shortcode',
]
}
toolbar_buttons: {
main: [
"bold",
"italic",
"strikethrough",
"code",
"font",
"unordered-list",
"ordered-list",
"decrease-indent",
"increase-indent",
"insert-table",
"blockquote",
"file-link",
"code-block",
"shortcode",
],
empty: [],
selection: [
"bold",
"italic",
"strikethrough",
"code",
"font",
"file-link",
"blockquote",
],
table_empty: [
"bold",
"italic",
"strikethrough",
"code",
"insert-row",
"delete-row",
"insert-column",
"delete-column",
"delete-table",
"file-link",
"shortcode",
],
table_selection: [
"bold",
"italic",
"strikethrough",
"code",
"insert-row",
"delete-row",
"insert-column",
"delete-column",
"delete-table",
"file-link",
"shortcode",
],
},
};
const DateFormat = {
date_format: "dd.MM.yyyy",
time_format: false,
format: "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
date_format: "dd.MM.yyyy",
time_format: false,
format: "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
};
export { MarkdownProps, DateFormat };
const DataObject = {
widget: "object",
collapsed: true,
summary: "{{fields.enable | ternary('aktiv', 'inaktiv')}}",
};
const PatternEmail = {
pattern: [
"^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$",
"name@domain.tld",
],
};
export { MarkdownProps, DateFormat, DataObject, PatternEmail };

@ -1,43 +1,51 @@
import { AbiturientenCollection, CantorforaCollection, CantorpreisCollection, ChronikjahreCollection, ChronikseitenCollection, SuperhaufenCollection } from "./collections/index.js";
import {
AbiturientenCollection,
CantorforaCollection,
CantorpreisCollection,
ChronikjahreCollection,
ChronikseitenCollection,
StatsCollection,
SuperhaufenCollection,
} from "./collections/index.js";
const config = {
backend: {
name: "gitea",
repo: "gcg/gcg-website",
branch: "master",
api_root: "https://git.cantorgymnasium.de/api/v1",
base_url: "https://oauth.cantorgymnasium.de",
commit_messages: {
create: "{{collection}} {{slug}} erstellt",
update: "{{collection}} {{slug}} aktualisiert",
delete: "{{collection}} {{slug}} gelöscht",
updateMedia: "{{path}} hochgeladen",
deleteMedia: "{{path}} gelöscht"
}
backend: {
name: "gitea",
repo: "gcg/gcg-website",
branch: "master",
api_root: "https://git.cantorgymnasium.de/api/v1",
base_url: "https://oauth.cantorgymnasium.de",
commit_messages: {
create: "{{collection}} {{slug}} erstellt",
update: "{{collection}} {{slug}} aktualisiert",
delete: "{{collection}} {{slug}} gelöscht",
updateMedia: "{{path}} hochgeladen",
deleteMedia: "{{path}} gelöscht",
},
local_backend: true,
media_folder: "/static/media",
public_folder: "/media",
media_library: {
max_file_size: 10240000,
folder_support: true
},
site_url: "https://cantorgymnasium.de/schulchronik/",
locale: "de",
slug: {
encoding: "ascii",
clean_accents: true,
sanitize_replacement: "-"
},
collections: [
ChronikjahreCollection,
SuperhaufenCollection,
CantorpreisCollection,
AbiturientenCollection,
CantorforaCollection,
ChronikseitenCollection
]
},
local_backend: true,
media_folder: "/static/media",
public_folder: "/media",
media_library: {
max_file_size: 10240000,
folder_support: true,
},
site_url: "https://cantorgymnasium.de/schulchronik/",
locale: "de",
slug: {
encoding: "ascii",
clean_accents: true,
sanitize_replacement: "-",
},
collections: [
ChronikjahreCollection,
SuperhaufenCollection,
CantorpreisCollection,
AbiturientenCollection,
CantorforaCollection,
ChronikseitenCollection,
StatsCollection,
],
};
export default config;
export default config;

@ -1,37 +1,36 @@
const IconNames = {
settings: "mdi mdi-cog-outline",
user: "mdi mdi-fountain-pen-tip",
page: "mdi mdi-file-document-outline",
"page-add": "mdi mdi-file-document-plus-outline",
document: "mdi mdi-file-document-multiple-outline",
news: "mdi mdi-newspaper",
award: "mdi mdi-seal-variant",
group: "mdi mdi-crowd",
trophy: "mdi mdi-trophy-outline",
pi: "mdi mdi-pi-box",
schulchronik: "mdi mdi-pillar",
"graduation-cap": "mdi mdi-school-outline",
help: "mdi mdi-lifebuoy",
dash: "mdi mdi-monitor-dashboard",
presentation: "mdi mdi-presentation",
projektwoche: "mdi mdi-calendar-range-outline",
superhaufen: "mdi mdi-view-dashboard",
stats: "mdi mdi-chart-bar",
};
let Icons = [];
for (let [name, icon] of Object.entries(IconNames)) {
Icons.push({
name,
icon: () =>
h(
"div",
{ className: "flex items-center" },
h("i", { className: icon, style: { fontSize: "1.5rem" } })
),
});
}
export default Icons;
settings: "mdi mdi-cog-outline",
user: "mdi mdi-fountain-pen-tip",
page: "mdi mdi-file-document-outline",
"page-add": "mdi mdi-file-document-plus-outline",
document: "mdi mdi-file-document-multiple-outline",
news: "mdi mdi-newspaper",
award: "mdi mdi-seal-variant",
group: "mdi mdi-crowd",
trophy: "mdi mdi-trophy-outline",
pi: "mdi mdi-pi-box",
schulchronik: "mdi mdi-pillar",
"graduation-cap": "mdi mdi-school-outline",
help: "mdi mdi-lifebuoy",
dash: "mdi mdi-monitor-dashboard",
presentation: "mdi mdi-presentation",
projektwoche: "mdi mdi-calendar-range-outline",
superhaufen: "mdi mdi-view-dashboard",
stats: "mdi mdi-chart-bar",
};
let Icons = [];
for (let [name, icon] of Object.entries(IconNames)) {
Icons.push({
name,
icon: () =>
h(
"div",
{ className: "flex items-center" },
h("i", { className: icon, style: { fontSize: "1.5rem" } })
),
});
}
export default Icons;

@ -3,8 +3,14 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://assets.cantorgymnasium.de/fonts/mdi/v7/css/materialdesignicons.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@staticcms/app@^2.0.0/dist/main.css" />
<link
rel="stylesheet"
href="https://assets.cantorgymnasium.de/fonts/mdi/v7/css/materialdesignicons.min.css"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@staticcms/app@^2.0.0/dist/main.css"
/>
<title>Static CMS</title>
</head>
<body>
@ -52,15 +58,15 @@
import Icons from "./icons.js";
// cms initialization
CMS.init();
CMS.init({ config });
// preview templates
CMS.registerPreviewTemplate("about-index", AboutPreview);
CMS.registerPreviewTemplate("blog", BlogPreview);
CMS.registerPreviewTemplate("wettbewerbe", ContestPreview);
CMS.registerPreviewTemplate("ganztagsangebote", GanztagPreview);
CMS.registerPreviewTemplate("contact-index", KontaktPreview);
CMS.registerPreviewTemplate("event-index", EventPreview);
CMS.registerPreviewTemplate("kontakt", KontaktPreview);
CMS.registerPreviewTemplate("termine", EventPreview);
CMS.registerPreviewTemplate("anmeldung-index", AnmeldungPreview);
CMS.registerPreviewTemplate("chronikjahre", ChronikPreview);
CMS.registerPreviewTemplate("anmeldeformular", AnmeldeformularPreview);
@ -116,7 +122,6 @@
Icons.forEach((i) => CMS.registerIcon(i.name, i.icon));
// field previews
CMS.registerFieldPreview("author", "active", BooleanPreview);
CMS.registerFieldPreview("author", "simplified", BooleanPreview);
CMS.registerFieldPreview("blog", "date", DatePreview);
@ -141,8 +146,15 @@
].forEach((collection) =>
CMS.registerFieldPreview(collection, "draft", DraftPreview)
);
["blog", "author", "chronikseiten", "pages", "cantorpreis", "begabte"].forEach(
(collection) => CMS.registerFieldPreview(collection, "body", BodyPreview)
[
"blog",
"author",
"chronikseiten",
"pages",
"cantorpreis",
"begabte",
].forEach((collection) =>
CMS.registerFieldPreview(collection, "body", BodyPreview)
);
[
"cantorpreis-index",
@ -154,8 +166,8 @@
"blog-index",
"about-index",
"anmeldung-index",
"contact-index",
"event-index",
"kontakt",
"termine",
"forms-index",
"ganztagsangebote-index",
"begabte-index",
@ -166,6 +178,27 @@
["chronikseiten", "blog"].forEach((collection) =>
CMS.registerFieldPreview(collection, "title", BodyPreview)
);
// access control
CMS.registerEventListener({
name: "login",
handler: ({ login }) => {
const adminUsers = [
"fberger",
"denyskon",
"gfelke",
"lberthold",
"cschapitz",
"bgorsler",
];
if (login && !adminUsers.includes(login)) {
alert(
"Sie sind nicht berechtigt, diese Seite aufzurufen. Sie werden nun auf die Startseite weitergeleitet."
);
location.href = "/";
}
},
});
</script>
</body>
</html>

@ -2,4 +2,4 @@ import StatusPage from "./status.js";
import WikiLink from "./wiki.js";
export { StatusPage, WikiLink };
export { StatusPage, WikiLink };

@ -1,17 +1,17 @@
const StatusPage = {
id: "status",
title: "Status",
data: () =>
h("iframe", {
src: "https://grafana.cantorgymnasium.de/d/ni-7T-J4z/status?orgId=2&refresh=5s&kiosk",
style: {
width: "100%",
height: "90vh",
},
}),
options: {
icon: "dash",
},
id: "status",
title: "Status",
data: () =>
h("iframe", {
src: "https://grafana.cantorgymnasium.de/d/ni-7T-J4z/status?orgId=2&refresh=5s&kiosk",
style: {
width: "100%",
height: "90vh",
},
}),
options: {
icon: "dash",
},
};
export default StatusPage;

@ -1,10 +1,10 @@
const WikiLink = {
id: "wiki",
title: "GCG.Wiki",
data: "https://wiki.cantorgymnasium.de",
options: {
icon: "help",
},
id: "wiki",
title: "GCG.Wiki",
data: "https://wiki.cantorgymnasium.de",
options: {
icon: "help",
},
};
export default WikiLink;

@ -1,6 +1,6 @@
const BooleanPreview = ({ value }) =>
h("i", {
className: value ? "mdi mdi-check" : "mdi mdi-close",
});
h("i", {
className: value ? "mdi mdi-check" : "mdi mdi-close",
});
export default BooleanPreview;

@ -1,9 +1,9 @@
function truncate(str, num) {
if (str.length > num) {
return str.slice(0, num) + "...";
} else {
return str;
}
if (str.length > num) {
return str.slice(0, num) + "...";
} else {
return str;
}
}
export default truncate;

@ -1,13 +1,13 @@
const DatePreview = ({ value }) =>
h(
"p",
{},
new Intl.DateTimeFormat("de-DE", {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour12: false,
}).format(new Date(value))
);
h(
"p",
{},
new Intl.DateTimeFormat("de-DE", {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour12: false,
}).format(new Date(value))
);
export default DatePreview;

@ -1,21 +1,21 @@
const DraftPreview = ({ value }) =>
h(
"div",
{
style: {
backgroundColor: value === true ? "rgb(37 99 235)" : "rgb(22 163 74)",
color: "white",
border: "none",
padding: "2px 6px",
textAlign: "center",
textDecoration: "none",
display: "inline-block",
cursor: "pointer",
borderRadius: "4px",
fontSize: "14px",
},
},
value ? "Entwurf" : "Veröffentlicht"
);
h(
"div",
{
style: {
backgroundColor: value === true ? "rgb(37 99 235)" : "rgb(22 163 74)",
color: "white",
border: "none",
padding: "2px 6px",
textAlign: "center",
textDecoration: "none",
display: "inline-block",
cursor: "pointer",
borderRadius: "4px",
fontSize: "14px",
},
},
value ? "Entwurf" : "Veröffentlicht"
);
export default DraftPreview;

@ -4,10 +4,4 @@ import CountPreview from "./count-preview.js";
import BodyPreview from "./body-preview.js";
import DatePreview from "./date-preview.js";
export {
BooleanPreview,
DraftPreview,
CountPreview,
BodyPreview,
DatePreview,
};
export { BooleanPreview, DraftPreview, CountPreview, BodyPreview, DatePreview };

@ -1,32 +1,32 @@
import { Container, PageHeader, Section, Row } from "./components/index.js";
const AbiturientenPreview = ({ widgetFor, entry, collection, fields }) => {
const imageField = useMemo(
() => fields.find((field) => field.name === "image"),
[fields]
);
const imageField = useMemo(
() => fields.find((field) => field.name === "image"),
[fields]
);
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
Section(
Container(
Row([
h(
"div",
{ className: "col-12 mb-4" },
h("img", { className: "img-fluid w-100", src: imageUrl })
),
h("div", { className: "col-12 content" }, widgetFor("body")),
])
)
),
];
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
Section(
Container(
Row([
h(
"div",
{ className: "col-12 mb-4" },
h("img", { className: "img-fluid w-100", src: imageUrl })
),
h("div", { className: "col-12 content" }, widgetFor("body")),
])
)
),
];
};
export default AbiturientenPreview;

@ -1,64 +1,64 @@
import { PageHeader } from "./components/index.js";
const AboutPreview = ({ widgetFor, widgetsFor, entry, fields, collection }) => {
const imageField = useMemo(
() => fields.find((field) => field.name === "image"),
[fields]
);
const imageField = useMemo(
() => fields.find((field) => field.name === "image"),
[fields]
);
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12" },
h("img", { className: "img-fluid w-100 mb-4", src: imageUrl }),
widgetFor("body")
)
)
)
),
entry.data.stats.enable
? h(
"section",
{ className: "section-sm bg-primary" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
widgetsFor("stats").data.zahlen.map((element) => {
return h(
"div",
{ className: "col-md-4 col-sm-6 mb-4 mb-md-0" },
h(
"div",
{ className: "text-center" },
h("h2", { className: "count text-white" }, element.count),
h("h5", { className: "text-white" }, element.name)
)
);
})
)
)
)
: null,
];
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12" },
h("img", { className: "img-fluid w-100 mb-4", src: imageUrl }),
widgetFor("body")
)
)
)
),
entry.data.stats.enable
? h(
"section",
{ className: "section-sm bg-primary" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
widgetsFor("stats").data.zahlen.map((element) => {
return h(
"div",
{ className: "col-md-4 col-sm-6 mb-4 mb-md-0" },
h(
"div",
{ className: "text-center" },
h("h2", { className: "count text-white" }, element.count),
h("h5", { className: "text-white" }, element.name)
)
);
})
)
)
)
: null,
];
};
export default AboutPreview;

@ -1,159 +1,159 @@
import { PageHeader } from "./components/index.js";
const AnmeldeformularPreview = ({ widgetFor, entry }) => {
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm bg-gray" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-lg-8 mb-4 mb-lg-0" },
h(
"form",
{},
h(
"div",
{ className: "input-group" },
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Name (Schüler/in)",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Vorname",
})
),
h(
"div",
{ className: "input-group mb-3" },
h("span", { className: "input-group-text" }, "Geburtsdatum"),
h("input", { className: "form-control", type: "date" })
),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Straße",
}),
h(
"div",
{ className: "input-group" },
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Hausnummer",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Adresszusatz",
})
),
h(
"div",
{ className: "input-group" },
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "PLZ",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Stadt",
})
),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Landkreis",
}),
h(
"div",
{ className: "input-group" },
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Telefon privat",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Telefon dienstl.",
})
),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Abweichender Elternname",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Grundschule",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Ihre E-Mail-Adresse",
}),
h("textarea", {
className: "form-control mb-3",
placeholder: "Bemerkungen",
}),
h(
"div",
{ className: "input-group mb-3" },
h("input", { className: "form-control", type: "file" }),
h(
"span",
{ className: "input-group-text" },
"Zeugnis (Vorderseite)"
)
),
h(
"div",
{ className: "input-group mb-3" },
h("input", { className: "form-control", type: "file" }),
h(
"span",
{ className: "input-group-text" },
"Zeugnis (Rückseite)"
)
),
h(
"div",
{ className: "input-group mb-3" },
h(
"div",
{ className: "input-group-text" },
h("input", {
className: "form-check-input",
type: "checkbox",
})
),
h(
"p",
{ className: "form-control mb-0" },
"Hiermit melden wir unser Kind verbindlich zur Aufnahmeprüfung an."
)
),
h("button", { className: "btn btn-primary" }, "Senden")
)
),
h("div", { className: "col-lg-4" }, widgetFor("body"))
)
)
),
];
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm bg-gray" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-lg-8 mb-4 mb-lg-0" },
h(
"form",
{},
h(
"div",
{ className: "input-group" },
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Name (Schüler/in)",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Vorname",
})
),
h(
"div",
{ className: "input-group mb-3" },
h("span", { className: "input-group-text" }, "Geburtsdatum"),
h("input", { className: "form-control", type: "date" })
),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Straße",
}),
h(
"div",
{ className: "input-group" },
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Hausnummer",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Adresszusatz",
})
),
h(
"div",
{ className: "input-group" },
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "PLZ",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Stadt",
})
),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Landkreis",
}),
h(
"div",
{ className: "input-group" },
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Telefon privat",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Telefon dienstl.",
})
),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Abweichender Elternname",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Grundschule",
}),
h("input", {
className: "form-control mb-3",
type: "text",
placeholder: "Ihre E-Mail-Adresse",
}),
h("textarea", {
className: "form-control mb-3",
placeholder: "Bemerkungen",
}),
h(
"div",
{ className: "input-group mb-3" },
h("input", { className: "form-control", type: "file" }),
h(
"span",
{ className: "input-group-text" },
"Zeugnis (Vorderseite)"
)
),
h(
"div",
{ className: "input-group mb-3" },
h("input", { className: "form-control", type: "file" }),
h(
"span",
{ className: "input-group-text" },
"Zeugnis (Rückseite)"
)
),
h(
"div",
{ className: "input-group mb-3" },
h(
"div",
{ className: "input-group-text" },
h("input", {
className: "form-check-input",
type: "checkbox",
})
),
h(
"p",
{ className: "form-control mb-0" },
"Hiermit melden wir unser Kind verbindlich zur Aufnahmeprüfung an."
)
),
h("button", { className: "btn btn-primary" }, "Senden")
)
),
h("div", { className: "col-lg-4" }, widgetFor("body"))
)
)
),
];
};
export default AnmeldeformularPreview;

@ -1,44 +1,44 @@
import { PageHeader } from "./components/index.js";
const AnmeldungPreview = ({ widgetsFor, widgetFor, entry }) => {
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row mb-4" },
h("div", { className: "col-md-6 content" }, widgetFor("body"))
),
h(
"div",
{ className: "row" },
widgetsFor("elements").map(function (element, index) {
return h(
"div",
{
className: "col-lg-6 col-sm-6 mb-4 d-flex align-items-stretch",
},
h(
"div",
{ className: "card rounded-0 hover-shadow border-primary" },
h(
"div",
{ className: "card-body" },
h("h4", { className: "card-title mb-3" }, element.data.title),
h("div", { className: "content" }, element.widgets.content)
)
)
);
})
)
)
),
];
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row mb-4" },
h("div", { className: "col-md-6 content" }, widgetFor("body"))
),
h(
"div",
{ className: "row" },
widgetsFor("elements").map(function (element, index) {
return h(
"div",
{
className: "col-lg-6 col-sm-6 mb-4 d-flex align-items-stretch",
},
h(
"div",
{ className: "card rounded-0 hover-shadow border-primary" },
h(
"div",
{ className: "card-body" },
h("h4", { className: "card-title mb-3" }, element.data.title),
h("div", { className: "content" }, element.widgets.content)
)
)
);
})
)
)
),
];
};
export default AnmeldungPreview;

@ -1,72 +1,72 @@
import { PageHeader, md5 } from "./components/index.js";
const AuthorPreview = ({ widgetFor, entry, fields, collection }) => {
const imageField = useMemo(
() => fields.find((field) => field.name === "image"),
[fields]
);
const imageField = useMemo(
() => fields.find((field) => field.name === "image"),
[fields]
);
const imageUrl = entry.data.image
? useMediaAsset(entry.data.image, collection, imageField, entry)
: entry.data.email
? undefined
: useMediaAsset("/media/people/gcg.webp", collection, imageField, entry);
const imageUrl = entry.data.image
? useMediaAsset(entry.data.image, collection, imageField, entry)
: entry.data.email
? undefined
: useMediaAsset("/media/people/gcg.webp", collection, imageField, entry);
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm bg-light" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-lg-10 mx-auto" },
h(
"div",
{ className: "text-center" },
h(
"figure",
{},
h("img", {
className: "rounded-circle img-fluid mb-4",
src:
imageUrl ??
"https://www.gravatar.com/avatar/" +
md5(entry.data.email) +
"?s=128&pg&d=identicon",
width: "128px",
}),
h(
"figcaption",
{},
h("h4", { className: "fw-bold" }, entry.data.title)
)
),
h("hr"),
widgetFor("body"),
h("hr"),
h(
"ul",
{ className: "list-inline" },
entry.data.email
? h(
"li",
{ className: "list-inline-item" },
h("i", { className: "mdi mdi-at" })
)
: null
)
)
)
)
)
),
];
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm bg-light" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-lg-10 mx-auto" },
h(
"div",
{ className: "text-center" },
h(
"figure",
{},
h("img", {
className: "rounded-circle img-fluid mb-4",
src:
imageUrl ??
"https://www.gravatar.com/avatar/" +
md5(entry.data.email) +
"?s=128&pg&d=identicon",
width: "128px",
}),
h(
"figcaption",
{},
h("h4", { className: "fw-bold" }, entry.data.title)
)
),
h("hr"),
widgetFor("body"),
h("hr"),
h(
"ul",
{ className: "list-inline" },
entry.data.email
? h(
"li",
{ className: "list-inline-item" },
h("i", { className: "mdi mdi-at" })
)
: null
)
)
)
)
)
),
];
};
export default AuthorPreview;

@ -1,89 +1,89 @@
import {
DateFormat,
PageHeader,
Section,
Container,
Col12,
Row,
DateFormat,
PageHeader,
Section,
Container,
Col12,
Row,
} from "./components/index.js";
const BlogPreview = ({ widgetFor, entry, fields, collection }) => {
const imageField = useMemo(() => {
return fields.find((field) => field.name === "image");
}, [fields]);
const imageField = useMemo(() => {
return fields.find((field) => field.name === "image");
}, [fields]);
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
Section(
Container(
Row([
h(
"div",
{ key: "cover-image", className: "col-12 mb-4" },
h("img", { className: "img-fluid w-100", src: imageUrl })
),
Col12(
h(
"div",
{ className: "row mb-3" },
h(
"div",
{ className: "col-6 mb-md-0 text-light" },
h("span", { className: "fw-bold me-1" }, "Geschrieben von:"),
entry.data.author
),
h(
"div",
{ className: "col-6 mb-3 mb-md-0 text-light" },
h("span", { className: "fw-bold me-1" }, "Datum:"),
entry.data.date
? DateFormat({
date: entry.data.date,
format: {
day: "numeric",
month: "short",
year: "numeric",
},
})
: ""
)
)
),
Row(
h(
"div",
{ className: "col-12 mb-md-0 text-light" },
h("span", { className: "fw-bold me-1" }, "Kategorie:"),
entry.data.categories
? entry.data.categories.map(
(category, index) => (index != 0 ? ", " : "") + category
)
: ""
)
),
h(
"div",
{ key: "border-bottom", className: "col-12 my-4" },
h("div", { className: "border-bottom" })
),
h(
"div",
{
key: "body-content",
className: "col-12 mb-5 content content-justify",
},
widgetFor("body")
),
])
)
),
];
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
Section(
Container(
Row([
h(
"div",
{ key: "cover-image", className: "col-12 mb-4" },
h("img", { className: "img-fluid w-100", src: imageUrl })
),
Col12(
h(
"div",
{ className: "row mb-3" },
h(
"div",
{ className: "col-6 mb-md-0 text-light" },
h("span", { className: "fw-bold me-1" }, "Geschrieben von:"),
widgetFor("author")
),
h(
"div",
{ className: "col-6 mb-3 mb-md-0 text-light" },
h("span", { className: "fw-bold me-1" }, "Datum:"),
entry.data.date
? DateFormat({
date: entry.data.date,
format: {
day: "numeric",
month: "short",
year: "numeric",
},
})
: ""
)
)
),
Row(
h(
"div",
{ className: "col-12 mb-md-0 text-light" },
h("span", { className: "fw-bold me-1" }, "Kategorie:"),
entry.data.categories
? entry.data.categories.map(
(category, index) => (index != 0 ? ", " : "") + category
)
: ""
)
),
h(
"div",
{ key: "border-bottom", className: "col-12 my-4" },
h("div", { className: "border-bottom" })
),
h(
"div",
{
key: "body-content",
className: "col-12 mb-5 content content-justify",
},
widgetFor("body")
),
])
)
),
];
};
export default BlogPreview;

@ -1,49 +1,49 @@
import {
PageHeader,
Section,
Container,
Row,
Content,
PageHeader,
Section,
Container,
Row,
Content,
} from "./components/index.js";
const CantorpreisPreview = ({ widgetFor, entry, fields, collection }) => {
const imageField = useMemo(
() => fields.find((field) => field.name === "image"),
[fields]
);
const imageField = useMemo(
() => fields.find((field) => field.name === "image"),
[fields]
);
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
Section(
Container(
Row([
h(
"div",
{ className: "col-md-5 mb-5" },
h("img", {
className: "img-fluid w-75",
src: imageUrl,
alt: entry.data.name,
})
),
h(
"div",
{ className: "col-md-7 mb-5" },
h("h3", {}, entry.data.name),
h("h6", { className: "text-color" }, entry.data.title),
Content(widgetFor("body"))
),
])
)
),
];
return [
PageHeader(entry),
Section(
Container(
Row([
h(
"div",
{ className: "col-md-5 mb-5" },
h("img", {
className: "img-fluid w-75",
src: imageUrl,
alt: entry.data.name,
})
),
h(
"div",
{ className: "col-md-7 mb-5" },
h("h3", {}, entry.data.name),
h("h6", { className: "text-color" }, entry.data.title),
Content(widgetFor("body"))
),
])
)
),
];
};
export default CantorpreisPreview;

@ -1,113 +1,113 @@
import { PageHeader } from "./components/index.js";
const ChronikIndexPreview = ({
widgetFor,
widgetsFor,
entry,
fields,
collection,
widgetFor,
widgetsFor,
entry,
fields,
collection,
}) => {
const imageField = useMemo(
() => fields.find((field) => field.name === "image"),
[fields]
);
const imageField = useMemo(
() => fields.find((field) => field.name === "image"),
[fields]
);
const imageUrl = useMediaAsset(
widgetsFor("infocard").data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h("div", { className: "container" }, widgetFor("body")),
widgetsFor("infocard").data.enable
? h(
"div",
{ className: "container" },
h(
"div",
{ className: "card mb-3" },
h(
"div",
{ className: "row g-0" },
h(
"div",
{ className: "col-md-3" },
h("img", {
className: "img-fluid rounded w-100",
src: imageUrl,
})
),
h(
"div",
{ className: "col-md-9 d-flex align-items-center" },
h(
"div",
{ className: "card-body" },
h(
"p",
{ className: "h2 card-title" },
widgetsFor("infocard").data.quote
),
h(
"p",
{ className: "card-text" },
h(
"small",
{ className: "text-muted" },
widgetsFor("infocard").data.author
)
)
)
)
)
)
)
: null,
h(
"div",
{ className: "container" },
h("h2", { className: "section-title" }, "Informationsseiten"),
h(
"div",
{ className: "row" },
widgetsFor("links").map((element) =>
h(
"div",
{ className: "col-lg-4 col-sm-6" },
h(
"div",
{
className: "card border-primary rounded-0 hover-shadow mb-4",
},
h(
"div",
{ className: "card-body" },
h(
"h4",
{ className: "card-title text-truncate" },
h("a", { href: element.data.link }, element.data.title)
),
h(
"a",
{
className: "btn btn-primary btn-sm",
href: element.data.link,
},
"Mehr anzeigen"
)
)
)
)
)
)
)
),
];
const imageUrl = useMediaAsset(
widgetsFor("infocard").data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h("div", { className: "container" }, widgetFor("body")),
widgetsFor("infocard").data.enable
? h(
"div",
{ className: "container" },
h(
"div",
{ className: "card mb-3" },
h(
"div",
{ className: "row g-0" },
h(
"div",
{ className: "col-md-3" },
h("img", {
className: "img-fluid rounded w-100",
src: imageUrl,
})
),
h(
"div",
{ className: "col-md-9 d-flex align-items-center" },
h(
"div",
{ className: "card-body" },
h(
"p",
{ className: "h2 card-title" },
widgetsFor("infocard").data.quote
),
h(
"p",
{ className: "card-text" },
h(
"small",
{ className: "text-muted" },
widgetsFor("infocard").data.author
)
)
)
)
)
)
)
: null,
h(
"div",
{ className: "container" },
h("h2", { className: "section-title" }, "Informationsseiten"),
h(
"div",
{ className: "row" },
widgetsFor("links").map((element) =>
h(
"div",
{ className: "col-lg-4 col-sm-6" },
h(
"div",
{
className: "card border-primary rounded-0 hover-shadow mb-4",
},
h(
"div",
{ className: "card-body" },
h(
"h4",
{ className: "card-title text-truncate" },
h("a", { href: element.data.link }, element.data.title)
),
h(
"a",
{
className: "btn btn-primary btn-sm",
href: element.data.link,
},
"Mehr anzeigen"
)
)
)
)
)
)
)
),
];
};
export default ChronikIndexPreview;

@ -1,7 +1,7 @@
import { PageHeader } from "./components/index.js";
const ChronikPreview = ({ widgetFor, widgetsFor, entry, document, window }) => {
/*return [PageHeader,
/*return [PageHeader,
h('section', {className: "section-sm"},
h('div', {className: "container"},
h('div', {className: "row"},

@ -1,5 +1,5 @@
const Section = (children) =>
h("section", { className: "section-sm" }, children);
h("section", { className: "section-sm" }, children);
const Container = (children) => h("div", { className: "container" }, children);
const Row = (children) => h("div", { className: "row" }, children);
const Content = (children) => h("div", { className: "content" }, children);

@ -1,5 +1,5 @@
const DateFormat = ({ date, format }) => {
return new Intl.DateTimeFormat("de-DE", format).format(new Date(date));
return new Intl.DateTimeFormat("de-DE", format).format(new Date(date));
};
export default DateFormat;

@ -1,51 +1,51 @@
const PageHeader = (entry) => {
return h(
"section",
{
key: "page-header",
className: "page-title-section overlay",
style: {
backgroundImage:
'url("/media/titelbild.webp"),url("/media/titelbild.webp")',
},
},
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-md-8 position-relative" },
h(
"ul",
{ className: "list-inline" },
h(
"li",
{ className: "list-inline-item h2" },
h(
"font",
{ className: "text-primary font-secondary", href: "" },
"Startseite"
)
),
h(
"li",
{ className: "list-inline-item h2" },
h("i", { className: "mdi mdi-chevron-double-right text-white" })
),
h(
"li",
{ className: "list-inline-item text-white h2 font-secondary" },
entry.data.title
)
),
h("p", { className: "text-lighten" }, entry.data.description)
)
)
)
);
return h(
"section",
{
key: "page-header",
className: "page-title-section overlay",
style: {
backgroundImage:
'url("/media/titelbild.webp"),url("/media/titelbild.webp")',
},
},
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-md-8 position-relative" },
h(
"ul",
{ className: "list-inline" },
h(
"li",
{ className: "list-inline-item h2" },
h(
"font",
{ className: "text-primary font-secondary", href: "" },
"Startseite"
)
),
h(
"li",
{ className: "list-inline-item h2" },
h("i", { className: "mdi mdi-chevron-double-right text-white" })
),
h(
"li",
{ className: "list-inline-item text-white h2 font-secondary" },
entry.data.title
)
),
h("p", { className: "text-lighten" }, entry.data.description)
)
)
)
);
};
export default PageHeader;

@ -1,65 +1,64 @@
import { Container, PageHeader, Row, Section } from "./components/index.js";
const ContestPreview = ({ widgetFor, entry, fields, collection }) => {
const imageField = useMemo(() => {
return fields.find((field) => field.name === "image");
}, [fields]);
const imageField = useMemo(() => {
return fields.find((field) => field.name === "image");
}, [fields]);
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
Section(
Container([
entry.data.image &&
entry.data.image != "/media/image.webp"
? Row(
h(
"div",
{ className: "col-12 mb-4" },
h("img", { className: "img-fluid w-100", src: imageUrl })
)
)
: null,
h(
"div",
{ className: "row mb-4" },
h(
"div",
{ className: "col-7" },
h(
"div",
{ className: "d-flex align-items-center" },
h("i", { className: "mdi mdi-crowd text-primary icon-md me-2" }),
h(
"div",
{ className: "text-start" },
h("h6", { className: "mb-0" }, "KLASSE(N)"),
h("p", { className: "mb-0" }, entry.data.class)
)
)
),
entry.data.web_url
? h(
"div",
{ className: "col-5 text-end mb-4 mb-xl-0" },
h("a", { className: "btn btn-primary" }, "Website")
)
: null,
h(
"div",
{ className: "col-12 mt-4" },
h("div", { className: "border-bottom border-primary" })
)
),
Row(h("div", { className: "col-12 content" }, widgetFor("body"))),
])
),
];
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
Section(
Container([
entry.data.image && entry.data.image != "/media/image.webp"
? Row(
h(
"div",
{ className: "col-12 mb-4" },
h("img", { className: "img-fluid w-100", src: imageUrl })
)
)
: null,
h(
"div",
{ className: "row mb-4" },
h(
"div",
{ className: "col-7" },
h(
"div",
{ className: "d-flex align-items-center" },
h("i", { className: "mdi mdi-crowd text-primary icon-md me-2" }),
h(
"div",
{ className: "text-start" },
h("h6", { className: "mb-0" }, "KLASSE(N)"),
h("p", { className: "mb-0" }, entry.data.class)
)
)
),
entry.data.web_url
? h(
"div",
{ className: "col-5 text-end mb-4 mb-xl-0" },
h("a", { className: "btn btn-primary" }, "Website")
)
: null,
h(
"div",
{ className: "col-12 mt-4" },
h("div", { className: "border-bottom border-primary" })
)
),
Row(h("div", { className: "col-12 content" }, widgetFor("body"))),
])
),
];
};
export default ContestPreview;

@ -1,147 +1,147 @@
import { PageHeader, DateFormat } from "./components/index.js";
function isFuture(date, enddate) {
let date1 = new Date(date ? date : 0);
let date2 = new Date(enddate ? enddate : 0);
let present = new Date();
if (date1 >= present || date2 >= present) {
return true;
} else {
return false;
}
let date1 = new Date(date ? date : 0);
let date2 = new Date(enddate ? enddate : 0);
let present = new Date();
if (date1 >= present || date2 >= present) {
return true;
} else {
return false;
}
}
const EventPreview = ({ widgetsFor, entry }) => {
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12" },
h(
"ul",
{ className: "list-inline text-center filter-controls mb-5" },
h(
"li",
{ className: "list-inline-item m-3 text-uppercase active" },
"Alle"
),
h(
"li",
{ className: "list-inline-item m-3 text-uppercase" },
"Anstehend"
),
h(
"li",
{ className: "list-inline-item m-3 text-uppercase" },
"Vergangen"
)
)
)
),
h(
"div",
{ className: "filtr-container" },
widgetsFor("events").map((event) =>
h(
"div",
{ className: "mb-2 mt-2 col-12 filtr-item" },
h(
"div",
{
className:
"card d-md-table w-100 hover-shadow border-primary ps-0 pe-0 mb-4",
},
h(
"div",
{
className:
"d-md-table-cell text-center p-4 bg-primary text-white mb-4 mb-md-0 termin-tc rounded",
},
h(
"span",
{ className: "h2 d-block" },
event.data.date != null && event.data.date != ""
? DateFormat({
date: event.data.date,
format: { day: "numeric" },
})
: null
),
h(
"span",
{ className: "d-block" },
event.data.date != null && event.data.date != ""
? DateFormat({
date: event.data.date,
format: { month: "short", year: "numeric" },
})
: null
),
event.data.enddate != null && event.data.enddate != ""
? [
h("br"),
"bis " +
DateFormat({
date: event.data.enddate,
format: {
day: "numeric",
month: "short",
year: "numeric",
},
}),
]
: null
),
h(
"div",
{
className:
"d-md-table-cell px-4 vertical-align-middle mb-4 mb-md-0 p-2",
},
h("p", { className: "h4 mb-0 d-block" }, event.data.title)
),
event.data.location
? h(
"div",
{
className:
"d-md-table-cell text-end pe-md-4 p-2 vertical-align-middle",
},
h(
"p",
{},
h("i", {
className:
"mdi mdi-map-marker-radius-outline icon-s text-primary me-2",
}),
event.data.location
)
)
: null
)
)
)
)
)
)
)
),
];
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12" },
h(
"ul",
{ className: "list-inline text-center filter-controls mb-5" },
h(
"li",
{ className: "list-inline-item m-3 text-uppercase active" },
"Alle"
),
h(
"li",
{ className: "list-inline-item m-3 text-uppercase" },
"Anstehend"
),
h(
"li",
{ className: "list-inline-item m-3 text-uppercase" },
"Vergangen"
)
)
)
),
h(
"div",
{ className: "filtr-container" },
widgetsFor("events").map((event) =>
h(
"div",
{ className: "mb-2 mt-2 col-12 filtr-item" },
h(
"div",
{
className:
"card d-md-table w-100 hover-shadow border-primary ps-0 pe-0 mb-4",
},
h(
"div",
{
className:
"d-md-table-cell text-center p-4 bg-primary text-white mb-4 mb-md-0 termin-tc rounded",
},
h(
"span",
{ className: "h2 d-block" },
event.data.date != null && event.data.date != ""
? DateFormat({
date: event.data.date,
format: { day: "numeric" },
})
: null
),
h(
"span",
{ className: "d-block" },
event.data.date != null && event.data.date != ""
? DateFormat({
date: event.data.date,
format: { month: "short", year: "numeric" },
})
: null
),
event.data.enddate != null && event.data.enddate != ""
? [
h("br"),
"bis " +
DateFormat({
date: event.data.enddate,
format: {
day: "numeric",
month: "short",
year: "numeric",
},
}),
]
: null
),
h(
"div",
{
className:
"d-md-table-cell px-4 vertical-align-middle mb-4 mb-md-0 p-2",
},
h("p", { className: "h4 mb-0 d-block" }, event.data.title)
),
event.data.location
? h(
"div",
{
className:
"d-md-table-cell text-end pe-md-4 p-2 vertical-align-middle",
},
h(
"p",
{},
h("i", {
className:
"mdi mdi-map-marker-radius-outline icon-s text-primary me-2",
}),
event.data.location
)
)
: null
)
)
)
)
)
)
)
),
];
};
export default EventPreview;

@ -1,64 +1,64 @@
import { PageHeader } from "./components/index.js";
const FormsPreview = ({ widgetsFor, widgetFor, entry }) => {
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12" },
h("h2", { className: "section-title" }, entry.data.title)
)
),
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12 content" },
widgetsFor("files").map((file) =>
h(
"div",
{ className: "container mb-0" },
h(
"div",
{
className:
"card border-primary rounded-0 hover-shadow mb-5",
},
h(
"div",
{ className: "card-body mb-0" },
h("h4", { className: "card-title" }, file.data.title),
h(
"a",
{
className:
"text-decoration-none btn btn-primary btn-sm mb-0",
},
h("i", {
className: "mdi mdi-tray-arrow-down mb-0 me-2",
}),
"Download"
)
)
)
)
),
widgetFor("body")
)
)
)
),
];
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12" },
h("h2", { className: "section-title" }, entry.data.title)
)
),
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12 content" },
widgetsFor("files").map((file) =>
h(
"div",
{ className: "container mb-0" },
h(
"div",
{
className:
"card border-primary rounded-0 hover-shadow mb-5",
},
h(
"div",
{ className: "card-body mb-0" },
h("h4", { className: "card-title" }, file.data.title),
h(
"a",
{
className:
"text-decoration-none btn btn-primary btn-sm mb-0",
},
h("i", {
className: "mdi mdi-tray-arrow-down mb-0 me-2",
}),
"Download"
)
)
)
)
),
widgetFor("body")
)
)
)
),
];
};
export default FormsPreview;

@ -1,127 +1,127 @@
import {
Col12,
Container,
PageHeader,
Row,
Section,
Col12,
Container,
PageHeader,
Row,
Section,
} from "./components/index.js";
const GanztagPreview = ({
widgetFor,
widgetsFor,
entry,
fields,
collection,
widgetFor,
widgetsFor,
entry,
fields,
collection,
}) => {
const imageField = useMemo(() => {
return fields.find((field) => field.name === "image");
}, [fields]);
const imageField = useMemo(() => {
return fields.find((field) => field.name === "image");
}, [fields]);
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
Section(
Container([
Row(
h(
"div",
{ className: "col-12 mb-4" },
h("img", { className: "img-fluid w-100", src: imageUrl })
)
),
h("h2", {}, entry.data.title),
h(
"div",
{ className: "row align-items-center mb-4" },
Col12(
Row([
h(
"div",
{ className: "col-lg-3 col-sm-6 mb-3 mb-sm-0" },
h(
"div",
{ className: "d-flex align-items-center" },
h("i", {
className:
"mdi mdi-calendar-today-outline text-primary icon-md me-2",
}),
h(
"div",
{ className: "text-start" },
h("h6", { className: "mb-0" }, "ZEIT"),
h("p", { className: "mb-0" }, entry.data.schedule)
)
)
),
h(
"div",
{ className: "col-lg-3 col-sm-6 mb-3 mb-sm-0" },
h(
"div",
{ className: "d-flex align-items-center" },
h("i", {
className: "mdi mdi-timer-sand text-primary icon-md me-2",
}),
h(
"div",
{ className: "text-start" },
h("h6", { className: "mb-0" }, "DAUER"),
h("p", { className: "mb-0" }, entry.data.duration)
)
)
),
h(
"div",
{ className: "col-lg-3 col-sm-6 mb-3 mb-sm-0" },
h(
"div",
{ className: "d-flex align-items-center" },
h("i", {
className: "mdi mdi-crowd text-primary icon-md me-2",
}),
h(
"div",
{ className: "text-start" },
h("h6", { className: "mb-0" }, "KLASSE(N)"),
h("p", { className: "mb-0" }, entry.data.class)
)
)
),
h(
"div",
{ className: "col-lg-3 col-sm-6 mb-3 mb-sm-0" },
h(
"div",
{ className: "d-flex align-items-center" },
h("i", {
className:
"mdi mdi-map-marker-radius-outline text-primary icon-md me-2",
}),
h(
"div",
{ className: "text-start" },
h("h6", { className: "mb-0" }, "RAUM"),
h("p", { className: "mb-0" }, entry.data.room)
)
)
),
])
),
h(
"div",
{ className: "col-12 mt-4" },
h("div", { className: "border-bottom border-primary" })
)
),
Row(h("div", { className: "col-12 content" }, widgetFor("body"))),
])
),
];
const imageUrl = useMediaAsset(
entry.data.image,
collection,
imageField,
entry
);
return [
PageHeader(entry),
Section(
Container([
Row(
h(
"div",
{ className: "col-12 mb-4" },
h("img", { className: "img-fluid w-100", src: imageUrl })
)
),
h("h2", {}, entry.data.title),
h(
"div",
{ className: "row align-items-center mb-4" },
Col12(
Row([
h(
"div",
{ className: "col-lg-3 col-sm-6 mb-3 mb-sm-0" },
h(
"div",
{ className: "d-flex align-items-center" },
h("i", {
className:
"mdi mdi-calendar-today-outline text-primary icon-md me-2",
}),
h(
"div",
{ className: "text-start" },
h("h6", { className: "mb-0" }, "ZEIT"),
h("p", { className: "mb-0" }, entry.data.schedule)
)
)
),
h(
"div",
{ className: "col-lg-3 col-sm-6 mb-3 mb-sm-0" },
h(
"div",
{ className: "d-flex align-items-center" },
h("i", {
className: "mdi mdi-timer-sand text-primary icon-md me-2",
}),
h(
"div",
{ className: "text-start" },
h("h6", { className: "mb-0" }, "DAUER"),
h("p", { className: "mb-0" }, entry.data.duration)
)
)
),
h(
"div",
{ className: "col-lg-3 col-sm-6 mb-3 mb-sm-0" },
h(
"div",
{ className: "d-flex align-items-center" },
h("i", {
className: "mdi mdi-crowd text-primary icon-md me-2",
}),
h(
"div",
{ className: "text-start" },
h("h6", { className: "mb-0" }, "KLASSE(N)"),
h("p", { className: "mb-0" }, entry.data.class)
)
)
),
h(
"div",
{ className: "col-lg-3 col-sm-6 mb-3 mb-sm-0" },
h(
"div",
{ className: "d-flex align-items-center" },
h("i", {
className:
"mdi mdi-map-marker-radius-outline text-primary icon-md me-2",
}),
h(
"div",
{ className: "text-start" },
h("h6", { className: "mb-0" }, "RAUM"),
h("p", { className: "mb-0" }, entry.data.room)
)
)
),
])
),
h(
"div",
{ className: "col-12 mt-4" },
h("div", { className: "border-bottom border-primary" })
)
),
Row(h("div", { className: "col-12 content" }, widgetFor("body"))),
])
),
];
};
export default GanztagPreview;

@ -19,22 +19,22 @@ import AbiturientenPreview from "./abiturienten-preview.js";
import PreviewStyles from "./styles.js";
export {
AboutPreview,
BlogPreview,
ContestPreview,
GanztagPreview,
PagePreview,
EventPreview,
AnmeldungPreview,
HeaderPreview,
ChronikPreview,
KontaktPreview,
AnmeldeformularPreview,
ChronikIndexPreview,
AuthorPreview,
FormsPreview,
CantorpreisPreview,
ProjektwochePreview,
AbiturientenPreview,
PreviewStyles,
AboutPreview,
BlogPreview,
ContestPreview,
GanztagPreview,
PagePreview,
EventPreview,
AnmeldungPreview,
HeaderPreview,
ChronikPreview,
KontaktPreview,
AnmeldeformularPreview,
ChronikIndexPreview,
AuthorPreview,
FormsPreview,
CantorpreisPreview,
ProjektwochePreview,
AbiturientenPreview,
PreviewStyles,
};

@ -1,98 +1,98 @@
import { PageHeader } from "./components/index.js";
const KontaktPreview = ({ widgetsFor, entry }) => {
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm bg-gray" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-lg-6 mb-4 mb-lg-0" },
h(
"form",
{},
h("input", {
className: "form-control form-control-lg mb-3",
type: "text",
placeholder: "Ihr Name",
}),
h("input", {
className: "form-control form-control-lg mb-3",
type: "text",
placeholder: "Ihre E-Mail Adresse",
}),
h("input", {
className: "form-control form-control-lg mb-3",
type: "text",
placeholder: "Betreff",
}),
h("textarea", {
className: "form-control form-control-lg mb-3",
placeholder: "Nachricht",
}),
h("button", { className: "btn btn-primary" }, "Senden")
)
),
h(
"div",
{ className: "col-lg-6" },
h(
"div",
{ className: "card" },
h("div", { className: "card-header fw-bold" }, "Kontaktdaten"),
h(
"ul",
{ className: "list-group list-group-flush" },
widgetsFor("kontaktdaten").map((person) =>
h(
"li",
{ className: "list-group-item" },
h("p", { className: "card-title mb-0" }, person.data.name),
h(
"p",
{ className: "text-muted mb-0" },
person.data.position
),
h(
"p",
{ className: "card-text" },
h("i", {
className: "mdi mdi-email-multiple-outline me-2",
}),
person.data.email.replace("@", "(at)")
)
)
),
h(
"li",
{ className: "list-group-item" },
h(
"p",
{ className: "card-text" },
h("i", { className: "mdi mdi-phone-outline me-2" }),
"Telefon: +49-0345/6903156"
),
h(
"p",
{ className: "card-text" },
h("i", { className: "mdi mdi-fax me-2" }),
"Fax: +49-0345/6903157"
)
)
)
)
)
)
)
),
];
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm bg-gray" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-lg-6 mb-4 mb-lg-0" },
h(
"form",
{},
h("input", {
className: "form-control form-control-lg mb-3",
type: "text",
placeholder: "Ihr Name",
}),
h("input", {
className: "form-control form-control-lg mb-3",
type: "text",
placeholder: "Ihre E-Mail Adresse",
}),
h("input", {
className: "form-control form-control-lg mb-3",
type: "text",
placeholder: "Betreff",
}),
h("textarea", {
className: "form-control form-control-lg mb-3",
placeholder: "Nachricht",
}),
h("button", { className: "btn btn-primary" }, "Senden")
)
),
h(
"div",
{ className: "col-lg-6" },
h(
"div",
{ className: "card" },
h("div", { className: "card-header fw-bold" }, "Kontaktdaten"),
h(
"ul",
{ className: "list-group list-group-flush" },
widgetsFor("kontaktdaten").map((person) =>
h(
"li",
{ className: "list-group-item" },
h("p", { className: "card-title mb-0" }, person.data.name),
h(
"p",
{ className: "text-muted mb-0" },
person.data.position
),
h(
"p",
{ className: "card-text" },
h("i", {
className: "mdi mdi-email-multiple-outline me-2",
}),
person.data.email.replace("@", "(at)")
)
)
),
h(
"li",
{ className: "list-group-item" },
h(
"p",
{ className: "card-text" },
h("i", { className: "mdi mdi-phone-outline me-2" }),
"Telefon: +49-0345/6903156"
),
h(
"p",
{ className: "card-text" },
h("i", { className: "mdi mdi-fax me-2" }),
"Fax: +49-0345/6903157"
)
)
)
)
)
)
)
),
];
};
export default KontaktPreview;

@ -1,26 +1,26 @@
import { PageHeader } from "./components/index.js";
const PagePreview = ({ widgetFor, entry }) => {
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12" },
h("div", { className: "content" }, widgetFor("body"))
)
)
)
),
];
return [
PageHeader(entry),
h(
"section",
{ className: "section-sm" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "row" },
h(
"div",
{ className: "col-12" },
h("div", { className: "content" }, widgetFor("body"))
)
)
)
),
];
};
export default PagePreview;

@ -1,55 +1,55 @@
import { Container, PageHeader, Row, Section } from "./components/index.js";
const ProjektwochePreview = ({ widgetsFor, widgetFor, entry }) => {
return [
PageHeader(entry),
Section([
Container(
Row(h("div", { className: "col-12 mb-4 content" }, widgetFor("body")))
),
Container(
Row([
widgetsFor("tiles").map((tile) =>
h(
"div",
{ className: "col-lg-4 col-sm-6" },
h(
"div",
{
className: "card border-primary rounded-0 hover-shadow mb-4",
},
h(
"div",
{
className: "container fb-tile-color",
style: { backgroundColor: tile.data.bg_color },
},
h("i", {
className: (tile.data.icon ?? "") + " fb-tile-icon",
style: { color: tile.data.font_color },
})
),
h(
"div",
{ className: "card-body" },
h(
"h4",
{ className: "card-title text-truncate" },
tile.data.title
),
h(
"button",
{ type: "button", className: "btn btn-primary btn-sm" },
"Mehr anzeigen"
)
)
)
)
),
])
),
]),
];
return [
PageHeader(entry),
Section([
Container(
Row(h("div", { className: "col-12 mb-4 content" }, widgetFor("body")))
),
Container(
Row([
widgetsFor("tiles").map((tile) =>
h(
"div",
{ className: "col-lg-4 col-sm-6" },
h(
"div",
{
className: "card border-primary rounded-0 hover-shadow mb-4",
},
h(
"div",
{
className: "container fb-tile-color",
style: { backgroundColor: tile.data.bg_color },
},
h("i", {
className: (tile.data.icon ?? "") + " fb-tile-icon",
style: { color: tile.data.font_color },
})
),
h(
"div",
{ className: "card-body" },
h(
"h4",
{ className: "card-title text-truncate" },
tile.data.title
),
h(
"button",
{ type: "button", className: "btn btn-primary btn-sm" },
"Mehr anzeigen"
)
)
)
)
),
])
),
]),
];
};
export default ProjektwochePreview;

@ -1,9 +1,9 @@
const PreviewStyles = [
"https://assets.cantorgymnasium.de/bootstrap/v5/css/bootstrap.min.css",
"https://assets.cantorgymnasium.de/fonts/fira/fira.css",
"https://assets.cantorgymnasium.de/fonts/ubuntu/ubuntu.css",
"https://assets.cantorgymnasium.de/fonts/mdi/v7/css/materialdesignicons.min.css",
"https://cantorgymnasium.de/scss/style.css",
"https://assets.cantorgymnasium.de/bootstrap/v5/css/bootstrap.min.css",
"https://assets.cantorgymnasium.de/fonts/fira/fira.css",
"https://assets.cantorgymnasium.de/fonts/ubuntu/ubuntu.css",
"https://assets.cantorgymnasium.de/fonts/mdi/v7/css/materialdesignicons.min.css",
"https://cantorgymnasium.de/scss/style.css",
];
export default PreviewStyles;

@ -1,67 +1,67 @@
import { Card, TextField } from "./components/index.js";
const AudioShortcode = {
label: "Audiodatei",
openTag: "{{< ",
closeTag: " >}}",
separator: " ",
toProps: (args) => {
if (args.length > 0) {
const src =
args
.find((arg) => arg.startsWith("src="))
?.split("=")[1]
.replaceAll('"', "") ?? "";
return { src: src };
}
return { src: "" };
},
toArgs: ({ src }) => {
return [`src=\"${src}\"`];
},
control: ({ src, onChange, controlProps }) => {
const { collection, field } = controlProps;
label: "Audiodatei",
openTag: "{{< ",
closeTag: " >}}",
separator: " ",
toProps: (args) => {
if (args.length > 0) {
const src =
args
.find((arg) => arg.startsWith("src="))
?.split("=")[1]
.replaceAll('"', "") ?? "";
return { src: src };
}
return { src: "" };
},
toArgs: ({ src }) => {
return [`src=\"${src}\"`];
},
control: ({ src, onChange, controlProps }) => {
const { collection, field } = controlProps;
const handleChange = ({ path }) => {
onChange({ src: path });
};
const handleChange = ({ path }) => {
onChange({ src: path });
};
const handleOpenMediaLibrary = useMediaInsert(
src,
{ collection, field },
handleChange
);
const handleOpenMediaLibrary = useMediaInsert(
src,
{ collection, field },
handleChange
);
return Card([
TextField({
label: "Audiodatei",
value: src,
onChange: (event) => {
onChange({ src: event.target.value });
},
}),
h(
"span",
{ key: "audio-button", className: "flex gap-2 pt-2 px-2" },
h(
"button",
{
type: "button",
onClick: handleOpenMediaLibrary,
className: "btn btn-contained-primary",
},
"wählen"
)
),
]);
},
preview: ({ src }) => {
return h(
"div",
{ className: "card" },
h("audio", { src: src, controls: true })
);
},
return Card([
TextField({
label: "Audiodatei",
value: src,
onChange: (event) => {
onChange({ src: event.target.value });
},
}),
h(
"span",
{ key: "audio-button", className: "flex gap-2 pt-2 px-2" },
h(
"button",
{
type: "button",
onClick: handleOpenMediaLibrary,
className: "btn btn-contained-primary",
},
"wählen"
)
),
]);
},
preview: ({ src }) => {
return h(
"div",
{ className: "card" },
h("audio", { src: src, controls: true })
);
},
};
export default AudioShortcode;

@ -1,75 +1,75 @@
import { Card, TextField } from "./components/index.js";
const CardShortcode = {
label: "Link-Karte",
openTag: "{{< ",
closeTag: " >}}",
separator: " ",
toProps: (args) => {
if (args.length > 0) {
var title = "";
var link = "";
const linkIndex = args.findIndex((arg) => arg.startsWith('link="'));
const titleIndex = args.findIndex((arg) => arg.startsWith('title="'));
for (let arg of args.slice(titleIndex, linkIndex)) {
title += " " + arg.replaceAll("title=", "").replaceAll('"', "");
}
for (let arg of args.slice(linkIndex)) {
link += " " + arg.replaceAll("link=", "").replaceAll('"', "");
}
return { title: title.trim(), link: link.trim() };
}
label: "Link-Karte",
openTag: "{{< ",
closeTag: " >}}",
separator: " ",
toProps: (args) => {
if (args.length > 0) {
var title = "";
var link = "";
const linkIndex = args.findIndex((arg) => arg.startsWith('link="'));
const titleIndex = args.findIndex((arg) => arg.startsWith('title="'));
for (let arg of args.slice(titleIndex, linkIndex)) {
title += " " + arg.replaceAll("title=", "").replaceAll('"', "");
}
for (let arg of args.slice(linkIndex)) {
link += " " + arg.replaceAll("link=", "").replaceAll('"', "");
}
return { title: title.trim(), link: link.trim() };
}
return { title: "", link: "" };
},
toArgs: ({ title, link }) => {
return [`title=\"${title}\"`, `link=\"${link}\"`];
},
control: ({ title, link, onChange }) => {
return Card([
TextField({
label: "Titel",
value: title,
onChange: (event) => {
onChange({ title: event.target.value, link });
},
}),
TextField({
label: "Link",
value: link,
onChange: (event) => {
onChange({ title, link: event.target.value });
},
}),
]);
},
preview: ({ title, link }) => {
return h(
"div",
{ className: "container mb-0" },
h(
"div",
{ className: "card border-primary rounded-0 hover-shadow mb-5" },
h(
"div",
{ className: "card-body mb-0" },
h(
"h4",
{ className: "card-title" },
h("a", { className: "text-decoration-none", href: link }, title)
),
h(
"a",
{
className: "mb-0 btn btn-primary btn-sm text-decoration-none",
href: link,
},
"Mehr anzeigen"
)
)
)
);
},
return { title: "", link: "" };
},
toArgs: ({ title, link }) => {
return [`title=\"${title}\"`, `link=\"${link}\"`];
},
control: ({ title, link, onChange }) => {
return Card([
TextField({
label: "Titel",
value: title,
onChange: (event) => {
onChange({ title: event.target.value, link });
},
}),
TextField({
label: "Link",
value: link,
onChange: (event) => {
onChange({ title, link: event.target.value });
},
}),
]);
},
preview: ({ title, link }) => {
return h(
"div",
{ className: "container mb-0" },
h(
"div",
{ className: "card border-primary rounded-0 hover-shadow mb-5" },
h(
"div",
{ className: "card-body mb-0" },
h(
"h4",
{ className: "card-title" },
h("a", { className: "text-decoration-none", href: link }, title)
),
h(
"a",
{
className: "mb-0 btn btn-primary btn-sm text-decoration-none",
href: link,
},
"Mehr anzeigen"
)
)
)
);
},
};
export default CardShortcode;

Some files were not shown because too many files have changed in this diff Show More