feat(website): the admin, with drafts, preview, publish and restore

Admin API and screens: dashboard and setup checklist, template and
style, pages and blocks, ministries, leadership, media library with
the storage limit, publish and history. Pending changes with who and
when, discard one, one Publish, restore any version (each version
keeps the working copy's rows, never sent to visitors). Preview on
the site's own addresses with a bar (widths, back, publish); shared
preview links for 7 days or until revoked. Roles checked, same-origin
changes only. Publish refreshes the public pages at once
(WEBSITE_CONTENT_CACHE_SECONDS). E2E on a production build: the
admin's flows and axe on every screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 12:30:29 +02:00
co-authored by Claude Opus 5.5
parent 3caa1d1e1a
commit 84c5b0c08e
44 changed files with 2404 additions and 65 deletions
+15
View File
@@ -0,0 +1,15 @@
import { NextResponse, type NextRequest } from "next/server";
/**
* The address a page was asked for, for the layouts: the admin's, so signing in comes back to
* that exact page (ROADMAP-v3 §3, "Sign-in always returns you to where you came from"), and the
* root layout's, which shows the preview bar on the site's pages only.
*/
export function proxy(request: NextRequest) {
const headers = new Headers(request.headers);
headers.set("x-ccw-path", `${request.nextUrl.pathname}${request.nextUrl.search}`);
return NextResponse.next({ request: { headers } });
}
// Never Next's own paths (/_next: its files and the development connection).
export const config = { matcher: ["/((?!api|_next|favicon.ico).*)"] };