gcg-website/static/admin/config/collections/wettbewerbe.js

68 lines
1.5 KiB
JavaScript
Raw Permalink Normal View History

import { EditorProps, MarkdownProps, ImageProps } from "../props.js";
2023-05-29 16:22:34 +02:00
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",
2023-06-21 17:58:49 +02:00
folder: "content/wettbewerbe",
...EditorProps,
2023-05-29 16:22:34 +02:00
filter: {
field: "type",
value: "wettbewerbe",
},
summary_fields: ["title", "draft", "category"],
fields: [
Title(false),
DraftBoolean,
DescriptionText,
{
name: "image",
label: "Titelbild",
...ImageProps,
2023-05-29 16:22:34 +02:00
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",
required: true,
...MarkdownProps,
},
],
};
export default WettbewerbeCollection;