gcg-website/static/admin/index.html
2023-04-20 07:51:28 +02:00

171 lines
5.6 KiB
HTML

<!DOCTYPE html>
<html>
<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-rc.0/dist/main.css" />
<title>Static CMS</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/@staticcms/app@^2.0.0-rc.0/dist/static-cms-app.js"></script>
<script type="module">
// imports
import {
AboutPreview,
BlogPreview,
ContestPreview,
GanztagPreview,
PagePreview,
EventPreview,
AnmeldungPreview,
HeaderPreview,
ChronikPreview,
KontaktPreview,
AnmeldeformularPreview,
ChronikIndexPreview,
AuthorPreview,
FormsPreview,
CantorpreisPreview,
ProjektwochePreview,
AbiturientenPreview,
PreviewStyles,
} from "./previews/page-previews/index.js";
import {
BooleanPreview,
DraftPreview,
CountPreview,
BodyPreview,
DatePreview,
} from "./previews/field-previews/index.js";
import {
GalleryShortcode,
ImageShortcode,
DownloadShortcode,
CardShortcode,
YoutubeShortcode,
AudioShortcode,
SliderShortcode,
} from "./shortcodes/index.js";
import { StatusPage, WikiLink } from "./links/index.js";
import Icons from "./icons.js";
// cms initialization
CMS.init();
// 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("anmeldung-index", AnmeldungPreview);
CMS.registerPreviewTemplate("schulchronik", ChronikPreview);
CMS.registerPreviewTemplate("anmeldeformular", AnmeldeformularPreview);
CMS.registerPreviewTemplate("schulchronik-index", ChronikIndexPreview);
CMS.registerPreviewTemplate("author", AuthorPreview);
CMS.registerPreviewTemplate("forms", FormsPreview);
CMS.registerPreviewTemplate("cantorpreis", CantorpreisPreview);
CMS.registerPreviewTemplate("begabte", ContestPreview);
["projektwoche", "superhaufen"].forEach((page) =>
CMS.registerPreviewTemplate(page, ProjektwochePreview)
);
["abiturienten", "cantorfora"].forEach((page) =>
CMS.registerPreviewTemplate(page, AbiturientenPreview)
);
[
"blog-index",
"cantorpreis-index",
"forms-index",
"ganztagsangebote-index",
"wettbewerbe-index",
"begabte-index",
"abiturienten-index",
"projektwoche-index",
"author-index",
].forEach((page) => CMS.registerPreviewTemplate(page, HeaderPreview));
[
"abiturienten",
"cantorfora-index",
"pages",
"anmeldeformular",
"schulchronik-index",
"chronikseiten",
].forEach((page) => CMS.registerPreviewTemplate(page, PagePreview));
PreviewStyles.forEach((url) => {
CMS.registerPreviewStyle(url);
});
//shortcodes
CMS.registerShortcode("gallery", GalleryShortcode);
CMS.registerShortcode("image", ImageShortcode);
CMS.registerShortcode("download", DownloadShortcode);
CMS.registerShortcode("card", CardShortcode);
CMS.registerShortcode("youtube", YoutubeShortcode);
CMS.registerShortcode("audio", AudioShortcode);
CMS.registerShortcode("slider", SliderShortcode);
// links
CMS.registerAdditionalLink(StatusPage);
CMS.registerAdditionalLink(WikiLink);
// icons
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);
CMS.registerFieldPreview("schulchronik", "topics", CountPreview);
["projektwoche", "superhaufen"].forEach((collection) =>
CMS.registerFieldPreview(collection, "tiles", CountPreview)
);
[
"forms",
"blog",
"cantorpreis",
"pages",
"ganztagsangebote",
"wettbewerbe",
"begabte",
"projektwoche",
"schulchronik",
"abiturienten",
"superhaufen",
"cantorfora",
"chronikseiten",
].forEach((collection) =>
CMS.registerFieldPreview(collection, "draft", DraftPreview)
);
["blog", "author", "chronikseiten", "pages", "cantorpreis", "begabte"].forEach(
(collection) => CMS.registerFieldPreview(collection, "body", BodyPreview)
);
[
"cantorpreis-index",
"wettbewerbe-index",
"abiturienten-index",
"pages",
"projektwoche",
"cantorfora",
"blog-index",
"about-index",
"anmeldung-index",
"contact-index",
"event-index",
"forms-index",
"ganztagsangebote-index",
"begabte-index",
"projektwoche-index",
].forEach((collection) =>
CMS.registerFieldPreview(collection, "description", BodyPreview)
);
["chronikseiten", "blog"].forEach((collection) =>
CMS.registerFieldPreview(collection, "title", BodyPreview)
);
</script>
</body>
</html>