gcg-website/static/admin/config/collections/author.js
Denys Konovalov 25af663be4
All checks were successful
website-main / prod-build (push) Successful in 13s
website-main / test-build (push) Successful in 5s
Static CMS v4 (#252)
Reviewed-on: #252
2023-12-13 12:42:59 +01:00

111 lines
2.3 KiB
JavaScript

import { EditorProps, MarkdownProps, PatternEmail, ImageProps } from "../props.js";
import { DescriptionText } from "./widgets.js";
const AuthorCollection = {
name: "author",
label: "Autoren",
label_singular: "Autor",
description:
"Autoren können einem Blogartikel zugewiesen werden. Wir unterscheiden in aktive und inaktive sowie vereinfachte Autoren, welche nur mit dem Namen angezeigt werden, und erweiterte Autoren, für die eine Übersichtsseite angelegt wird.",
icon: "user",
folder: "content/author",
...EditorProps,
filter: {
field: "type",
value: "author",
},
view_filters: {
filters: [
{
name: "active",
label: "aktiv",
field: "active",
pattern: true,
},
{
name: "inactive",
label: "inaktiv",
field: "active",
pattern: false,
},
{
name: "simplified",
label: "einfach",
field: "simplified",
pattern: true,
},
{
name: "extended",
label: "erweitert",
field: "simplified",
pattern: false,
},
],
},
view_groups: {
default: "active",
groups: [
{
name: "simplified",
label: "vereinfacht",
field: "simplified",
},
{
name: "active",
label: "aktiv",
field: "active",
},
],
},
summary_fields: ["title", "active", "simplified", "body"],
fields: [
{
name: "title",
label: "Name",
widget: "string",
required: true,
},
DescriptionText,
{
name: "email",
label: "E-Mail-Adresse",
widget: "string",
required: false,
...PatternEmail,
},
{
name: "image",
label: "Bild",
default: "/media/people/gcg.webp",
...ImageProps,
},
{
name: "simplified",
label: "vereinfacht",
widget: "boolean",
required: false,
},
{
name: "active",
label: "aktiv",
widget: "boolean",
required: false,
default: true,
},
{
name: "type",
label: "Typ",
widget: "hidden",
default: "author",
},
{
name: "body",
label: "Beschreibung",
required: false,
...MarkdownProps,
},
],
};
export default AuthorCollection;