gcg-website/static/admin/config/collections/widgets.js
Denys Konovalov b66a27e3b9
All checks were successful
website-main / prod-build (push) Successful in 2m2s
website-main / test-build (push) Successful in 2m2s
website-main / auto-rebuild (push) Has been skipped
CMS refactor
2023-05-29 16:22:34 +02:00

89 lines
1.5 KiB
JavaScript

import { DataObject } from "../props.js";
const EnableBoolean = {
name: "enable",
label: "Aktivieren",
widget: "boolean",
required: false,
};
const DisableBoolean = {
name: "disable",
label: "Deaktivieren",
widget: "boolean",
required: false,
};
const DraftBoolean = {
name: "draft",
label: "Entwurf",
widget: "boolean",
default: false,
required: false,
};
const Title = (optional = false) => ({
name: "title",
label: "Titel",
widget: "string",
required: !optional,
});
const DescriptionText = {
name: "description",
label: "Beschreibung",
widget: "text",
required: false,
};
const IconList = {
name: "icon",
label: "Symbol",
widget: "string",
required: false,
hint: "Liste unter https://assets.cantorgymnasium.de/fonts/mdi/v7/preview.html",
};
const PreviewNumber = {
name: "number",
label: "Anzahl",
hint: "Anzahl der Elemente, die auf der Startseite angezeigt werden sollen.",
widget: "number",
value_type: "int",
min: 0,
step: 1,
required: true,
};
const ButtonObject = {
name: "button",
label: "Button",
...DataObject,
fields: [
EnableBoolean,
{
name: "label",
label: "Aufschrift",
widget: "string",
required: false,
},
{
name: "link",
label: "Link",
widget: "string",
required: false,
},
],
};
export {
EnableBoolean,
DisableBoolean,
DraftBoolean,
Title,
DescriptionText,
IconList,
PreviewNumber,
ButtonObject,
};