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:
Zaldimmar 2026-09-30 23:37:35 -05:00
parent 1da79c128b
commit 43797f38bc
14 changed files with 308 additions and 127 deletions

View file

@ -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,
};

View 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" },
],
},
],
};