gcg-website/static/schulchronik/admin/index.html
Denys Konovalov 79f32dab67
Revert "revert 65260f63c67562ea2821c31d37a0ac3caa755fd8"
This reverts commit f0a4bac2bd6eb33a82a22eeade2a4968b6095daf.
2023-12-12 17:25:51 +01:00

115 lines
3.7 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://unpkg.com/@staticcms/app@next/dist/main.css"
/>
<title>Chronikverwaltung</title>
</head>
<body>
<script src="https://unpkg.com/@staticcms/app@next/dist/static-cms-app.js"></script>
<script type="module">
import config from "../../admin/config/schulchronik.js";
// imports
import {
PagePreview,
HeaderPreview,
ChronikPreview,
ChronikIndexPreview,
CantorpreisPreview,
AbiturientenPreview,
ProjektwochePreview,
PreviewStyles,
} from "../../admin/previews/page-previews/index.js";
import {
BooleanPreview,
DraftPreview,
CountPreview,
BodyPreview,
DatePreview,
} from "../../admin/previews/field-previews/index.js";
import {
GalleryShortcode,
ImageShortcode,
DownloadShortcode,
CardShortcode,
YoutubeShortcode,
AudioShortcode,
SliderShortcode,
} from "../../admin/shortcodes/index.js";
import { WikiLink } from "../../admin/links/index.js";
import Icons from "../../admin/icons.js";
// cms initialization
CMS.init({ config });
// preview templates
CMS.registerPreviewTemplate("chronikjahre", ChronikPreview);
CMS.registerPreviewTemplate("schulchronik-index", ChronikIndexPreview);
CMS.registerPreviewTemplate("cantorpreis", CantorpreisPreview);
CMS.registerPreviewTemplate("superhaufen", ProjektwochePreview);
["abiturienten", "cantorfora"].forEach((page) =>
CMS.registerPreviewTemplate(page, AbiturientenPreview)
);
["cantorpreis-index", "abiturienten-index"].forEach((page) =>
CMS.registerPreviewTemplate(page, HeaderPreview)
);
[
"abiturienten",
"cantorfora-index",
"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(WikiLink);
// icons
Icons.forEach((i) => CMS.registerIcon(i.name, i.icon));
// field previews
CMS.registerFieldPreview("chronikjahre", "topics", CountPreview);
CMS.registerFieldPreview("superhaufen", "tiles", CountPreview);
[
"cantorpreis",
"chronikjahre",
"abiturienten",
"superhaufen",
"cantorfora",
"chronikseiten",
].forEach((collection) =>
CMS.registerFieldPreview(collection, "draft", DraftPreview)
);
["chronikseiten", "cantorpreis"].forEach((collection) =>
CMS.registerFieldPreview(collection, "body", BodyPreview)
);
["cantorpreis-index", "abiturienten-index", "cantorfora"].forEach(
(collection) =>
CMS.registerFieldPreview(collection, "description", BodyPreview)
);
CMS.registerFieldPreview("chronikseiten", "title", BodyPreview);
</script>
</body>
</html>