gcg-website/static/schulchronik/admin/index.html
Denys Konovalov d94cc5b584
All checks were successful
website-main / prod-build (push) Successful in 9s
website-main / test-build (push) Successful in 6s
revert c4206b7d341c9f28285efa0582ab0271ddfeaa49
revert Static CMS v4 (#246)

- Static CMS v4
- switch from jsdelivr to unpkg due to performance issues
- custom themes
- preset view_group

Reviewed-on: #246
2023-11-04 23:28:40 +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://cdn.jsdelivr.net/npm/@staticcms/app@^3.0.0/dist/main.css"
/>
<title>Chronikverwaltung</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/@staticcms/app@^3.0.0/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>