Voeg CMS voor de Publieke Website toe (overgenomen van rikx-org)
Pagina-editor, hoofdmenu, SEO en media onder Publieke Website → Pagina's (/website), los van het CMS in rikx-org: eigen tabellen in de beheerdatabase. Blokken (hero, tekstblok, testimonial, voordelenlijst, call-to-action) met Quill, NL/EN/DE met terugval op NL, en afbeeldingsupload naar MEDIA_DIR met een openbare /media-route (CSP-sandbox). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import Link from "next/link";
|
||||
import { notFound } from "next/navigation";
|
||||
import { requireAdmin } from "../../../lib/auth";
|
||||
import {
|
||||
getPage,
|
||||
listBlockTranslationsForEditor,
|
||||
listContentBlocks,
|
||||
listMediaImages,
|
||||
listPageTranslations,
|
||||
} from "../../../lib/cms";
|
||||
import { AppHeader } from "../../AppHeader";
|
||||
import { PageEditor } from "../PageEditor";
|
||||
|
||||
export default async function WebsitePageEditor({ params }: { params: Promise<{ slug: string }> }) {
|
||||
const session = await requireAdmin();
|
||||
const { slug } = await params;
|
||||
const page = getPage(slug);
|
||||
if (!page) notFound();
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-zinc-50 dark:bg-zinc-950">
|
||||
<AppHeader email={session.email} active="website" />
|
||||
|
||||
<main className="max-w-5xl mx-auto px-4 sm:px-6 py-10">
|
||||
<Link href="/website" className="text-sm text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-100">
|
||||
← Pagina's
|
||||
</Link>
|
||||
<h1 className="text-lg font-semibold text-zinc-900 dark:text-zinc-100 mt-2">
|
||||
{page.nav_label || page.meta_title || slug}
|
||||
</h1>
|
||||
<p className="text-sm text-zinc-500 mt-1 mb-6">/{slug}</p>
|
||||
|
||||
<PageEditor
|
||||
slug={slug}
|
||||
page={page}
|
||||
blocks={listContentBlocks(slug)}
|
||||
mediaImages={listMediaImages()}
|
||||
pageTranslations={listPageTranslations(slug)}
|
||||
blockTranslations={listBlockTranslationsForEditor(slug)}
|
||||
/>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user