schuelerzeitung/static/admin/collections.js

177 lines
3.3 KiB
JavaScript
Raw Normal View History

2023-05-29 19:03:29 +02:00
const PostCollection = {
2023-10-21 20:25:30 +02:00
name: "post",
2023-05-29 19:03:29 +02:00
label: "Artikel",
description: "Hier könnt ihr die Artikel der Schülerzeitung bearbeiten.",
icon: "news",
2023-10-21 20:25:30 +02:00
folder: "content/post",
2023-05-29 19:03:29 +02:00
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
filter: {
field: "type",
2023-10-21 20:25:30 +02:00
value: "post",
2023-05-29 19:03:29 +02:00
},
2023-10-21 20:25:30 +02:00
summary_fields: ["title", "date", "draft"],
2023-05-29 19:03:29 +02:00
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,
},
{
2023-10-21 20:25:30 +02:00
name: "image",
2023-05-29 19:03:29 +02:00
label: "Titelbild",
widget: "image",
2023-10-21 20:25:30 +02:00
required: false,
2023-05-29 19:03:29 +02:00
},
{
name: "tags",
label: "Tags",
widget: "list",
delimiter: ",",
required: false,
},
2023-10-21 20:25:30 +02:00
{
name: "categories",
label: "Kategorien",
widget: "list",
delimiter: ",",
required: false,
},
2023-05-29 19:03:29 +02:00
{
name: "type",
widget: "hidden",
default: "post",
2023-05-29 19:03:29 +02:00
},
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: true,
},
],
};
const PagesCollection = {
2023-10-21 20:25:30 +02:00
name: "page",
2023-05-29 19:03:29 +02:00
label: "Seiten",
description: "Hier könnt ihr die Zusatzseiten der Website bearbeiten.",
icon: "page",
2023-10-21 20:25:30 +02:00
folder: "content/page",
2023-05-29 19:03:29 +02:00
create: true,
editor: {
preview: true,
frame: true,
size: "half",
},
2023-12-12 19:10:52 +01:00
media_library: {
folder_support: true,
},
2023-05-29 19:03:29 +02:00
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,
},
{
2023-10-21 20:25:30 +02:00
name: "tags",
label: "Tags",
widget: "list",
delimiter: ",",
2023-05-29 19:03:29 +02:00
required: false,
},
{
2023-10-21 20:25:30 +02:00
name: "show-in-menu",
label: "Im Menü anzeigen",
widget: "boolean",
2023-05-29 19:03:29 +02:00
required: false,
},
2023-10-21 20:25:30 +02:00
{
name: "menu",
label: "Menü",
widget: "object",
condition: {
field: "show-in-menu",
value: true,
},
fields: [
{
name: "main",
label: "Hauptmenü",
widget: "object",
fields: [
{
name: "weight",
label: "Gewichtung",
widget: "string",
required: true,
},
{
name: "params",
label: "Parameter",
widget: "keyvalue",
required: false,
}
]
}
]
},
2023-05-29 19:03:29 +02:00
{
name: "body",
label: "Inhalt",
widget: "markdown",
required: true,
},
],
};
export { PostCollection, PagesCollection };