Accounts 1.8.0, Website 1.1.0: admins redesigned as Cross Events' dashboard and settings
- Website: an icon sidebar in groups (Your site, Content, Go live, Team), a dashboard with cards and a tile per part of the admin, steps to the first publish across the top of every admin page, and a live preview beside the page editor and Template and style (computer or phone width, folds away, reloads on save). A framed request (Sec-Fetch-Dest: iframe) with an admin session reads the drafts, so no preview cookie is set. /preview/start takes ?to=. The page editor has Content and Page details tabs. - Accounts: /admin is an overview (cards, "Needs you", a tile per section); People moved to /admin/people; the sidebar shows the part you're in, grouped, with a count on Deletion requests; People redesigned, with a confirm before Deactivate; Email and WhatsApp split into two cards. - Both: darker grey labels for contrast; lucide-react in the Website. - e2e: the live preview shows drafts while the site stays live; axe on the page editor. - docs: VERSIONS, changelogs, WHATS-NEW. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/** The admin's sections, in groups (the sidebar) with a line each (the dashboard's tiles). */
|
||||
import {
|
||||
Building2, CalendarDays, FileText, HandHeart, Image as ImageIcon, LayoutDashboard, Link2, Mic, Palette, ScrollText,
|
||||
Send, Settings, UserCog, Users, type LucideIcon,
|
||||
} from "lucide-react";
|
||||
|
||||
export type NavItem = { href: string; label: string; description: string; icon: LucideIcon; managers?: boolean };
|
||||
|
||||
export const NAV_GROUPS: { title: string | null; items: NavItem[] }[] = [
|
||||
{ title: null, items: [{ href: "/admin", label: "Dashboard", description: "Where your site stands, and what to do next", icon: LayoutDashboard }] },
|
||||
{
|
||||
title: "Your site",
|
||||
items: [
|
||||
{ href: "/admin/template", label: "Template and style", description: "The look: template, home page layout, colours of sections", icon: Palette },
|
||||
{ href: "/admin/pages", label: "Pages", description: "Your home page, the fixed pages and your own", icon: FileText },
|
||||
{ href: "/admin/church", label: "Church details", description: "Name, logo, service times and address, for all your sites", icon: Building2 },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Content",
|
||||
items: [
|
||||
{ href: "/admin/ministries", label: "Ministries", description: "What happens in your church, each on the Ministries page", icon: HandHeart },
|
||||
{ href: "/admin/leaders", label: "Leadership", description: "Your pastors and team, with photos", icon: Users },
|
||||
{ href: "/admin/messages", label: "Messages", description: "Sermons, from YouTube or Spotify", icon: Mic },
|
||||
{ href: "/admin/events", label: "Events", description: "What's coming up, or your Cross Events calendar", icon: CalendarDays },
|
||||
{ href: "/admin/media", label: "Media library", description: "Your photos, what each shows, and storage", icon: ImageIcon },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Go live",
|
||||
items: [
|
||||
{ href: "/admin/publish", label: "Publish and history", description: "What's changed, publish it, share a preview, go back", icon: Send },
|
||||
{ href: "/admin/linked", label: "Linked products", description: "Cross Events and your church's other sites", icon: Link2 },
|
||||
{ href: "/admin/settings", label: "Settings", description: "Search engines, the menu order, the Coming soon line", icon: Settings },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Team",
|
||||
items: [
|
||||
{ href: "/admin/people", label: "People", description: "Who can edit the site, and what they can do", icon: UserCog, managers: true },
|
||||
{ href: "/admin/audit", label: "Audit log", description: "Who changed what, and when", icon: ScrollText, managers: true },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export const NAV: NavItem[] = NAV_GROUPS.flatMap((g) => g.items);
|
||||
|
||||
/** The section an address is in: the longest match, so /admin/pages/… is Pages. */
|
||||
export const sectionFor = (path: string): NavItem | undefined =>
|
||||
NAV.filter((n) => (n.href === "/admin" ? path === "/admin" : path === n.href || path.startsWith(`${n.href}/`))).sort((a, b) => b.href.length - a.href.length)[0];
|
||||
Reference in New Issue
Block a user