gcg-website/static/admin/previews/page-previews/chronik-preview.js
Denys Konovalov 02c5040281
All checks were successful
website-main / prod-build (push) Successful in 15s
website-main / test-build (push) Successful in 4s
Kreative Haufen in CSS (#254)
Schließt #211

Reviewed-on: #254
2024-01-02 21:55:31 +01:00

80 lines
2.2 KiB
JavaScript

import { PageHeader } from "./components/index.js";
const ChronikPreview = ({ widgetFor, widgetsFor, entry, document, window }) => {
return [
PageHeader(entry),
h(
"section",
{ className: "section" },
h(
"div",
{ className: "container" },
h(
"div",
{ className: "card-group" },
h(
"div",
{ className: "card d-flex flex-row flex-wrap" },
h("img", {
src: "https://cantorgymnasium.de/media/people/gcg.webp",
className: "rounded-circle object-cover m-3",
width: "128px",
height: "128px",
}),
h(
"div",
{ className: "flex-grow card-body min-w-0" },
h("h3", { className: "card-title" }, "Cantorpreisträger"),
h(
"p",
{ className: "h4 card-text" },
widgetFor("cantorpreisträger")
)
)
),
h(
"div",
{ className: "card d-flex flex-row flex-wrap-reverse" },
h(
"div",
{ className: "flex-grow card-body min-w-0" },
h(
"h3",
{ className: "card-title" },
"Abiturienten " + entry.data.title
),
h("p", { className: "h4 card-text" }, "Abiturdurchschnitt: 0.00")
),
h("img", {
src: "https://cantorgymnasium.de/media/people/gcg.webp",
className: "rounded-circle object-cover m-3",
width: "128px",
height: "128px",
})
)
),
h(
"div",
{ className: "kh-parent" },
h(
"div",
{ className: "kh-jahr h1" },
h("span", {}, entry.data.title)
),
widgetsFor("topics")
.sort((a, b) => b.data.title.length - a.data.title.length)
.map((topic, index) =>
h(
"div",
{ className: "kh h3", "data-id": `${index}` },
h("span", {}, topic.data.title)
)
)
)
)
),
];
};
export default ChronikPreview;