CMS refactor
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

This commit is contained in:
2023-05-29 16:22:34 +02:00
parent 09a33fd70c
commit b66a27e3b9
110 changed files with 4668 additions and 3736 deletions

View File

@ -1,6 +1,6 @@
const BooleanPreview = ({ value }) =>
h("i", {
className: value ? "mdi mdi-check" : "mdi mdi-close",
});
h("i", {
className: value ? "mdi mdi-check" : "mdi mdi-close",
});
export default BooleanPreview;

View File

@ -1,9 +1,9 @@
function truncate(str, num) {
if (str.length > num) {
return str.slice(0, num) + "...";
} else {
return str;
}
if (str.length > num) {
return str.slice(0, num) + "...";
} else {
return str;
}
}
export default truncate;

View File

@ -1,13 +1,13 @@
const DatePreview = ({ value }) =>
h(
"p",
{},
new Intl.DateTimeFormat("de-DE", {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour12: false,
}).format(new Date(value))
);
h(
"p",
{},
new Intl.DateTimeFormat("de-DE", {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour12: false,
}).format(new Date(value))
);
export default DatePreview;

View File

@ -1,21 +1,21 @@
const DraftPreview = ({ value }) =>
h(
"div",
{
style: {
backgroundColor: value === true ? "rgb(37 99 235)" : "rgb(22 163 74)",
color: "white",
border: "none",
padding: "2px 6px",
textAlign: "center",
textDecoration: "none",
display: "inline-block",
cursor: "pointer",
borderRadius: "4px",
fontSize: "14px",
},
},
value ? "Entwurf" : "Veröffentlicht"
);
h(
"div",
{
style: {
backgroundColor: value === true ? "rgb(37 99 235)" : "rgb(22 163 74)",
color: "white",
border: "none",
padding: "2px 6px",
textAlign: "center",
textDecoration: "none",
display: "inline-block",
cursor: "pointer",
borderRadius: "4px",
fontSize: "14px",
},
},
value ? "Entwurf" : "Veröffentlicht"
);
export default DraftPreview;

View File

@ -4,10 +4,4 @@ import CountPreview from "./count-preview.js";
import BodyPreview from "./body-preview.js";
import DatePreview from "./date-preview.js";
export {
BooleanPreview,
DraftPreview,
CountPreview,
BodyPreview,
DatePreview,
};
export { BooleanPreview, DraftPreview, CountPreview, BodyPreview, DatePreview };