gcg-website/static/admin/config/collections/wettbewerbe.js
Denys Konovalov f0a4bac2bd
All checks were successful
website-main / prod-build (push) Successful in 11s
website-main / test-build (push) Successful in 5s
revert 65260f63c67562ea2821c31d37a0ac3caa755fd8
revert Static CMS v4 (#250)

Schließt #247

Reviewed-on: #250
2023-12-12 17:13:58 +01:00

74 lines
1.5 KiB
JavaScript

import { MarkdownProps } from "../props.js";
import { DescriptionText, DraftBoolean, Title } from "./widgets.js";
const WettbewerbeCollection = {
name: "wettbewerbe",
label: "Wettbewerbe",
label_singular: "Wettbewerb",
description: "Hier kann die Übersicht der Wettbewerbe bearbeitet werden.",
icon: "trophy",
folder: "content/wettbewerbe",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: {
field: "type",
value: "wettbewerbe",
},
summary_fields: ["title", "draft", "category"],
fields: [
Title(false),
DraftBoolean,
DescriptionText,
{
name: "image",
label: "Titelbild",
widget: "image",
required: true,
default: "/media/image.webp",
},
{
name: "category",
label: "Fach",
hint: "Verwaltet in den Einstellungen",
widget: "relation",
collection: "settings",
file: "data-categories",
value_field: "contests.*",
search_fields: ["contests.*"],
display_fields: ["contests.*"],
required: true,
},
{
name: "class",
label: "Klassenstufe(n)",
widget: "string",
required: true,
},
{
name: "web_url",
label: "Website",
widget: "string",
required: false,
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "wettbewerbe",
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: true,
...MarkdownProps,
},
],
};
export default WettbewerbeCollection;