chronik CMS refactor

This commit is contained in:
2023-02-26 21:34:27 +01:00
parent 949f3cbe95
commit 02c23a936d
33 changed files with 1077 additions and 359 deletions

View File

@ -0,0 +1,215 @@
backend:
name: gitea
repo: gcg/gcg-website
branch: master
api_root: https://git.cantorgymnasium.de/api/v1
base_url: https://oauth.cantorgymnasium.de
commit_messages:
create: "{{collection}} {{slug}} erstellt"
update: "{{collection}} {{slug}} aktualisiert"
delete: "{{collection}} {{slug}} gelöscht"
uploadMedia: "{{path}} hochgeladen"
deleteMedia: "{{path}} gelöscht"
local_backend: true
media_folder: "/static/media/schulchronik"
public_folder: "/media/schulchronik"
site_url: https://cantorgymnasium.de/schulchronik/
display_url: https://cantorgymnasium.de/schulchronik/
locale: "de"
slug:
encoding: "ascii"
clean_accents: true
sanitize_replacement: "-"
show_preview_links: false
collections:
- name: "index-pages"
icon: "page"
label: "Übersichten"
editor:
preview: true
frame: true
files:
- name: "cantorpreis-index"
label: "Cantor-Preis"
file: "content/german/cantorpreis/_index.md"
fields:
- {label: "Titel", name: "title", widget: "string"}
- {label: "Inaktiv", name: "draft", widget: "boolean", default: false, required: false, hint: "Diese Einstellung deaktiviert den Bereich auf der Website."}
- {label: "Hintergrundbild", name: "bg_image", widget: "hidden", default: "/media/backgrounds/page-title.webp"}
- {label: "Einleitung", name: "description", widget: "text", required: false}
- name: "abiturienten"
label: "Abiturienten"
file: "content/german/abiturienten/_index.md"
fields:
- {label: "Titel", name: "title", widget: "string"}
- {label: "Inaktiv", name: "draft", widget: "boolean", default: false, required: false, hint: "Diese Einstellung deaktiviert den Bereich auf der Website."}
- {label: "Hintergrundbild", name: "bg_image", widget: "hidden", default: "/media/backgrounds/page-title.webp"}
- {label: "Einleitung", name: "description", widget: "text", required: false}
- name: "cantorfora"
label: "Cantorfora"
file: "content/german/cantorfora/_index.md"
fields:
- {label: "Titel", name: "title", widget: "string"}
- {label: "Inaktiv", name: "draft", widget: "boolean", default: false, required: false, hint: "Diese Einstellung deaktiviert den Bereich auf der Website."}
- {label: "Hintergrundbild", name: "bg_image", widget: "hidden", default: "/media/backgrounds/page-title.webp"}
- {label: "Einleitung", name: "description", widget: "text", required: false}
- {label: "Gallerie-Komponente", name: "gallery", widget: "boolean", default: false, required: false, hint: "Benötigt für Gallerie bzw. Bildeinbettung"}
- {label: "Text", name: "body", widget: "markdown", required: false}
- name: "chronikseiten"
icon: "page-add"
label: "Inhalt"
label_singular: "Seite"
folder: "content/german/chronikseiten"
create: true
editor:
preview: true
frame: true
slug: "{{slug}}"
fields:
- {label: "Titel", name: "title", widget: "string"}
- {label: "Entwurf", name: "draft", widget: "boolean", default: false, required: false}
- {label: "Hintergrundbild", name: "bg_image", widget: "hidden", default: "/media/backgrounds/page-title.webp"}
- {label: "Metabeschreibung", name: "description", widget: "text", required: false}
- {label: "Type", name: "type", widget: "hidden", default: "pages"}
- {label: "Layout", name: "layout", widget: "hidden", default: "single.html"}
- {label: "Gallerie-Komponente", name: "gallery", widget: "boolean", default: false, required: false, hint: "Benötigt für Gallerie bzw. Bildeinbettung"}
- label: "Aliase"
name: "aliases"
widget: "list"
required: false
fields:
- label: "Alias"
name: "alias"
widget: "string"
- {label: "Text", name: "body", widget: "markdown", required: false}
- name: "cantorpreis"
icon: "award"
label: "Cantor-Preisträger"
label_singular: "Cantor-Preisträger"
folder: "content/german/cantorpreis"
filter: {field: "type", value: "cantorpreis"}
sortable_fields:
fields: ['title', 'name']
default:
field: title
direction: Descending
summary: "{{title}} - {{name}}"
create: true
editor:
preview: false
media_folder: '/static/media/cantorpreis'
public_folder: '/media/cantorpreis'
fields:
- {label: "Jahr", name: "title", widget: "string"}
- {label: "Entwurf", name: "draft", widget: "boolean", default: false, required: false}
- {label: "Hintergrundbild", name: "bg_image", widget: "hidden", default: "/media/backgrounds/page-title.webp"}
- {label: "Beschreibung", name: "description", widget: "text", required: false}
- {label: "Bild", name: "image", widget: "image", default: "/media/cantorpreis/image.webp", required: false, media_library: { config: { max_file_size: 2048000 } } }
- {label: "Name", name: "name", widget: "string"}
- label: "Kontaktdaten/Soz. Netzwerke"
name: "contact"
widget: "list"
required: false
fields:
- {label: "Bezeichnung", name: "name", widget: "string"}
- label: "Symbol"
name: "icon"
widget: "select"
options:
- { label: "YouTube", value: "mdi mdi-youtube" }
- { label: "Twitter", value: "mdi mdi-twitter" }
- { label: "Pinterest", value: "mdi mdi-pinterest" }
- { label: "GitHub", value: "mdi mdi-github" }
- { label: "Git", value: "mdi mdi-git" }
- { label: "Vimeo", value: "mdi mdi-vimeo" }
- { label: "Instagram", value: "mdi mdi-instagram" }
- { label: "Facebook", value: "mdi mdi-facebook" }
- { label: "Linkedin", value: "mid mdi-linkedin" }
- { label: "E-Mail", value: "mdi mdi-at" }
- { label: "Sonstige", value: "mdi mdi-share-variant-outline" }
- {label: "Link", name: "link", widget: "string"}
- {label: "Type", name: "type", widget: "hidden", default: "cantorpreis"}
- {label: "Gallerie-Komponente", name: "gallery", widget: "boolean", default: false, required: false, hint: "Benötigt für Gallerie bzw. Bildeinbettung"}
- {label: "Text", name: "body", widget: "markdown", required: false}
- name: "schulchronik"
icon: "pillar"
label: "Schulchronik"
label_singular: "Chronikjahr"
folder: "content/german/schulchronik"
filter: {field: "type", value: "schulchronik"}
create: true
editor:
preview: false
media_folder: '/static/media/schulchronik'
public_folder: '/media/schulchronik'
fields:
- {label: "Titel", name: "title", widget: "string"}
- {label: "Entwurf", name: "draft", widget: "boolean", default: false, required: false}
- {label: "Hintergrundbild", name: "bg_image", widget: "hidden", default: "/media/backgrounds/page-title.webp"}
- {label: "Type", name: "type", widget: "hidden", default: "schulchronik"}
- {label: "Einleitung", name: "pretext", hint: "Jahreszahltext", widget: "markdown", required: false}
- label: "Kreative Haufen"
name: "topics"
widget: "list"
fields:
- {label: "Titel", name: "title", widget: "string", required: true}
- {label: "Inhalt", name: "content", widget: "markdown", required: true}
required: false
- {label: "Gallerie-Komponente", name: "gallery", widget: "boolean", default: true, required: false, hint: "Benötigt für Gallerie bzw. Bildeinbettung"}
- {label: "Text", name: "body", widget: "markdown", required: false, default: ""}
- name: "abiturienten"
icon: "graduation-cap"
label: "Abiturienten"
label_singular: "Abiturjahrgang"
folder: "content/german/abiturienten"
filter: {field: "type", value: "abiturienten"}
create: true
editor:
preview: false
media_folder: '/static/media/abiturienten'
public_folder: '/media/abiturienten'
fields:
- {label: "Titel", name: "title", widget: "string"}
- {label: "Entwurf", name: "draft", widget: "boolean", default: false, required: false}
- {label: "Hintergrundbild", name: "bg_image", widget: "hidden", default: "/media/backgrounds/page-title.webp"}
- {label: "Bild", name: "image", widget: "image", default: "/media/abiturienten/image.webp", required: false, media_library: { config: { max_file_size: 2048000 } } }
- {label: "Mehrere Bilder", name: "multiple", widget: "boolean", default: false, required: false}
- {label: "Type", name: "type", widget: "hidden", default: "abiturienten"}
- {label: "Gallerie-Komponente", name: "gallery", widget: "boolean", default: true, required: false, hint: "Benötigt für Gallerie bzw. Bildeinbettung"}
- {label: "Text", name: "body", widget: "markdown"}
- name: "cantorfora"
icon: "presentation"
label: "Cantorfora"
label_singular: "Cantorforum"
folder: "content/german/cantorfora"
filter: {field: "type", value: "cantorfora"}
create: true
slug: "{{slug}}"
editor:
preview: true
frame: true
media_folder: '/static/media/cantorfora'
public_folder: '/media/cantorfora'
view_groups:
- label: Drafts
field: draft
sortable_fields:
fields: ['index', 'title']
default:
field: index
direction: Ascending
fields:
- {label: "Titel", name: "title", widget: "string"}
- {label: "Laufindex", name: "index", widget: "number", value_type: 'int', min: 1, step: 1, required: true, hint: "Nummer des Cantorforums"}
- {label: "Entwurf", name: "draft", widget: "boolean", default: false, required: false}
- {label: "Hintergrundbild", name: "bg_image", widget: "hidden", default: "/media/backgrounds/page-title.webp"}
- {label: "Metabeschreibung", name: "description", widget: "text", default: "", required: false}
- {label: "Beitragsbild", name: "image", widget: "image", default: "/media/image.webp", media_library: { config: { max_file_size: 2048000 } } }
- {label: "Type", name: "type", widget: "hidden", default: "cantorfora"}
- {label: "Gallerie-Komponente", name: "gallery", widget: "boolean", default: true, required: false, hint: "Benötigt für Gallerie bzw. Bildeinbettung"}
- {label: "Text", name: "body", widget: "markdown"}

View File

@ -0,0 +1,574 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/plugins/mdi/css/materialdesignicons.min.css">
<title>Chronikverwaltung</title>
</head>
<body>
<style>
body {
font-family: sans-serif;
}
.icon-md {
font-size: 25px;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/@staticcms/app@^1.2.7/dist/static-cms-app.js"></script>
<!--script src="https://cantorgymnasium.de/plugins/wordcloud/wordcloud2.min.js"></script-->
<script id="cms-init">
CMS.init();
</script>
<script id="icons">
var icons = [['settings', 'mdi mdi-cog-outline'], ['user', 'mdi mdi-fountain-pen-tip'], ['page', 'mdi mdi-file-document-outline'], ['page-add', 'mdi mdi-file-document-plus-outline'], ['document', 'mdi mdi-file-document-multiple-outline'], ['news', 'mdi mdi-newspaper'], ['award', 'mdi mdi-seal-variant'], ['group', 'mdi mdi-crowd'], ['trophy', 'mdi mdi-trophy-outline'], ['pi', 'mdi mdi-pi-box'], ['pillar', 'mdi mdi-pillar'], ['graduation-cap', 'mdi mdi-school-outline'], ['help', 'mdi mdi-lifebuoy'], ['dash', 'mdi mdi-monitor-dashboard'], ['presentation', 'mdi mdi-presentation']];
icons.forEach(icon => {
CMS.registerIcon(icon[0], ({}) => { return(h('i', {className: icon[1] + " icon-md"})); });
});
</script>
<script id="links">
CMS.registerAdditionalLink({
id: 'wiki',
title: 'GCG.Wiki',
data: 'https://wiki.cantorgymnasium.de',
options: {
icon: 'help',
},
});
</script>
<script>
CMS.registerShortcode('gallery', {
label: 'Gallerie',
openTag: '{{< ',
closeTag: ' />}}',
separator: ' ',
toProps: args => {
if (args.length > 0) {
var dir = args.find(arg => arg.startsWith('dir='))?.split('=')[1].replaceAll("\"","") ?? '';
return { dir: dir };
}
return { dir: '' };
},
toArgs: ({ dir }) => {
return [`dir=\"${dir}\"`];
},
control: ({ dir, onChange }) => {
return h('div', {className: "row", style: { border: "1px solid #868686", borderRadius: "8px", padding: "10px" }},
h('b', {style: {width: "30%", fontFamily: "sans-serif", margin: "10px"}}, "Gallerie-Ordner: "),
h('input', {
key: 'control-input',
value: dir,
style: {
border: "1px solid #ced4da", borderRadius: "8px", padding: "10px", width: "80%"
},
onChange: event => {
onChange({ dir: event.target.value });
},
}));
},
preview: ({ dir }) => {
return h('div', {className: "row", style: { border: "1px solid #868686", borderRadius: "8px", padding: "10px", marginBottom: "5px" }},
h('b', {style: { marginRight: "5px" }}, "Gallerie-Ordner:"),
h('code', {}, dir));
},
});
CMS.registerShortcode('figure', {
label: 'Bild',
openTag: '{{< ',
closeTag: ' >}}',
separator: ' ',
toProps: args => {
if (args.length > 0) {
var src = args.find(arg => arg.startsWith('src='))?.split('=')[1].replaceAll("\"","") ?? '';
return { src };
}
return { dir: '' };
},
toArgs: ({ src }) => {
return [`src=\"${src}\"`];
},
control: ({ src, onChange }) => {
return h('div', {className: "row", style: { border: "1px solid #868686", borderRadius: "16px", padding: "10px" }},
h('b', {style: {width: "30%", fontFamily: "sans-serif", margin: "10px"}}, "Bild-Pfad:"),
h('input', {
key: 'control-input',
value: src,
style: {
border: "1px solid #ced4da", borderRadius: "8px", padding: "10px", width: "80%"
},
onChange: event => {
onChange({ src: event.target.value });
},
}));
},
preview: ({ src }) => {
return h('div', {className: "row", style: { border: "1px solid #ccc", borderRadius: "16px", padding: "10px" }},
h('b', {style: { marginRight: "5px" }}, "Gallerie-Ordner:"),
h('code', {}, src));
},
});
CMS.registerShortcode('download', {
label: 'Download-Karte',
openTag: '{{< ',
closeTag: ' >}}',
separator: ' ',
toProps: args => {
if (args.length > 0) {
var title = "";
var link = "";
var linkIndex = args.findIndex(arg => arg.startsWith('link="'));
var titleIndex = args.findIndex(arg => arg.startsWith('title="'));
if (titleIndex + 1 < linkIndex) {
title += args.find(arg => arg.startsWith('title='))?.split('=')[1].replaceAll("\"","") ?? '';
for (let i = titleIndex + 1; i < linkIndex; i++) {
title += " " + args[i].replaceAll("\"","") ;
}
} else {
title = args.find(arg => arg.startsWith('title='))?.split('=')[1].replaceAll("\"","") ?? ''
}
if (linkIndex + 1 < args.length) {
link += args.find(arg => arg.startsWith('link='))?.split('=')[1].replaceAll("\"","") ?? '';
for (let i = linkIndex + 1; i < args.length; i++) {
link += " " + args[i].replaceAll("\"","");
}
} else {
link = args.find(arg => arg.startsWith('link='))?.split('=')[1].replaceAll("\"","") ?? ''
}
title.trim();
link.trim();
return { title: title, link: link };
}
return { title: '', link: '' };
},
toArgs: ({ title, link }) => {
return [`title=\"${title}\"`, `link=\"${link}\"`];
},
control: ({ title, link, onChange }) => {
return h('div', {className: "row", style: { border: "1px solid #868686", borderRadius: "8px", padding: "10px" }},
h('b', {style: {width: "30%", fontFamily: "sans-serif", margin: "10px"}}, "Download-Karte:"),
h('input', {
key: 'control-input',
value: title,
style: {
border: "1px solid #ced4da", borderRadius: "8px", padding: "10px", width: "35%", marginLeft: "5px", marginRight: "5px"
},
onChange: event => {
onChange({ title: event.target.value, link: link });
},
}),
h('input', {
key: 'control-input',
value: link,
style: {
border: "1px solid #ced4da", borderRadius: "8px", padding: "10px", width: "35%", marginLeft: "5px", marginRight: "5px"
},
onChange: event => {
onChange({ title: title, link: event.target.value });
},
})
);
},
preview: ({ title, link }) => {
return h('div', {className: "container mb-0"},
h('div', {className: "card border-primary rounded-0 hover-shadow mb-5"},
h('div', {className: "card-body mb-0"},
h('h4', {className: "card-title"},
h('a', {className: "text-decoration-none", href: link}, title),
),
h('a', {className: "mb-0 btn btn-primary btn-sm text-decoration-none", href: link}, "Download")
)))},
});
CMS.registerShortcode('card', {
label: 'Link-Karte',
openTag: '{{< ',
closeTag: ' >}}',
separator: ' ',
toProps: args => {
if (args.length > 0) {
var title = "";
var link = "";
var linkIndex = args.findIndex(arg => arg.startsWith('link="'));
var titleIndex = args.findIndex(arg => arg.startsWith('title="'));
if (titleIndex + 1 < linkIndex) {
title += args.find(arg => arg.startsWith('title='))?.split('=')[1].replaceAll("\"","") ?? '';
for (let i = titleIndex + 1; i < linkIndex; i++) {
title += " " + args[i].replaceAll("\"","") ;
}
} else {
title = args.find(arg => arg.startsWith('title='))?.split('=')[1].replaceAll("\"","") ?? ''
}
if (linkIndex + 1 < args.length) {
link += args.find(arg => arg.startsWith('link='))?.split('=')[1].replaceAll("\"","") ?? '';
for (let i = linkIndex + 1; i < args.length; i++) {
link += " " + args[i].replaceAll("\"","");
}
} else {
link = args.find(arg => arg.startsWith('link='))?.split('=')[1].replaceAll("\"","") ?? ''
}
title.trim();
link.trim();
return { title: title, link: link };
}
return { title: '', link: '' };
},
toArgs: ({ title, link }) => {
return [`title=\"${title}\"`, `link=\"${link}\"`];
},
control: ({ title, link, onChange }) => {
return h('div', {className: "row", style: { border: "1px solid #868686", borderRadius: "8px", padding: "10px" }},
h('b', {style: {width: "30%", fontFamily: "sans-serif", margin: "10px"}}, "Link-Karte:"),
h('input', {
key: 'control-input',
value: title,
style: {
border: "1px solid #ced4da", borderRadius: "8px", padding: "10px", width: "40%", marginLeft: "5px", marginRight: "5px"
},
onChange: event => {
onChange({ title: event.target.value, link: link });
},
}),
h('input', {
key: 'control-input',
value: link,
style: {
border: "1px solid #ced4da", borderRadius: "8px", padding: "10px", width: "40%", marginLeft: "5px", marginRight: "5px"
},
onChange: event => {
onChange({ title: title, link: event.target.value });
},
})
);
},
preview: ({ title, link }) => {
return h('div', {className: "container mb-0"},
h('div', {className: "card border-primary rounded-0 hover-shadow mb-5"},
h('div', {className: "card-body mb-0"},
h('h4', {className: "card-title"},
h('a', {className: "text-decoration-none", href: link}, title),
),
h('a', {className: "mb-0 btn btn-primary btn-sm text-decoration-none", href: link}, "Mehr anzeigen")
)))},
});
CMS.registerShortcode('youtube', {
label: 'YouTube-Video',
openTag: '{{< ',
closeTag: ' >}}',
separator: ' ',
toProps: args => {
if (args.length > 0) {
return { src: args[0] };
}
return { src: '' };
},
toArgs: ({ src }) => { return [src] },
control: ({ src, onChange }) => {
return h('div', {className: "row", style: { border: "1px solid #868686", borderRadius: "8px", padding: "10px" }},
h('b', {style: {fontFamily: "sans-serif", margin: "10px"}}, "YoutTube-Video:"),
h('input', {
key: 'control-input',
value: src,
style: {
border: "1px solid #ced4da", borderRadius: "8px", padding: "10px", width: "80%"
},
onChange: event => {
onChange({ src: event.target.value });
},
}),
h('div', {className: "row", style: {"marginTop": "10px"}},
h(
'iframe',
{
key: 'control-preview',
width: '100%',
height: '360',
src: `https://piped.kavin.rocks/embed/${src}`,
style: { borderRadius: "8px" }
},
'',
)
));
},
preview: ({ src }) => {
return h(
'span',
{},
h(
'iframe',
{
width: '420',
height: '315',
src: `https://piped.kavin.rocks/embed/${src}`,
},
'',
),
);
},
});
</script>
<script id="preview-styles">
CMS.registerPreviewStyle("https://cantorgymnasium.de/plugins/bootstrap/bootstrap.min.css");
CMS.registerPreviewStyle("https://cantorgymnasium.de/plugins/fira/fira.css");
CMS.registerPreviewStyle("https://cantorgymnasium.de/plugins/mdi/css/materialdesignicons.min.css");
CMS.registerPreviewStyle("https://cantorgymnasium.de/scss/style.css");
</script>
<!--script>
var ChronikPreview = ({widgetFor, widgetsFor, entry, document, window }) => {
const divStyle = {
backgroundImage: 'url("/media/backgrounds/page-title.webp"),url("/media/backgrounds/page-title.webp")',
};
return h('div', {"id": "sc-root"},
h('section', {className: "page-title-section overlay", style: divStyle},
h('div', {className: "container"},
h('div', {className: "col-md-8"},
h('ul', {className: "list-inline"},
h('li', {className: "list-inline-item h2"},
h('a', {className: "text-primary font-secondary", href: ""}, "Schulchronik")),
h('li', {className: "list-inline-item h2"},
h("i", {className: "mdi mdi-chevron-double-right text-white"})),
h('li', {className: "list-inline-item text-white h2 font-secondary"}, entry.data.title)
)
)
)
),
h('section', {className: "section-sm"},
h('div', {className: "container"},
h('div', {className: "row"},
h('div', {className: "col-12 mb-4 content"},
widgetsFor('topics').map(function(i, index) {
return h('div', {"id": i.data.id, className: "modal"},
h('div', {className: "modal-dialog modal-lg", "role": "document"},
h('div', {className: "modal-content"},
h('div', {className: "modal-header"},
h('h5', {className: "modal-title"}, i.data.title),
h('button', {className: "close", type: "button", "dataDismiss": "modal", "ariaLabel": "Close"},
h('span', {"ariaHidden": "true"}, '\u{00d7}')
)
),
h('div', {className: "modal-body"},
h('div', {className: "content"}, i.content)
)
)
)
);
}),
entry.data.pretext != "" && entry.data.pretext != null ? h('div', {"id": "pretext", className: "modal"},
h('div', {className: "modal-dialog modal-lg", "role": "document"},
h('div', {className: "modal-content"},
h('div', {className: "modal-header"},
h('h5', {className: "modal-title"}, entry.data.title),
h('button', {className: "close", type: "button", "dataDismiss": "modal", "ariaLabel": "Close"},
h('span', {"ariaHidden": "true"}, '\u{00d7}')
)
),
h('div', {className: "modal-body"},
h('div', {className: "content"}, widgetFor('pretext'))
)
)
)
) : null,
h('div', {"id": "wc-canvas"}),
() => {
var topics = [[entry.data.title, 100, "pretext"]];
widgetsFor('topics').map(function(i, index) {
topics.push([i.data.title, 40, i.data.id]);
});
var script = document.createElement('script');
var div = document.getElementById('sc-root');
div.appendChild(script);
WordCloud(
document.getElementById('wc-canvas'),
{
click: function (item) {
if (item[1] != 100 || (item[1] == 100 && item[2] == "pretext")) {
$('#' + item[2]).modal('show');
}
},
color: function (word, weight) {
return (weight === 100) ? '#ffbc3b' : '#1a1a37';
},
fontFamily: 'Fira Sans, serif',
fontWeight: 800,
list: topics,
shrinkToFit: true,
gridSize: 25,
rotateRatio: 0,
}
);
},
widgetFor('body')
)
)
)
)
);
};
CMS.registerPreviewTemplate("schulchronik", ChronikPreview);
</script-->
<script>
var PostPreviewContent = ({widgetFor, entry}) => {
const divStyle = {
backgroundImage: 'url("/media/backgrounds/page-title.webp"),url("/media/backgrounds/page-title.webp")',
};
return h('div', {},
h('section', {className: "page-title-section overlay", style: divStyle},
h('div', {className: "container"},
h('div', {className: "col-md-8"},
h('ul', {className: "list-inline"},
h('li', {className: "list-inline-item h2"},
h('a', {className: "text-primary font-secondary", href: ""}, "Startseite")),
h('li', {className: "list-inline-item h2"},
h("i", {className: "mdi mdi-chevron-double-right text-white"})),
h('li', {className: "list-inline-item text-white h2 font-secondary"}, entry.data.title)
),
h('p', {className: "text-lighten"}, entry.data.description)))),
h('section', {className: "section-sm"},
h('div', {className: "container"},
h('div', {className: "row"},
h('div', {className: "col-12 mb-4"},
h('div', {className: "content"}, widgetFor('body')))))));
};
["abiturienten", "cantorfora", "chronikseiten"].forEach(page => {
CMS.registerPreviewTemplate(page, PostPreviewContent);
});
</script>
<script>
var PagePreview = ({widgetFor, entry}) => {
const divStyle = {
backgroundImage: 'url("/media/backgrounds/page-title.webp"),url("/media/backgrounds/page-title.webp")',
};
return h('div', {},
h('section', {className: "page-title-section overlay", style: divStyle},
h('div', {className: "row"},
h('div', {className: "container"},
h('div', {className: "col-md-8"},
h('ul', {className: "list-inline"},
h('li', {className: "list-inline-item h2"},
h('a', {className: "text-primary font-secondary", href: ""}, "Startseite")),
h('li', {className: "list-inline-item h2"},
h("i", {className: "mdi mdi-chevron-double-right text-white"})),
h('li', {className: "list-inline-item text-white h2 font-secondary"}, entry.data.title)),
h('p', {className: "text-lighten"}, entry.data.description))))));
};
["cantorpreis-index"].forEach(page => {
CMS.registerPreviewTemplate(page, PagePreview);
});
</script>
<script>
const NoDateCard = ({ entry, widgetFor, viewStyle }) => {
return h(
'div',
{ style: { width: '100%', height: '100%' } },
viewStyle === 'grid' ? widgetFor('image') : null,
h(
'div',
{ style: { padding: '16px', width: '100%' } },
h(
'div',
{
style: {
display: 'flex',
width: '100%',
justifyContent: 'space-between',
alignItems: 'start',
},
},
h(
'div',
{
style: {
display: 'flex',
flexDirection: viewStyle === 'grid' ? 'column' : 'row',
alignItems: 'baseline',
gap: '8px',
},
},
h('strong', { style: { fontSize: '20px' } }, entry.data.title),
),
h(
'div',
{
style: {
backgroundColor: entry.data.draft === true ? 'RoyalBlue' : 'green',
color: 'white',
border: 'none',
padding: '4px 8px',
textAlign: 'center',
textDecoration: 'none',
display: 'inline-block',
cursor: 'pointer',
borderRadius: '4px',
},
},
entry.data.draft === true ? 'Entwurf' : 'Öffentlich',
),
),
),
);
};
const SmallCard = ({ entry, widgetFor, viewStyle }) => {
return h(
'div',
{ style: { width: '100%', height: '100%' } },
h(
'div',
{ style: { padding: '16px', width: '100%' } },
h(
'div',
{
style: {
display: 'flex',
width: '100%',
justifyContent: 'space-between',
alignItems: 'start',
},
},
h(
'div',
{
style: {
display: 'flex',
flexDirection: viewStyle === 'grid' ? 'column' : 'row',
alignItems: 'baseline',
gap: '8px',
},
},
h('strong', { style: { fontSize: '20px' } }, entry.data.title),
),
h(
'div',
{
style: {
backgroundColor: entry.data.draft === true ? 'RoyalBlue' : 'green',
color: 'white',
border: 'none',
padding: '4px 8px',
textAlign: 'center',
textDecoration: 'none',
display: 'inline-block',
cursor: 'pointer',
borderRadius: '4px',
},
},
entry.data.draft === true ? 'Entwurf' : 'Öffentlich',
),
),
),
);
};
['schulchronik', 'chronikseiten', 'cantorpreis-index'].forEach(page => {
CMS.registerPreviewCard(page, SmallCard);
});
CMS.registerPreviewCard('abiturienten', NoDateCard);
CMS.registerPreviewCard('cantorfora', NoDateCard);
</script>
</body>
</html>