Static CMS v4 #252

Merged
Denys Konovalov merged 5 commits from scmsv4-new into master 2023-12-13 12:43:00 +01:00
22 changed files with 178 additions and 205 deletions

@ -1,4 +1,4 @@
import { MarkdownProps } from "../props.js"; import { EditorProps, MarkdownProps, ImageProps } from "../props.js";
import { DraftBoolean, Title } from "./widgets.js"; import { DraftBoolean, Title } from "./widgets.js";
const AbiturientenCollection = { const AbiturientenCollection = {
@ -13,12 +13,7 @@ const AbiturientenCollection = {
field: "type", field: "type",
value: "abiturienten", value: "abiturienten",
}, },
create: true, ...EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
summary_fields: ["title", "draft"], summary_fields: ["title", "draft"],
sortable_fields: { sortable_fields: {
fields: ["title"], fields: ["title"],
@ -33,9 +28,8 @@ const AbiturientenCollection = {
{ {
name: "image", name: "image",
label: "Bild", label: "Bild",
widget: "image",
default: "/media/image.webp", default: "/media/image.webp",
required: false, ...ImageProps,
}, },
{ {
name: "type", name: "type",
@ -46,7 +40,6 @@ const AbiturientenCollection = {
{ {
name: "body", name: "body",
label: "Text", label: "Text",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps, PatternEmail } from "../props.js"; import { EditorProps, MarkdownProps, PatternEmail, ImageProps } from "../props.js";
import { DescriptionText } from "./widgets.js"; import { DescriptionText } from "./widgets.js";
const AuthorCollection = { const AuthorCollection = {
@ -9,48 +9,54 @@ const AuthorCollection = {
"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. 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.",
icon: "user", icon: "user",
folder: "content/author", folder: "content/author",
create: true, ...EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: { filter: {
field: "type", field: "type",
value: "author", value: "author",
}, },
view_filters: [ view_filters: {
{ filters: [
label: "aktiv", {
field: "active", name: "active",
pattern: true, label: "aktiv",
}, field: "active",
{ pattern: true,
label: "inaktiv", },
field: "active", {
pattern: false, name: "inactive",
}, label: "inaktiv",
{ field: "active",
label: "einfach", pattern: false,
field: "simplified", },
pattern: true, {
}, name: "simplified",
{ label: "einfach",
label: "erweitert", field: "simplified",
field: "simplified", pattern: true,
pattern: false, },
}, {
], name: "extended",
view_groups: [ label: "erweitert",
{ field: "simplified",
label: "vereinfacht", pattern: false,
field: "simplified", },
}, ],
{ },
label: "aktiv", view_groups: {
field: "active", default: "active",
}, groups: [
], {
name: "simplified",
label: "vereinfacht",
field: "simplified",
},
{
name: "active",
label: "aktiv",
field: "active",
},
],
},
summary_fields: ["title", "active", "simplified", "body"], summary_fields: ["title", "active", "simplified", "body"],
fields: [ fields: [
{ {
@ -70,9 +76,8 @@ const AuthorCollection = {
{ {
name: "image", name: "image",
label: "Bild", label: "Bild",
widget: "image",
required: false,
default: "/media/people/gcg.webp", default: "/media/people/gcg.webp",
...ImageProps,
}, },
{ {
name: "simplified", name: "simplified",
@ -96,7 +101,6 @@ const AuthorCollection = {
{ {
name: "body", name: "body",
label: "Beschreibung", label: "Beschreibung",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps } from "../props.js"; import { EditorProps, MarkdownProps, ImageProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js"; import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const BegabteCollection = { const BegabteCollection = {
@ -9,12 +9,7 @@ const BegabteCollection = {
"Hier kann die Übersicht der Begabtenförderungsangebote bearbeitet werden.", "Hier kann die Übersicht der Begabtenförderungsangebote bearbeitet werden.",
icon: "pi", icon: "pi",
folder: "content/begabte", folder: "content/begabte",
create: true, EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: { filter: {
field: "type", field: "type",
value: "begabte", value: "begabte",
@ -27,9 +22,9 @@ const BegabteCollection = {
{ {
name: "image", name: "image",
label: "Titelbild", label: "Titelbild",
widget: "image",
required: true,
default: "/media/image.webp", default: "/media/image.webp",
...ImageProps,
required: true,
}, },
{ {
name: "class", name: "class",
@ -52,7 +47,6 @@ const BegabteCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { DateFormat, MarkdownProps } from "../props.js"; import { EditorProps, DateFormat, MarkdownProps, ImageProps } from "../props.js";
import { import {
AuthorRelation, AuthorRelation,
DescriptionText, DescriptionText,
@ -14,22 +14,21 @@ const BlogCollection = {
'Diese Artikel werden im Bereich "Aktuelles" auf der Schulhomepage angezeigt. Sie können sowohl direkt veröffentlicht, als auch als Entwurf gespeichert werden.', '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", icon: "news",
folder: "content/blog", folder: "content/blog",
create: true, ...EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: { filter: {
field: "type", field: "type",
value: "post", value: "post",
}, },
view_groups: [ view_groups: {
{ default: "draft",
label: "Entwurf", groups: [
field: "draft", {
}, name: "draft",
], label: "Entwurf",
field: "draft",
},
],
},
sortable_fields: { sortable_fields: {
fields: ["date", "title"], fields: ["date", "title"],
default: { default: {
@ -53,9 +52,9 @@ const BlogCollection = {
name: "image", name: "image",
label: "Titelbild", label: "Titelbild",
hint: "16:9 Seitenverhältnis beachten", hint: "16:9 Seitenverhältnis beachten",
widget: "image",
required: true,
default: "/media/image.webp", default: "/media/image.webp",
...ImageProps,
required: true,
}, },
AuthorRelation, AuthorRelation,
{ {
@ -102,7 +101,6 @@ const BlogCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps } from "../props.js"; import { EditorProps, MarkdownProps, ImageProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js"; import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const CantorforaCollection = { const CantorforaCollection = {
@ -14,17 +14,7 @@ const CantorforaCollection = {
value: "cantorfora", value: "cantorfora",
}, },
create: true, create: true,
editor: { ...EditorProps,
preview: true,
frame: true,
size: "half",
},
view_groups: [
{
label: "Entwürfe",
field: "draft",
},
],
summary_fields: ["title", "draft", "description"], summary_fields: ["title", "draft", "description"],
sortable_fields: { sortable_fields: {
fields: ["index", "title"], fields: ["index", "title"],
@ -50,8 +40,8 @@ const CantorforaCollection = {
{ {
name: "image", name: "image",
label: "Titelbild", label: "Titelbild",
widget: "image",
default: "/media/image.webp", default: "/media/image.webp",
...ImageProps,
required: true, required: true,
}, },
{ {
@ -63,7 +53,6 @@ const CantorforaCollection = {
{ {
name: "body", name: "body",
label: "Text", label: "Text",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps } from "../props.js"; import { EditorProps, MarkdownProps, ImageProps } from "../props.js";
import { DescriptionText, DraftBoolean } from "./widgets.js"; import { DescriptionText, DraftBoolean } from "./widgets.js";
const CantorpreisCollection = { const CantorpreisCollection = {
@ -20,12 +20,7 @@ const CantorpreisCollection = {
}, },
}, },
summary: "{{title}} - {{name}}", summary: "{{title}} - {{name}}",
create: true, ...EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
summary_fields: ["title", "name", "draft", "body"], summary_fields: ["title", "name", "draft", "body"],
fields: [ fields: [
{ {
@ -45,9 +40,8 @@ const CantorpreisCollection = {
{ {
name: "image", name: "image",
label: "Bild", label: "Bild",
widget: "image",
default: "/media/image.webp", default: "/media/image.webp",
required: false, ...ImageProps,
}, },
{ {
name: "type", name: "type",
@ -58,7 +52,6 @@ const CantorpreisCollection = {
{ {
name: "body", name: "body",
label: "Text", label: "Text",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -43,7 +43,6 @@ const ChronikjahreCollection = {
name: "pretext", name: "pretext",
label: "Einleitung", label: "Einleitung",
hint: "Text für die Jahreszahl", hint: "Text für die Jahreszahl",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -64,7 +63,6 @@ const ChronikjahreCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -102,7 +100,6 @@ const ChronikjahreCollection = {
name: "body", name: "body",
label: "Text", label: "Text",
hint: "Erscheint zusätzlich zu den Kreativen Haufen", hint: "Erscheint zusätzlich zu den Kreativen Haufen",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps } from "../props.js"; import { EditorProps, MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js"; import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const ChronikseitenCollection = { const ChronikseitenCollection = {
@ -9,12 +9,7 @@ const ChronikseitenCollection = {
"Chronikseiten entsprechen von der Funktionalität herkömmlichen Zusatzseiten, sind allerdings der Schulchronik vorbehalten.", "Chronikseiten entsprechen von der Funktionalität herkömmlichen Zusatzseiten, sind allerdings der Schulchronik vorbehalten.",
icon: "page-add", icon: "page-add",
folder: "content/chronikseiten", folder: "content/chronikseiten",
create: true, ...EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: { filter: {
field: "type", field: "type",
value: "pages", value: "pages",
@ -48,7 +43,6 @@ const ChronikseitenCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps } from "../props.js"; import { EditorProps, MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js"; import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const FormsCollection = { const FormsCollection = {
@ -9,12 +9,7 @@ const FormsCollection = {
"Hier sind Formulare, Vorlagen und andere Dokumente zu hinterlegen.", "Hier sind Formulare, Vorlagen und andere Dokumente zu hinterlegen.",
icon: "document", icon: "document",
folder: "content/forms", folder: "content/forms",
create: true, ...EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: { filter: {
field: "type", field: "type",
value: "forms", value: "forms",
@ -43,6 +38,9 @@ const FormsCollection = {
label: "Datei", label: "Datei",
widget: "file", widget: "file",
required: true, required: true,
media_library: {
folder_support: true,
}
}, },
], ],
}, },
@ -55,7 +53,6 @@ const FormsCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps } from "../props.js"; import { EditorProps, MarkdownProps, ImageProps } from "../props.js";
import { Title, DescriptionText, DraftBoolean } from "./widgets.js"; import { Title, DescriptionText, DraftBoolean } from "./widgets.js";
const GanztagCollection = { const GanztagCollection = {
@ -9,12 +9,7 @@ const GanztagCollection = {
"Hier kann die Übersicht der Ganztagsangebote bearbeitet werden.", "Hier kann die Übersicht der Ganztagsangebote bearbeitet werden.",
icon: "group", icon: "group",
folder: "content/ganztagsangebote", folder: "content/ganztagsangebote",
create: true, ...EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: { filter: {
field: "type", field: "type",
value: "ganztagsangebote", value: "ganztagsangebote",
@ -27,8 +22,8 @@ const GanztagCollection = {
{ {
name: "image", name: "image",
label: "Titelbild", label: "Titelbild",
widget: "image",
default: "/media/ganztagsangebote/image.webp", default: "/media/ganztagsangebote/image.webp",
...ImageProps,
required: true, required: true,
}, },
{ {
@ -82,7 +77,6 @@ const GanztagCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -3,6 +3,7 @@ import {
DateFormat, DateFormat,
MarkdownProps, MarkdownProps,
PatternEmail, PatternEmail,
ImageProps
} from "../props.js"; } from "../props.js";
import { DescriptionText, EnableBoolean, Title } from "./widgets.js"; import { DescriptionText, EnableBoolean, Title } from "./widgets.js";
@ -36,8 +37,7 @@ const IndexPagesCollection = {
{ {
name: "image", name: "image",
label: "Bild", label: "Bild",
widget: "image", ...ImageProps,
required: false,
}, },
{ {
name: "stats", name: "stats",
@ -75,7 +75,6 @@ const IndexPagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -91,7 +90,6 @@ const IndexPagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -107,7 +105,6 @@ const IndexPagesCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },
@ -131,7 +128,6 @@ const IndexPagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -273,7 +269,6 @@ const IndexPagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -289,7 +284,6 @@ const IndexPagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -302,8 +296,7 @@ const IndexPagesCollection = {
{ {
name: "image", name: "image",
label: "Bild", label: "Bild",
widget: "image", ...ImageProps,
required: false,
}, },
{ {
name: "quote", name: "quote",

@ -1,4 +1,4 @@
import { MarkdownProps } from "../props.js"; import { EditorProps, MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js"; import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const PagesCollection = { const PagesCollection = {
@ -9,12 +9,7 @@ const PagesCollection = {
"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.", "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", icon: "page-add",
folder: "content/pages", folder: "content/pages",
create: true, ...EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: { filter: {
field: "type", field: "type",
value: "pages", value: "pages",
@ -48,7 +43,6 @@ const PagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps } from "../props.js"; import { EditorProps, MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, IconList, Title } from "./widgets.js"; import { DescriptionText, DraftBoolean, IconList, Title } from "./widgets.js";
const ProjektwocheCollection = { const ProjektwocheCollection = {
@ -12,12 +12,7 @@ const ProjektwocheCollection = {
field: "type", field: "type",
value: "projektwoche", value: "projektwoche",
}, },
create: true, ...EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
summary_fields: ["title", "draft", "tiles", "description"], summary_fields: ["title", "draft", "tiles", "description"],
fields: [ fields: [
Title(false), Title(false),
@ -32,7 +27,6 @@ const ProjektwocheCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -61,7 +55,6 @@ const ProjektwocheCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },

@ -3,6 +3,7 @@ import {
DateFormat, DateFormat,
MarkdownProps, MarkdownProps,
PatternEmail, PatternEmail,
ImageProps
} from "../props.js"; } from "../props.js";
import { import {
ButtonObject, ButtonObject,
@ -40,7 +41,6 @@ const SettingsCollection = {
{ {
name: "text", name: "text",
label: "Text", label: "Text",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -90,7 +90,7 @@ const SettingsCollection = {
{ {
name: "bg_image", name: "bg_image",
label: "Hintergrundbild", label: "Hintergrundbild",
widget: "image", ...ImageProps,
required: true, required: true,
}, },
Title(false), Title(false),
@ -136,7 +136,7 @@ const SettingsCollection = {
{ {
name: "image", name: "image",
label: "Grafik", label: "Grafik",
widget: "image", ...ImageProps,
required: true, required: true,
}, },
], ],
@ -153,7 +153,6 @@ const SettingsCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -175,7 +174,7 @@ const SettingsCollection = {
{ {
name: "image", name: "image",
label: "Hintergrundbild", label: "Hintergrundbild",
widget: "image", ...ImageProps,
required: true, required: true,
}, },
{ {
@ -200,13 +199,11 @@ const SettingsCollection = {
{ {
name: "image", name: "image",
label: "Grafik", label: "Grafik",
widget: "image", ...ImageProps,
required: false,
}, },
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -228,7 +225,6 @@ const SettingsCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -269,14 +265,13 @@ const SettingsCollection = {
{ {
name: "bg_image", name: "bg_image",
label: "Hintergrundbild", label: "Hintergrundbild",
widget: "image", ...ImageProps,
required: true, required: true,
}, },
Title(false), Title(false),
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -304,13 +299,11 @@ const SettingsCollection = {
{ {
name: "image", name: "image",
label: "Bild", label: "Bild",
widget: "image", ...ImageProps,
required: false,
}, },
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -340,7 +333,7 @@ const SettingsCollection = {
{ {
name: "image", name: "image",
label: "Grafik", label: "Grafik",
widget: "image", ...ImageProps,
required: true, required: true,
}, },
], ],
@ -360,13 +353,12 @@ const SettingsCollection = {
{ {
name: "image", name: "image",
label: "Titelbild", label: "Titelbild",
widget: "image", ...ImageProps,
required: true, required: true,
}, },
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -512,7 +504,7 @@ const SettingsCollection = {
{ {
name: "logo", name: "logo",
label: "Logo", label: "Logo",
widget: "image", ...ImageProps,
required: true, required: true,
}, },
{ {
@ -579,13 +571,13 @@ const SettingsCollection = {
{ {
name: "preloader", name: "preloader",
label: "Logo", label: "Logo",
widget: "image", ...ImageProps,
required: true, required: true,
}, },
{ {
name: "loader", name: "loader",
label: "Ladeanimation", label: "Ladeanimation",
widget: "image", ...ImageProps,
required: true, required: true,
}, },
], ],
@ -630,7 +622,6 @@ const SettingsCollection = {
name: "copyright", name: "copyright",
label: "Copyright-Eintrag", label: "Copyright-Eintrag",
hint: "Am Seitenende sichtbar", hint: "Am Seitenende sichtbar",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps } from "../props.js"; import { EditorProps, MarkdownProps } from "../props.js";
import { DraftBoolean, EnableBoolean, Title } from "./widgets.js"; import { DraftBoolean, EnableBoolean, Title } from "./widgets.js";
const SuperhaufenCollection = { const SuperhaufenCollection = {
@ -12,12 +12,7 @@ const SuperhaufenCollection = {
field: "type", field: "type",
value: "superhaufen", value: "superhaufen",
}, },
create: true, ...EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
summary_fields: ["title", "draft", "tiles"], summary_fields: ["title", "draft", "tiles"],
fields: [ fields: [
Title(false), Title(false),
@ -74,8 +69,7 @@ const SuperhaufenCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown", required: false,
required: true,
...MarkdownProps, ...MarkdownProps,
}, },
{ {
@ -89,8 +83,7 @@ const SuperhaufenCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown", required: false,
required: true,
...MarkdownProps, ...MarkdownProps,
}, },
], ],

@ -1,4 +1,4 @@
import { MarkdownProps } from "../props.js"; import { EditorProps, MarkdownProps, ImageProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js"; import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const WettbewerbeCollection = { const WettbewerbeCollection = {
@ -8,12 +8,7 @@ const WettbewerbeCollection = {
description: "Hier kann die Übersicht der Wettbewerbe bearbeitet werden.", description: "Hier kann die Übersicht der Wettbewerbe bearbeitet werden.",
icon: "trophy", icon: "trophy",
folder: "content/wettbewerbe", folder: "content/wettbewerbe",
create: true, ...EditorProps,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: { filter: {
field: "type", field: "type",
value: "wettbewerbe", value: "wettbewerbe",
@ -26,7 +21,7 @@ const WettbewerbeCollection = {
{ {
name: "image", name: "image",
label: "Titelbild", label: "Titelbild",
widget: "image", ...ImageProps,
required: true, required: true,
default: "/media/image.webp", default: "/media/image.webp",
}, },
@ -63,7 +58,6 @@ const WettbewerbeCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },

@ -17,6 +17,7 @@ import {
SuperhaufenCollection, SuperhaufenCollection,
WettbewerbeCollection, WettbewerbeCollection,
} from "./collections/index.js"; } from "./collections/index.js";
import { GCGThemeDark, GCGThemeLight } from "./themes.js";
const config = { const config = {
backend: { backend: {
@ -35,7 +36,7 @@ const config = {
}, },
}, },
local_backend: true, local_backend: true,
media_folder: "/static/media", media_folder: "static/media",
public_folder: "/media", public_folder: "/media",
media_library: { media_library: {
max_file_size: 10240000, max_file_size: 10240000,
@ -48,6 +49,13 @@ const config = {
clean_accents: true, clean_accents: true,
sanitize_replacement: "-", sanitize_replacement: "-",
}, },
theme: {
include_built_in_themes: false,
themes: [
GCGThemeDark,
GCGThemeLight
]
},
collections: [ collections: [
SettingsCollection, SettingsCollection,
IndexPagesCollection, IndexPagesCollection,

@ -1,4 +1,14 @@
const EditorProps = {
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
};
const MarkdownProps = { const MarkdownProps = {
widget: "markdown",
toolbar_buttons: { toolbar_buttons: {
main: [ main: [
"bold", "bold",
@ -53,6 +63,9 @@ const MarkdownProps = {
"shortcode", "shortcode",
], ],
}, },
media_library: {
folder_support: true,
}
}; };
const DateFormat = { const DateFormat = {
@ -74,4 +87,12 @@ const PatternEmail = {
], ],
}; };
export { MarkdownProps, DateFormat, DataObject, PatternEmail }; const ImageProps = {
widget: "image",
required: false,
media_library: {
folder_support: true,
}
};
export { EditorProps, MarkdownProps, DateFormat, DataObject, PatternEmail, ImageProps };

@ -7,6 +7,7 @@ import {
StatsCollection, StatsCollection,
SuperhaufenCollection, SuperhaufenCollection,
} from "./collections/index.js"; } from "./collections/index.js";
import { GCGThemeDark, GCGThemeLight } from "./themes.js";
const config = { const config = {
backend: { backend: {
@ -25,7 +26,7 @@ const config = {
}, },
}, },
local_backend: true, local_backend: true,
media_folder: "/static/media", media_folder: "static/media",
public_folder: "/media", public_folder: "/media",
media_library: { media_library: {
max_file_size: 10240000, max_file_size: 10240000,
@ -38,6 +39,13 @@ const config = {
clean_accents: true, clean_accents: true,
sanitize_replacement: "-", sanitize_replacement: "-",
}, },
theme: {
include_built_in_themes: false,
themes: [
GCGThemeDark,
GCGThemeLight
]
},
collections: [ collections: [
ChronikjahreCollection, ChronikjahreCollection,
SuperhaufenCollection, SuperhaufenCollection,

@ -0,0 +1,25 @@
const GCGThemeDark = {
name: "GCG.Dark",
extends: "dark",
primary: {
main: "#ffbc3b",
contrastColor: "#4b4b4b",
},
background: {
main: "#1a1a37",
dark: "#13132d",
},
};
const GCGThemeLight = {
name: "GCG.Light",
extends: "light",
primary: {
main: "#1a1a37",
},
background: {
dark: "#f1f3f5",
},
};
export { GCGThemeDark, GCGThemeLight };

@ -9,12 +9,12 @@
/> />
<link <link
rel="stylesheet" rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@staticcms/app@^3.0.0/dist/main.css" href="https://unpkg.com/@staticcms/app@next/dist/main.css"
/> />
<title>Static CMS</title> <title>Static CMS</title>
</head> </head>
<body> <body>
<script src="https://cdn.jsdelivr.net/npm/@staticcms/app@^3.0.0/dist/static-cms-app.js"></script> <script src="https://unpkg.com/@staticcms/app@next/dist/static-cms-app.js"></script>
<script type="module"> <script type="module">
import config from "./config/index.js"; import config from "./config/index.js";
// imports // imports

@ -9,12 +9,12 @@
/> />
<link <link
rel="stylesheet" rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@staticcms/app@^3.0.0/dist/main.css" href="https://unpkg.com/@staticcms/app@next/dist/main.css"
/> />
<title>Chronikverwaltung</title> <title>Chronikverwaltung</title>
</head> </head>
<body> <body>
<script src="https://cdn.jsdelivr.net/npm/@staticcms/app@^3.0.0/dist/static-cms-app.js"></script> <script src="https://unpkg.com/@staticcms/app@next/dist/static-cms-app.js"></script>
<script type="module"> <script type="module">
import config from "../../admin/config/schulchronik.js"; import config from "../../admin/config/schulchronik.js";
// imports // imports