schuelerzeitung/static/admin/collections.js
Denys Konovalov 16affbc484
All checks were successful
schuelerzeitung-prod / prod-build (push) Successful in 6s
schuelerzeitung-prod / test-build (push) Successful in 1s
static/admin/collections.js aktualisiert
2024-01-13 11:45:15 +01:00

187 lines
3.6 KiB
JavaScript

const PostCollection = {
name: "post",
label: "Artikel",
description: "Hier könnt ihr die Artikel der Schülerzeitung bearbeiten.",
icon: "news",
folder: "content/post",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: {
field: "type",
value: "post",
},
summary_fields: ["title", "date", "draft"],
fields: [
{
name: "title",
label: "Titel",
widget: "string",
required: true,
},
{
name: "draft",
label: "Entwurf",
widget: "boolean",
required: false,
},
{
name: "date",
label: "Datum",
widget: "datetime",
date_format: "dd.MM.yyyy",
time_format: false,
format: "yyyy-MM-dd",
required: true,
},
{
name: "description",
label: "Beschreibung",
widget: "text",
required: false,
},
{
name: "image",
label: "Titelbild",
widget: "image",
required: false,
},
{
name: "tags",
label: "Tags",
widget: "list",
delimiter: ",",
required: false,
},
{
name: "categories",
label: "Kategorien",
widget: "list",
delimiter: ",",
required: false,
},
{
name: "type",
widget: "hidden",
default: "post",
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: true,
},
],
};
const PagesCollection = {
name: "page",
label: "Seiten",
description: "Hier könnt ihr die Zusatzseiten der Website bearbeiten.",
icon: "page",
folder: "content/page",
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
media_library: {
folder_support: true,
},
summary_fields: ["title", "date", "draft", "description"],
fields: [
{
name: "title",
label: "Titel",
widget: "string",
required: true,
},
{
name: "draft",
label: "Entwurf",
widget: "boolean",
required: false,
},
{
name: "date",
label: "Datum",
widget: "datetime",
date_format: "dd.MM.yyyy",
time_format: false,
format: "yyyy-MM-dd",
required: true,
},
{
name: "description",
label: "Beschreibung",
widget: "text",
required: false,
},
{
name: "tags",
label: "Tags",
widget: "list",
delimiter: ",",
required: false,
},
{
name: "show-in-menu",
label: "Im Menü anzeigen",
widget: "boolean",
required: false,
},
{
name: "menu",
label: "Menü",
widget: "object",
condition: {
field: "show-in-menu",
value: true,
},
required: false,
fields: [
{
name: "main",
label: "Hauptmenü",
widget: "object",
required: false,
fields: [
{
name: "weight",
label: "Gewichtung",
widget: "string",
required: false,
},
{
name: "params",
label: "Parameter",
widget: "object",
required: false,
fields: [
{
name: "icon",
label: "Symbol",
widget: "string",
required: false,
}
]
}
]
}
]
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: true,
},
],
};
export { PostCollection, PagesCollection };