feat: redesign portal UI with Sakani UI and add release notes
Replace the hand-rolled Tailwind/shadcn look with Sakani UI across the editorial area, the admin area and all signed-out pages. - AppShell (Sakani Sidebar + TopBar) for /redaktion and /admin, with a mobile drawer, theme toggle, sign-out, legal links and a "Was ist neu" button; PublicShell for login, registration, password, 2FA and errors. - Shared primitives (Button, Card, Input, PageHeader) now render Sakani; components/ui/sakani.tsx is the client boundary for Server Components (Sakani ships no "use client") and adds FormSelect (native form value) and DataTable (element cells from the server). - Legacy CSS variables map onto Sakani tokens; globals.css shrinks from ~2200 to ~700 lines. Geist replaces Inter. recharts/lucide-react dropped (charts via Sakani BarChart). - Release notes popup per area, shown once per version (localStorage) and reopenable from the sidebar; native <dialog> for focus trapping. - Fixes found while testing: TOTP field reused the typed password in clear text, modal dialogs sat top-left, invisible unchecked checkboxes in dark mode. - Parallel run: compose.parallel.yaml, AUTO_RULE_SYNC_DISABLED switch and docs/operations.md §8 (start, rollback, cutover). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
453bece72c
commit
9e938e4d07
79 files changed
+2266
-4316
No files matched your search
@@ -3,7 +3,8 @@ import Link from "next/link";
|
||||
import { db } from "@/db/client";
|
||||
import { editorialAccounts, usages } from "@/db/schema";
|
||||
import { PageHeader } from "@/components/ui/page-header";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { IconChevronRight } from "@sakaniui/react/icons";
|
||||
import { Badge, Card, EmptyState } from "@/components/ui/sakani";
|
||||
|
||||
export default async function EditorialsPage() {
|
||||
const [editorials, openUsageTotals] = await Promise.all([
|
||||
@@ -40,7 +41,7 @@ export default async function EditorialsPage() {
|
||||
const archivedEditorials = editorials.filter((e) => e.archivedAt);
|
||||
|
||||
return (
|
||||
<div className="space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500 max-w-7xl">
|
||||
<section className="flex flex-col gap-6">
|
||||
<PageHeader
|
||||
kicker="Kontoverwaltung"
|
||||
title="Redaktionen"
|
||||
@@ -48,89 +49,84 @@ export default async function EditorialsPage() {
|
||||
/>
|
||||
|
||||
{activeEditorials.length === 0 ? (
|
||||
<p className="text-muted-foreground">Noch keine aktiven Redaktionen registriert.</p>
|
||||
<EmptyState title="Noch keine aktiven Redaktionen registriert." description="Neue Registrierungen erscheinen hier zur Freigabe." />
|
||||
) : (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{activeEditorials.map((editorial) => (
|
||||
<Link key={editorial.id} href={`/admin/redaktionen/${editorial.id}`} className="block group">
|
||||
<Card className="h-full transition-all duration-300 hover:shadow-md hover:border-primary-500/50 hover:-translate-y-1">
|
||||
<CardContent className="p-6 flex flex-col h-full justify-between">
|
||||
<div>
|
||||
<h3 className="text-xl font-semibold mb-2 group-hover:text-primary-600 dark:group-hover:text-primary-400 transition-colors">
|
||||
{editorial.name}
|
||||
</h3>
|
||||
<div className="space-y-1 text-sm text-muted-foreground">
|
||||
<p className="flex items-center gap-2">
|
||||
<span className="font-medium text-foreground">Kontakt:</span> {editorial.contactName}
|
||||
</p>
|
||||
<p className="flex items-center gap-2">
|
||||
<span className="font-medium text-foreground">E-Mail:</span> {editorial.loginEmail}
|
||||
</p>
|
||||
<p className="flex items-center gap-2">
|
||||
<span className="font-medium text-foreground">Status:</span>
|
||||
<span className={`px-2 py-0.5 rounded-full text-xs font-medium ${
|
||||
editorial.status === "active" ? "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400" :
|
||||
editorial.status === "pending_approval" ? "bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400" :
|
||||
"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400"
|
||||
}`}>
|
||||
{editorial.status === "active" ? "Aktiv" : editorial.status === "pending_approval" ? "Ausstehend" : "Gesperrt"}
|
||||
</span>
|
||||
</p>
|
||||
<ul className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||
{activeEditorials.map((editorial) => {
|
||||
const openCents = openCentsByEditorial.get(editorial.id) ?? 0;
|
||||
return (
|
||||
<li key={editorial.id}>
|
||||
<Link href={`/admin/redaktionen/${editorial.id}`} className={CARD_LINK}>
|
||||
<Card interactive className="h-full">
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<h2 className="text-base font-semibold text-[var(--color-fg-default)]">{editorial.name}</h2>
|
||||
<Badge variant={STATUS[editorial.status]?.variant ?? "danger"}>
|
||||
{STATUS[editorial.status]?.label ?? "Gesperrt"}
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-6 pt-4 border-t border-border">
|
||||
<p className="text-sm font-medium">
|
||||
<dl className="grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-sm">
|
||||
<dt className="text-[var(--color-fg-muted)]">Kontakt</dt>
|
||||
<dd className="truncate">{editorial.contactName}</dd>
|
||||
<dt className="text-[var(--color-fg-muted)]">E-Mail</dt>
|
||||
<dd className="truncate">{editorial.loginEmail}</dd>
|
||||
</dl>
|
||||
<p className="mt-auto border-t border-[var(--color-border-subtle)] pt-3 text-sm font-medium">
|
||||
{editorial.currentPriceCents === null
|
||||
? "Preis noch nicht festgelegt"
|
||||
: `Netto ${formatCents(editorial.currentPriceCents)}`}
|
||||
<span
|
||||
className={`ml-2 ${(openCentsByEditorial.get(editorial.id) ?? 0) > 0 ? "text-amber-600 dark:text-amber-400" : "text-muted-foreground"}`}
|
||||
className={`ml-2 ${openCents > 0 ? "text-[var(--color-warning-fg)]" : "text-[var(--color-fg-muted)]"}`}
|
||||
title="Summe der noch nicht abgerechneten Bildnutzungen"
|
||||
>
|
||||
· Offen {formatCents(openCentsByEditorial.get(editorial.id) ?? 0)}
|
||||
· Offen {formatCents(openCents)}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{archivedEditorials.length > 0 && (
|
||||
<details className="mt-12 group">
|
||||
<summary className="cursor-pointer flex items-center gap-2 text-sm font-semibold uppercase tracking-widest text-muted-foreground hover:text-foreground transition-colors mb-6 list-none">
|
||||
<span className="bg-muted p-1 rounded-sm group-open:rotate-90 transition-transform">
|
||||
▶
|
||||
</span>
|
||||
<details className="group mt-6">
|
||||
<summary className="mb-4 flex cursor-pointer list-none items-center gap-2 text-sm font-medium text-[var(--color-fg-muted)] hover:text-[var(--color-fg-default)]">
|
||||
<IconChevronRight size={16} aria-hidden="true" className="transition-transform group-open:rotate-90" />
|
||||
Archivierte Redaktionen ({archivedEditorials.length})
|
||||
</summary>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 opacity-75 grayscale hover:grayscale-0 transition-all duration-500">
|
||||
<ul className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||
{archivedEditorials.map((editorial) => (
|
||||
<Link key={editorial.id} href={`/admin/redaktionen/${editorial.id}`} className="block group">
|
||||
<Card className="h-full transition-all duration-300 hover:shadow-sm">
|
||||
<CardContent className="p-6">
|
||||
<h3 className="text-lg font-semibold mb-2 text-muted-foreground group-hover:text-foreground transition-colors">
|
||||
{editorial.name}
|
||||
</h3>
|
||||
<div className="space-y-1 text-sm text-muted-foreground">
|
||||
<p>{editorial.contactName} · {editorial.loginEmail}</p>
|
||||
<p className="pt-2">
|
||||
Archiviert am: {editorial.archivedAt ? new Date(editorial.archivedAt).toLocaleDateString("de-DE") : ""}
|
||||
</p>
|
||||
<li key={editorial.id}>
|
||||
<Link href={`/admin/redaktionen/${editorial.id}`} className={CARD_LINK}>
|
||||
<Card interactive className="h-full opacity-80">
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<h2 className="text-base font-semibold text-[var(--color-fg-muted)]">{editorial.name}</h2>
|
||||
<Badge>Archiviert</Badge>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Link>
|
||||
<p className="text-sm text-[var(--color-fg-muted)]">{editorial.contactName} · {editorial.loginEmail}</p>
|
||||
<p className="text-sm text-[var(--color-fg-muted)]">
|
||||
Archiviert am: {editorial.archivedAt ? new Date(editorial.archivedAt).toLocaleDateString("de-DE") : ""}
|
||||
</p>
|
||||
</Card>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</div>
|
||||
</ul>
|
||||
</details>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
const CARD_LINK =
|
||||
"block h-full rounded-[var(--radius-xl)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-border-focus)]";
|
||||
|
||||
const STATUS: Record<string, { label: string; variant: "success" | "warning" | "danger" }> = {
|
||||
active: { label: "Aktiv", variant: "success" },
|
||||
pending_approval: { label: "Ausstehend", variant: "warning" },
|
||||
};
|
||||
|
||||
function formatCents(cents: number): string {
|
||||
return new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR" }).format(cents / 100);
|
||||
}
|
||||
Reference in new issue
Block a user