revert 65260f63c67562ea2821c31d37a0ac3caa755fd8
All checks were successful
website-main / prod-build (push) Successful in 11s
website-main / test-build (push) Successful in 5s

revert Static CMS v4 (#250)

Schließt #247

Reviewed-on: #250
This commit is contained in:
Denys Konovalov 2023-12-12 17:13:58 +01:00
parent 7b229dce9b
commit f0a4bac2bd
22 changed files with 121 additions and 143 deletions

@ -1,4 +1,4 @@
import { MarkdownProps, ImageProps } from "../props.js"; import { MarkdownProps } from "../props.js";
import { DraftBoolean, Title } from "./widgets.js"; import { DraftBoolean, Title } from "./widgets.js";
const AbiturientenCollection = { const AbiturientenCollection = {
@ -33,8 +33,9 @@ const AbiturientenCollection = {
{ {
name: "image", name: "image",
label: "Bild", label: "Bild",
widget: "image",
default: "/media/image.webp", default: "/media/image.webp",
...ImageProps, required: false,
}, },
{ {
name: "type", name: "type",
@ -45,6 +46,7 @@ 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, ImageProps } from "../props.js"; import { MarkdownProps, PatternEmail } from "../props.js";
import { DescriptionText } from "./widgets.js"; import { DescriptionText } from "./widgets.js";
const AuthorCollection = { const AuthorCollection = {
@ -19,49 +19,38 @@ const AuthorCollection = {
field: "type", field: "type",
value: "author", value: "author",
}, },
view_filters: { view_filters: [
filters: [ {
{ label: "aktiv",
name: "active", field: "active",
label: "aktiv", pattern: true,
field: "active", },
pattern: true, {
}, label: "inaktiv",
{ field: "active",
name: "inactive", pattern: false,
label: "inaktiv", },
field: "active", {
pattern: false, label: "einfach",
}, field: "simplified",
{ pattern: true,
name: "simplified", },
label: "einfach", {
field: "simplified", label: "erweitert",
pattern: true, field: "simplified",
}, pattern: false,
{ },
name: "extended", ],
label: "erweitert", view_groups: [
field: "simplified", {
pattern: false, label: "vereinfacht",
}, field: "simplified",
], },
}, {
view_groups: { label: "aktiv",
default: "active", field: "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: [
{ {
@ -81,8 +70,9 @@ 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",
@ -106,6 +96,7 @@ const AuthorCollection = {
{ {
name: "body", name: "body",
label: "Beschreibung", label: "Beschreibung",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps, ImageProps } from "../props.js"; import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js"; import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const BegabteCollection = { const BegabteCollection = {
@ -27,9 +27,9 @@ const BegabteCollection = {
{ {
name: "image", name: "image",
label: "Titelbild", label: "Titelbild",
default: "/media/image.webp", widget: "image",
...ImageProps,
required: true, required: true,
default: "/media/image.webp",
}, },
{ {
name: "class", name: "class",
@ -52,6 +52,7 @@ 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, ImageProps } from "../props.js"; import { DateFormat, MarkdownProps } from "../props.js";
import { import {
AuthorRelation, AuthorRelation,
DescriptionText, DescriptionText,
@ -24,16 +24,12 @@ const BlogCollection = {
field: "type", field: "type",
value: "post", value: "post",
}, },
view_groups: { view_groups: [
default: "draft", {
groups: [ label: "Entwurf",
{ field: "draft",
name: "draft", },
label: "Entwurf", ],
field: "draft",
},
],
},
sortable_fields: { sortable_fields: {
fields: ["date", "title"], fields: ["date", "title"],
default: { default: {
@ -57,9 +53,9 @@ const BlogCollection = {
name: "image", name: "image",
label: "Titelbild", label: "Titelbild",
hint: "16:9 Seitenverhältnis beachten", hint: "16:9 Seitenverhältnis beachten",
default: "/media/image.webp", widget: "image",
...ImageProps,
required: true, required: true,
default: "/media/image.webp",
}, },
AuthorRelation, AuthorRelation,
{ {
@ -106,6 +102,7 @@ const BlogCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps, ImageProps } from "../props.js"; import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js"; import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const CantorforaCollection = { const CantorforaCollection = {
@ -19,6 +19,12 @@ const CantorforaCollection = {
frame: true, frame: true,
size: "half", 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"],
@ -44,8 +50,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,
}, },
{ {
@ -57,6 +63,7 @@ const CantorforaCollection = {
{ {
name: "body", name: "body",
label: "Text", label: "Text",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps, ImageProps } from "../props.js"; import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean } from "./widgets.js"; import { DescriptionText, DraftBoolean } from "./widgets.js";
const CantorpreisCollection = { const CantorpreisCollection = {
@ -45,8 +45,9 @@ const CantorpreisCollection = {
{ {
name: "image", name: "image",
label: "Bild", label: "Bild",
widget: "image",
default: "/media/image.webp", default: "/media/image.webp",
...ImageProps, required: false,
}, },
{ {
name: "type", name: "type",
@ -57,6 +58,7 @@ const CantorpreisCollection = {
{ {
name: "body", name: "body",
label: "Text", label: "Text",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -43,6 +43,7 @@ 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,
}, },
@ -63,6 +64,7 @@ const ChronikjahreCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -100,6 +102,7 @@ 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,
}, },

@ -48,6 +48,7 @@ const ChronikseitenCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -55,6 +55,7 @@ const FormsCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -1,4 +1,4 @@
import { MarkdownProps, ImageProps } from "../props.js"; import { MarkdownProps } from "../props.js";
import { Title, DescriptionText, DraftBoolean } from "./widgets.js"; import { Title, DescriptionText, DraftBoolean } from "./widgets.js";
const GanztagCollection = { const GanztagCollection = {
@ -27,8 +27,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,6 +82,7 @@ const GanztagCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -3,7 +3,6 @@ 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";
@ -37,7 +36,8 @@ const IndexPagesCollection = {
{ {
name: "image", name: "image",
label: "Bild", label: "Bild",
...ImageProps, widget: "image",
required: false,
}, },
{ {
name: "stats", name: "stats",
@ -75,6 +75,7 @@ const IndexPagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -90,6 +91,7 @@ const IndexPagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -105,6 +107,7 @@ const IndexPagesCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },
@ -128,6 +131,7 @@ const IndexPagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -269,6 +273,7 @@ const IndexPagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -284,6 +289,7 @@ const IndexPagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -296,7 +302,8 @@ const IndexPagesCollection = {
{ {
name: "image", name: "image",
label: "Bild", label: "Bild",
...ImageProps, widget: "image",
required: false,
}, },
{ {
name: "quote", name: "quote",

@ -48,6 +48,7 @@ const PagesCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },

@ -32,6 +32,7 @@ const ProjektwocheCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: false, required: false,
...MarkdownProps, ...MarkdownProps,
}, },
@ -60,6 +61,7 @@ const ProjektwocheCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },

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

@ -74,7 +74,8 @@ const SuperhaufenCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
required: false, widget: "markdown",
required: true,
...MarkdownProps, ...MarkdownProps,
}, },
{ {
@ -88,7 +89,8 @@ const SuperhaufenCollection = {
{ {
name: "content", name: "content",
label: "Inhalt", label: "Inhalt",
required: false, widget: "markdown",
required: true,
...MarkdownProps, ...MarkdownProps,
}, },
], ],

@ -1,4 +1,4 @@
import { MarkdownProps, ImageProps } from "../props.js"; import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js"; import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const WettbewerbeCollection = { const WettbewerbeCollection = {
@ -26,7 +26,7 @@ const WettbewerbeCollection = {
{ {
name: "image", name: "image",
label: "Titelbild", label: "Titelbild",
...ImageProps, widget: "image",
required: true, required: true,
default: "/media/image.webp", default: "/media/image.webp",
}, },
@ -63,6 +63,7 @@ const WettbewerbeCollection = {
{ {
name: "body", name: "body",
label: "Inhalt", label: "Inhalt",
widget: "markdown",
required: true, required: true,
...MarkdownProps, ...MarkdownProps,
}, },

@ -17,7 +17,6 @@ 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: {
@ -49,13 +48,6 @@ 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,5 +1,4 @@
const MarkdownProps = { const MarkdownProps = {
widget: "markdown",
toolbar_buttons: { toolbar_buttons: {
main: [ main: [
"bold", "bold",
@ -75,12 +74,4 @@ const PatternEmail = {
], ],
}; };
const ImageProps = { export { MarkdownProps, DateFormat, DataObject, PatternEmail };
widget: "image",
required: false,
media_library: {
folder_support: true,
}
};
export { MarkdownProps, DateFormat, DataObject, PatternEmail, ImageProps };

@ -7,7 +7,6 @@ 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: {
@ -39,13 +38,6 @@ 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,

@ -1,25 +0,0 @@
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://unpkg.com/@staticcms/app@next/dist/main.css" href="https://cdn.jsdelivr.net/npm/@staticcms/app@^3.0.0/dist/main.css"
/> />
<title>Static CMS</title> <title>Static CMS</title>
</head> </head>
<body> <body>
<script src="https://unpkg.com/@staticcms/app@next/dist/static-cms-app.js"></script> <script src="https://cdn.jsdelivr.net/npm/@staticcms/app@^3.0.0/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://unpkg.com/@staticcms/app@next/dist/main.css" href="https://cdn.jsdelivr.net/npm/@staticcms/app@^3.0.0/dist/main.css"
/> />
<title>Chronikverwaltung</title> <title>Chronikverwaltung</title>
</head> </head>
<body> <body>
<script src="https://unpkg.com/@staticcms/app@next/dist/static-cms-app.js"></script> <script src="https://cdn.jsdelivr.net/npm/@staticcms/app@^3.0.0/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