Cleanup of old-data fixes; an editor for the Organization page
Nothing before these changes was ever public, so the fixes kept for older data go: the /leadership redirect (MOVED in routes/pages.js), index.html's move of "ngu-" browser keys to "site-", the boot-time sorting of images from before folders (media.js), and emoji path icons (a path with no named icon shows a dot; migration 055 turns the baseline's seeded emoji into their names). Pages → Organization page (migration 055): a singleton with the Mission, Vision & Values blocks, the Leadership blocks (a People block per team, in order) with a heading and blurb, and Volunteering (title, blurb, links). content_blocks gains the two owner kinds; GET /organization-page serves it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1da79c128b
commit
43797f38bc
14 changed files with 308 additions and 127 deletions
|
|
@ -5,9 +5,7 @@
|
|||
Connect Nav → Icon), as [key, label]. The admin's dropdown lists
|
||||
the labels; Pathfinder.tsx draws the Phosphor icon for each key.
|
||||
Adding one is a line here and one in ICONS in Pathfinder.tsx.
|
||||
|
||||
A path saved before this list existed may hold an emoji instead
|
||||
of a key; Pathfinder shows that as it is.
|
||||
A path with none set shows a dot.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
export const PATH_ICONS: [string, string][] = [
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import { timeline } from "./adminSchema/timeline.ts";
|
|||
import { frontPage } from "./adminSchema/frontPage.ts";
|
||||
import { blogPosts, communityPage } from "./adminSchema/blog.ts";
|
||||
import { siteSettings } from "./adminSchema/siteSettings.ts";
|
||||
import { organizationPage } from "./adminSchema/organizationPage.ts";
|
||||
|
||||
export const ADMIN_ENTITIES: Record<string, any> = {
|
||||
organizations,
|
||||
|
|
@ -38,6 +39,7 @@ export const ADMIN_ENTITIES: Record<string, any> = {
|
|||
front_page: frontPage,
|
||||
blog_posts: blogPosts,
|
||||
community_page: communityPage,
|
||||
organization_page: organizationPage,
|
||||
site_settings: siteSettings,
|
||||
};
|
||||
|
||||
|
|
|
|||
71
src/lib/adminSchema/organizationPage.ts
Normal file
71
src/lib/adminSchema/organizationPage.ts
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/* Pages → Organization page: the /organization page's own content.
|
||||
Server side: server/src/admin-schema/organizationPage.js. Each
|
||||
section's blocks are their own collection; the Leadership blocks
|
||||
are where the teams go, a People block each, in order. */
|
||||
|
||||
import { blocksChild } from "./shared.ts";
|
||||
|
||||
/* A block collection for one section: the shared block editor,
|
||||
without "Shown in" (these blocks only ever show on the page). */
|
||||
const sectionBlocks = (key: string, label: string, note: string) => ({
|
||||
...blocksChild,
|
||||
key,
|
||||
label,
|
||||
note,
|
||||
fields: blocksChild.fields.filter((field) => field.path !== "slot"),
|
||||
});
|
||||
|
||||
export const organizationPage = {
|
||||
key: "organization_page",
|
||||
label: "Organization page",
|
||||
singular: "organization page",
|
||||
idLabel: "Page",
|
||||
singleton: "organization",
|
||||
|
||||
list: { columns: [], filters: [] },
|
||||
|
||||
groups: [
|
||||
{
|
||||
legend: "Mission, Vision & Values",
|
||||
note: "The page's first section. Its content is the Mission blocks below.",
|
||||
fields: [{ path: "mission_title", label: "Heading", help: "Default: Mission, Vision & Values" }],
|
||||
},
|
||||
{
|
||||
legend: "Leadership",
|
||||
note: "The second section: the Leadership blocks below, then Volunteering.",
|
||||
fields: [
|
||||
{ path: "leadership_title", label: "Heading", help: "Default: Leadership" },
|
||||
{ path: "leadership_blurb", label: "Blurb", widget: "textarea", full: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
legend: "Volunteering",
|
||||
note: "Under the leadership: a title, a line or two and the links below.",
|
||||
fields: [
|
||||
{ path: "volunteer_title", label: "Title", help: "Default: Volunteering" },
|
||||
{ path: "volunteer_blurb", label: "Blurb", widget: "textarea", full: true },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
children: [
|
||||
sectionBlocks("mission_blocks", "Mission blocks", "The Mission, Vision & Values section: headings, paragraphs, lists, whatever it needs."),
|
||||
sectionBlocks(
|
||||
"leadership_blocks",
|
||||
"Leadership blocks",
|
||||
"The Leadership section, in order: eg. a People block for the Board of Trustees, then one for the Retreat Team.",
|
||||
),
|
||||
{
|
||||
key: "volunteer_links",
|
||||
label: "Volunteering links",
|
||||
note: "Buttons under the volunteering blurb.",
|
||||
addLabel: "Add link",
|
||||
title: (row) => row.label || row.url || "New link",
|
||||
blank: { label: "", url: "" },
|
||||
fields: [
|
||||
{ path: "label", label: "Label", required: true, help: "eg. Volunteer at a retreat" },
|
||||
{ path: "url", label: "Link", required: true, full: true, help: "A page on this site (eg. /request) or anywhere else" },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
@ -105,6 +105,11 @@ export const PAGES_NAV = {
|
|||
label: "Community blog section",
|
||||
blurb: "The Community page's blog: headings, pinned posts and feeds.",
|
||||
},
|
||||
{
|
||||
to: "/admin/organization_page",
|
||||
label: "Organization page",
|
||||
blurb: "Mission, vision and values, the leadership teams in order, and volunteering.",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
are cells of the same block.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
import { ArrowRight, ArrowUpRight, BookOpen, CalendarBlank, ChatCircle, Compass, GraduationCap, HandHeart, Heart, House, MapPin, MusicNotes, Sparkle, Star, Tent, UsersThree, type Icon } from '@phosphor-icons/react'
|
||||
import { ArrowRight, ArrowUpRight, BookOpen, Dot, CalendarBlank, ChatCircle, Compass, GraduationCap, HandHeart, Heart, House, MapPin, MusicNotes, Sparkle, Star, Tent, UsersThree, type Icon } from '@phosphor-icons/react'
|
||||
import { useId, useRef, useState, type CSSProperties, type KeyboardEvent } from 'react'
|
||||
|
||||
import HomeLink, { isExternal } from './HomeLink.tsx'
|
||||
|
|
@ -38,8 +38,7 @@ type PathfinderProps = {
|
|||
/* One accent per position, cycling. Paths are data; color is
|
||||
presentation, so it's assigned here rather than stored. */
|
||||
/* A path's icon: a key from src/data/pathIcons.ts, drawn from
|
||||
Phosphor. A path saved before the list existed may hold an emoji;
|
||||
that shows as it is. Nothing set is a dot. */
|
||||
Phosphor. Nothing set (or a key no longer on the list) is a dot. */
|
||||
const ICONS: Record<string, Icon> = {
|
||||
heart: Heart,
|
||||
hands: HandHeart,
|
||||
|
|
@ -60,7 +59,7 @@ const ICONS: Record<string, Icon> = {
|
|||
function PathIcon({ value }: { value?: string | null }) {
|
||||
const Glyph = value ? ICONS[value] : null
|
||||
if (Glyph) return <Glyph size={26} weight="bold" />
|
||||
return <>{value || '•'}</>
|
||||
return <Dot size={26} weight="bold" />
|
||||
}
|
||||
|
||||
// The site's accent family, in turn (color.ts).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue