Compare commits

..

No commits in common. "bc88b45ee15d72788dab83f27080cad5cc71eb54" and "6f86a113e0f5fb0f889db7ae7fe4a4661ee1ef08" have entirely different histories.

31 changed files with 304 additions and 855 deletions

View file

@ -268,7 +268,7 @@ The numbers band's "Number Source" dropdown works the same way:
| What | File | Notes |
| --- | --- | --- |
| Header and footer navigation, page subnav links | `src/navConfig.ts` | `PAGE_LINKS`, `PAGE_SECTIONS`, `NAV_ACTIONS`. A new page also needs a route in `src/App.tsx`. |
| Section titles, blurbs and colors on Retreats, Community, Organization, Resources, Feedback, Privacy, Terms | the page file in `src/pages/` | the `SECTIONS` array at the top. A section's `id` must match its subnav `hash`. |
| Section titles, blurbs and colors on Retreats, Community, Leadership, Resources, Feedback, Privacy, Terms | the page file in `src/pages/` | the `SECTIONS` array at the top. A section's `id` must match its subnav `hash`. |
| Site-wide announcement banner | `src/data/bannerConfig.ts` | `enabled: false` hides it. Bump `id` when the message changes, so people who dismissed the old one see the new one. |
| History page decade headers | `src/data/historyDecades.ts` | Title, tagline and blurb per decade. |
| Group map tiles and area names | `src/data/mapGrid.ts` | `AREAS` (tile positions) and `AREA_NAMES`. Which region paints which tile is in the database (Admin → Data → Organizations → a region → Map areas). |

View file

@ -150,7 +150,6 @@ export const blocksChild = (ownerKind) => ({
"schedule",
"table",
"cards",
"people",
],
{ required: true },
),
@ -159,8 +158,6 @@ export const blocksChild = (ownerKind) => ({
url("href"),
text("alt"),
text("cite"),
// People blocks only (054): whose team's tiles to show.
text("team_id"),
],
children: [
{
@ -203,6 +200,5 @@ export const hostsChild = {
table: "event_hosts",
owner: { column: "event_id" },
order: "sort_order",
// team_id (054): an organization host's team, shown in its place.
columns: [text("org_id"), text("person_id"), text("team_id")],
columns: [text("org_id"), text("person_id")],
};

View file

@ -1,140 +0,0 @@
-- ═══════════════════════════════════════════════════════════════
-- 054 PEOPLE BLOCKS, HOST TEAMS, THE ORGANIZATION PAGE
--
-- A content block of type 'people': a team's people tiles, people
-- picked one by one (items, each with a title), or both. The team
-- is a new column, content_blocks.team_id; a picked person rides on
-- the item's person_id, as a schedule entry's does. ContentBlocks.tsx
-- draws it with PeopleTiles. The type CHECK changes, so the table is
-- rebuilt as 045 did (legacy_alter_table around the rename, then its
-- index and owner trigger again).
--
-- An event's organization host can name a team to show instead:
-- event_hosts.team_id, any organization's team. The event page then
-- reads "Hosted by <team>" linked to the team's page. v_event_hosts
-- carries it (and v_events, which reads v_event_hosts, is made again
-- around it, unchanged).
--
-- The Leadership page is now the Organization page, at /organization:
-- a page title or intro saved for /leadership in Site settings moves
-- with it.
-- ═══════════════════════════════════════════════════════════════
-- ── Host teams ─────────────────────────────────────────────────
ALTER TABLE event_hosts ADD COLUMN team_id TEXT REFERENCES teams (id) ON DELETE SET NULL;
DROP VIEW v_events;
DROP VIEW v_event_hosts;
CREATE VIEW v_event_hosts AS
SELECT
eh.id,
eh.event_id,
eh.sort_order,
CASE WHEN eh.person_id IS NULL THEN 'organization' ELSE 'person' END
AS host_kind,
COALESCE(eh.org_id, eh.person_id) AS host_id,
COALESCE(o.name, p.display_name) AS host_name,
o.kind AS host_org_kind,
o.logo AS host_logo,
o.color AS host_color,
p.photo AS host_photo,
COALESCE(o.is_published, p.is_published) AS host_is_published,
t.id AS host_team_id,
t.name AS host_team_name
FROM event_hosts eh
LEFT JOIN organizations o ON o.id = eh.org_id
LEFT JOIN people p ON p.id = eh.person_id
LEFT JOIN teams t ON t.id = eh.team_id AND eh.org_id IS NOT NULL AND t.is_published = 1;
CREATE VIEW v_events AS
SELECT
e.*,
h.host_kind,
h.host_id,
h.host_name,
h.host_org_kind,
COALESCE(e.org_logo, h.host_logo) AS effective_org_logo,
COALESCE(e.color, h.host_color) AS effective_color,
COALESCE(
e.status,
CASE WHEN e.ends_on IS NOT NULL AND e.ends_on < date('now')
THEN 'past' ELSE 'upcoming' END
) AS effective_status
FROM events e
LEFT JOIN v_event_hosts h
ON h.id = (
SELECT x.id
FROM v_event_hosts x
WHERE x.event_id = e.id
ORDER BY x.sort_order, x.id
LIMIT 1
);
-- ── People blocks ──────────────────────────────────────────────
CREATE TABLE content_blocks_new (
id INTEGER PRIMARY KEY AUTOINCREMENT,
owner_kind TEXT NOT NULL
CHECK (owner_kind IN ('organization', 'event', 'person', 'team', 'blog_post')),
owner_id TEXT NOT NULL,
slot TEXT NOT NULL DEFAULT 'body' CHECK (slot IN ('card', 'body')),
sort_order INTEGER NOT NULL DEFAULT 0,
type TEXT NOT NULL
CHECK (type IN ('heading', 'subheading', 'paragraph',
'list', 'links', 'quote', 'image', 'divider',
'video', 'button', 'callout', 'schedule', 'table', 'cards',
'people')),
text TEXT,
media TEXT,
href TEXT,
alt TEXT,
cite TEXT,
team_id TEXT REFERENCES teams (id) ON DELETE SET NULL
) STRICT;
INSERT INTO content_blocks_new
(id, owner_kind, owner_id, slot, sort_order, type, text, media, href, alt, cite)
SELECT id, owner_kind, owner_id, slot, sort_order, type, text, media, href, alt, cite
FROM content_blocks;
PRAGMA legacy_alter_table = ON;
DROP TABLE content_blocks;
ALTER TABLE content_blocks_new RENAME TO content_blocks;
PRAGMA legacy_alter_table = OFF;
CREATE INDEX content_blocks_owner_idx
ON content_blocks (owner_kind, owner_id, slot, sort_order);
-- ── The Organization page ──────────────────────────────────────
UPDATE site_setting_pages SET path = '/organization' WHERE path = '/leadership';
-- ── Triggers last (see CLAUDE.md, Migrations) ──
CREATE TRIGGER content_blocks_owner_exists
BEFORE INSERT ON content_blocks
BEGIN
SELECT CASE
WHEN new.owner_kind = 'event'
AND NOT EXISTS (SELECT 1 FROM events WHERE id = new.owner_id)
THEN RAISE(ABORT, 'content_blocks: no such event')
WHEN new.owner_kind = 'organization'
AND NOT EXISTS (SELECT 1 FROM organizations WHERE id = new.owner_id)
THEN RAISE(ABORT, 'content_blocks: no such organization')
WHEN new.owner_kind = 'person'
AND NOT EXISTS (SELECT 1 FROM people WHERE id = new.owner_id)
THEN RAISE(ABORT, 'content_blocks: no such person')
WHEN new.owner_kind = 'team'
AND NOT EXISTS (SELECT 1 FROM teams WHERE id = new.owner_id)
THEN RAISE(ABORT, 'content_blocks: no such team')
WHEN new.owner_kind = 'blog_post'
AND NOT EXISTS (SELECT 1 FROM blog_posts WHERE id = new.owner_id)
THEN RAISE(ABORT, 'content_blocks: no such blog post')
END;
END;

View file

@ -88,8 +88,7 @@ function loadHosts(db, ids) {
const rows = db
.prepare(
`SELECT event_id, host_kind, host_id, host_name, host_org_kind,
host_team_id, host_team_name
`SELECT event_id, host_kind, host_id, host_name, host_org_kind
FROM v_event_hosts
WHERE event_id IN (${marks(ids.length)})
AND host_is_published = 1
@ -116,9 +115,6 @@ function shapeHost(row) {
// Which of /regions, /groups, /partners the slug belongs to.
// Null for a person, whose route needs no disambiguating.
org_kind: row.host_org_kind,
// The team an organization host is shown as, when one is set
// (and published): the event page names and links it instead.
team: row.host_team_id ? { id: row.host_team_id, name: row.host_team_name } : null,
};
}

View file

@ -21,9 +21,6 @@
the app's own not-found page with a 404 status, so search engines
drop it.
A page that moved answers with a 301 to where it is now (MOVED),
so old links, QR codes and search results keep working.
If the metadata can't be built (no site.json at SITE_CONFIG, say),
the page is still served, as built, and the cause is logged once:
a preview is never worth a page that won't load.
@ -92,23 +89,12 @@ pages.get("/sitemap.xml", (c) => {
});
});
/* Pages that have moved: old path → new, query string kept. */
const MOVED = {
"/leadership": "/organization",
};
pages.get("*", (c, next) => {
const pathname = c.req.path;
// The API's own paths, and an upload that isn't there, stay plain
// 404s rather than becoming a page.
if (/^\/(api|uploads)(\/|$)/.test(pathname)) return next();
const moved = MOVED[pathname.replace(/(.)\/+$/, "$1")];
if (moved) {
const query = new URL(c.req.url).search;
return c.redirect(moved + query, 301);
}
let html;
try {
html = indexHtml();

View file

@ -144,10 +144,6 @@ const ALL_BLOCKS = [
{ text: "A card with a picture", detail: "Its description, up to three lines, under the title. The whole card is the link.", url: "/retreats", media: IMAGE },
{ text: "An outside link, text only", detail: "The card shows the site it goes to above the title.", url: "https://example.org" },
]],
["subheading", { text: "People" }],
["people", { team_id: TEAM }, [
{ person_id: PERSON, text: "Picked as an item, with a title" },
]],
];
/* A record page's body: a handful of types, so it reads like a
@ -430,8 +426,7 @@ tx(db, () => {
is_published: 1,
is_listed: LISTED,
});
// Hosted by the region, shown as its team (054).
insert("event_hosts", { event_id: PAST, org_id: REGION, team_id: TEAM, sort_order: 0 });
insert("event_hosts", { event_id: PAST, org_id: REGION, sort_order: 0 });
insert("event_people", { event_id: PAST, person_id: PERSON, role: "host", is_public: 1, sort_order: 0 });
blocks("event", PAST, "card", cardText("past event"));

View file

@ -66,7 +66,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
const blockRows = db
.prepare(
`SELECT id, owner_id, type, text, media, href, alt, cite, team_id
`SELECT id, owner_id, type, text, media, href, alt, cite
FROM content_blocks
WHERE owner_kind = ? AND slot = ? AND owner_id IN (${placeholders(ids.length)})
ORDER BY owner_id, sort_order`,
@ -85,7 +85,6 @@ export function loadBlocks(db, ownerKind, ids, slot = "body") {
href: row.href,
alt: row.alt,
cite: row.cite,
team_id: row.team_id,
items: [],
};
byId.set(row.id, block);

View file

@ -22,9 +22,9 @@
"title": "Community",
"description": "Groups, regions and the people who make up Next Generation of Unity."
},
"/organization": {
"title": "Organization",
"description": "Our mission, vision and values, the people who lead Next Generation of Unity, and how to reach us."
"/leadership": {
"title": "Leadership",
"description": "The board, staff, and volunteers who keep Next Generation of Unity running."
},
"/resources": {
"title": "Resources",

View file

@ -51,7 +51,7 @@ const lazyPage = (load) =>
)
const Retreats = lazyPage(() => import("./pages/Retreats.tsx"))
const Community = lazyPage(() => import("./pages/Community.tsx"))
const Organization = lazyPage(() => import("./pages/Organization.tsx"))
const Leadership = lazyPage(() => import("./pages/Leadership.tsx"))
const Resources = lazyPage(() => import("./pages/Resources.tsx"))
const History = lazyPage(() => import("./pages/History.tsx"))
const Feedback = lazyPage(() => import("./pages/Feedback.tsx"))
@ -101,7 +101,7 @@ export default function App() {
<Route path="/awards/:id" element={<AwardDetail />} />
<Route path="/people/:id" element={<PersonDetail />} />
<Route path="/blog/:id" element={<BlogPost />} />
<Route path="organization" element={<Organization />} />
<Route path="leadership" element={<Leadership />} />
<Route path="resources" element={<Resources />} />
<Route path="history" element={<History />} />
<Route path="feedback" element={<Feedback />} />

View file

@ -7,9 +7,7 @@
some.
═══════════════════════════════════════════════════════════════ */
import { ORGANIZATION_DETAILS } from '../data/organizationDetails.ts'
const CONTACT = ORGANIZATION_DETAILS.email
const CONTACT = 'info@nextgenerationofunity.org'
export default function ComingSoon({ what }: { what: string }) {
return (

View file

@ -27,9 +27,6 @@
cards items as link cards, up to three in a row:
text the title, detail, url, media the
picture
people team_id's members as people tiles, then
items as more tiles: person, text their
title (an unpublished person is left out)
divider nothing
"Formatted" is InlineText.tsx: **bold**, *italic*, [text](url),
@ -41,7 +38,6 @@
═══════════════════════════════════════════════════════════════ */
import { mediaUrl } from '../lib/media.ts'
import PeopleTiles from './PeopleTiles.tsx'
import type { ContentBlock, ContentBlockItem } from '../lib/useContent.ts'
import { Anchor, Inline, Paragraphs, isExternalUrl } from './InlineText.tsx'
import VideoPlayer from './VideoPlayer.tsx'
@ -330,19 +326,6 @@ function Block({ block, accent, anchor }: { block: ContentBlock; accent: string;
if (!block.items?.length) return null
return <ScheduleBlock items={block.items} intro={block.text} accent={accent} />
case 'people': {
const picked = (block.items ?? [])
.filter((item) => item.person)
.map((item) => ({ peopleslug: item.person!.id, title: item.text || null }))
if (!block.team_id && picked.length === 0) return null
return (
<div className="space-y-6">
{block.team_id && <PeopleTiles size="lg" teams={block.team_id} accent={accent} />}
{picked.length > 0 && <PeopleTiles size="lg" people={picked} accent={accent} />}
</div>
)
}
case 'divider':
return <hr className="border-0 h-px" style={{ background: accent, opacity: 0.3 }} />

View file

@ -2,7 +2,6 @@ import { Link } from "react-router-dom";
import { PAGE_LINKS, PAGE_SECTIONS, NAV_ACTIONS } from "../navConfig.ts";
import siteLogo from "../assets/logos/NGU_Logo.svg";
import PlatformIcon from "./PlatformIcon.tsx";
import { ORGANIZATION_DETAILS as Organization_Details } from "../data/organizationDetails.ts";
const Social_Links = [
{ label: "Instagram", href: "https://www.instagram.com/nextgenerationunity/", platform: "instagram" },
@ -23,9 +22,19 @@ type TouchLink = { label: string } & (
const Get_In_Touch: TouchLink[] = [
{ label: "Feedback", to: "/feedback"},
{ label: "Request", to: "/request" },
{ label: "Contact Us", to: "/organization#contact" },
{ label: "Contact Us", to: "/leadership#contact" },
];
/* Under the logo. The street address is where NGU is, not where
to send post, and says so. */
const Organization_Details = {
street: "1901 NW Blue Parkway",
cityLine: "Unity Village, MO 64065",
addressNote: "Physical address, not for mail",
nonprofit: "Next Generation of Unity is a qualified 501(c)(3) nonprofit organization.",
taxId: "33-2819320",
};
const Footer_Links = [
{ label: "Privacy Policy", to: "/privacy" },
{ label: "Terms of Service", to: "/terms" },

View file

@ -1,59 +0,0 @@
/* ═══════════════════════════════════════════════════════════════
ORG CONTACT
An organization's ways to reach it, as buttons: its action links
filled in its accent, then its website, email and socials
outlined. Nothing at all when it has none. Used on an
organization's page and on the Organization page (NGU's own).
═══════════════════════════════════════════════════════════════ */
import PlatformIcon from './PlatformIcon.tsx'
import type { OrganizationRecord } from '../lib/useContent.ts'
import { accentText } from '../lib/color.ts'
export default function OrgContact({ org, accent }: { org: OrganizationRecord; accent: string }) {
const hasAny =
org.links.length > 0 || org.socials.length > 0 || org.website || org.email
if (!hasAny) return null
return (
<div className="flex flex-wrap gap-3">
{org.links.map((link) => (
<a
key={link.url}
href={link.url}
target="_blank"
rel="noreferrer"
className="inline-flex items-center gap-2 btn px-5 py-2 text-sm text-white transition-transform hover:scale-105"
style={{ background: accent }}
>
<PlatformIcon platform={link.platform} />
{link.label}
</a>
))}
{/* website and email arrive as bare strings (splitLinks in
shape.js); socials are whole link rows. */}
{[
org.website ? { url: org.website, label: 'Website', platform: null } : null,
org.email ? { url: `mailto:${org.email}`, label: org.email, platform: null } : null,
...org.socials,
]
.filter((link): link is NonNullable<typeof link> => Boolean(link))
.map((link) => (
<a
key={link.url}
href={link.url}
target="_blank"
rel="noreferrer"
className="inline-flex items-center gap-2 btn border px-4 py-1.5 text-sm transition-colors hover:bg-tint"
style={{ borderColor: accent, color: accentText(accent) }}
>
<PlatformIcon platform={link.platform} />
{link.label}
</a>
))}
</div>
)
}

View file

@ -1,143 +0,0 @@
/* ═══════════════════════════════════════════════════════════════
ORG TEAMS
An organization's leadership as people tiles, one block per team:
the team's name (linked to its page) and tagline, then its people.
Leadership arrives flat with team_id and team_name on each row,
so grouping costs nothing; `teams` gives the order and lists a
team with nobody in it yet. Used on an organization's page and on
the Organization page (NGU's own Board, Retreat Team and the rest).
═══════════════════════════════════════════════════════════════ */
import { Link } from 'react-router-dom'
import PeopleTiles from './PeopleTiles.tsx'
import type { Leader, OrganizationRecord } from '../lib/useContent.ts'
import { teamHref } from '../lib/hrefs.ts'
import { mediaUrl } from '../lib/media.ts'
import { accentText } from '../lib/color.ts'
const BODY = 'var(--color-muted)'
/* Whether the organization has any leadership to show. */
export const hasTeams = (org: OrganizationRecord) => groupLeadership(org).length > 0
export default function OrgTeams({ org, accent }: { org: OrganizationRecord; accent: string }) {
const teamBlocks = groupLeadership(org)
return (
<div className="space-y-12">
{teamBlocks.map((block) => (
<div key={block.key}>
<div className="mb-4">
{block.teamId ? (
<h3 className="text-xl font-bold">
<Link
to={teamHref(block.teamId)}
className="hover:underline"
style={{ color: accentText(accent) }}
>
{block.label}
</Link>
</h3>
) : (
block.label && (
<h3 className="text-xl font-bold" style={{ color: accentText(accent) }}>
{block.label}
</h3>
)
)}
{block.tagline && (
<p className="mt-1 text-sm" style={{ color: BODY }}>
{block.tagline}
</p>
)}
</div>
{block.people.length > 0 ? (
<PeopleTiles
size="lg"
accent={block.accent || accent}
people={block.people.map((leader) => ({
id: leader.person_id,
name: leader.display_name,
title: leader.title,
pronouns: leader.pronouns,
public_email: leader.public_email,
photo: mediaUrl(leader.photo),
is_owner: leader.is_owner,
}))}
/>
) : (
<p className="text-sm italic" style={{ color: BODY }}>
No members listed yet.
</p>
)}
</div>
))}
</div>
)
}
/* ── Leadership → team blocks ────────────────────────────────── */
type TeamBlock = {
key: string
teamId: string | null
label: string | null
tagline?: string | null
accent?: string | null
people: Leader[]
}
/* Order comes from `teams` (the admin's sort_order), not from the
order people happen to appear in. Three cases to cover:
affiliations with no team at all, teams with nobody in them, and
people filed under a team that is no longer published. */
function groupLeadership(org: OrganizationRecord): TeamBlock[] {
const byTeam = new Map<string, Leader[]>()
const loose: Leader[] = []
for (const leader of org.leadership) {
if (!leader.team_id) {
loose.push(leader)
continue
}
const list = byTeam.get(leader.team_id)
if (list) list.push(leader)
else byTeam.set(leader.team_id, [leader])
}
const blocks: TeamBlock[] = []
// People who hold a role in the organization without sitting on a
// team. Usually the leads. No heading, they are the page.
if (loose.length > 0) {
blocks.push({ key: 'loose', teamId: null, label: null, people: loose })
}
for (const team of org.teams) {
blocks.push({
key: team.id,
teamId: team.id,
label: team.name,
tagline: team.tagline,
accent: team.color,
people: byTeam.get(team.id) ?? [],
})
byTeam.delete(team.id)
}
// Whatever is left is filed under an unpublished team. Its page
// isn't reachable, so the heading is plain text, but the people
// are real and shouldn't silently vanish from the org.
for (const [teamId, people] of byTeam) {
blocks.push({
key: teamId,
teamId: null,
label: people[0]?.team_name ?? null,
people,
})
}
return blocks
}

View file

@ -163,14 +163,10 @@ export function setPath(object, path, value) {
/* ── Conditional fields ──────────────────────────────────────── */
/* `when: { path, value }` shows a field when the other field holds
that value (or one of a list); `when: { path, filled: true }` when
it holds anything at all. */
export function fieldShown(field, row, parent?) {
if (!field.when) return true;
const source = field.when.scope === "parent" ? parent : row;
if (field.when.filled) return Boolean(source?.[field.when.path]);
const want = Array.isArray(field.when.value) ? field.when.value : [field.when.value];
const source = field.when.scope === "parent" ? parent : row;
return want.includes(source?.[field.when.path]);
}

View file

@ -1,17 +0,0 @@
/* ═══════════════════════════════════════════════════════════════
ORGANIZATION DETAILS
NGU's own address, nonprofit status and contact email, shown in
the footer and in the Organization page's Details & Contact. The
street address is where NGU is, not where to send post, and says
so.
═══════════════════════════════════════════════════════════════ */
export const ORGANIZATION_DETAILS = {
street: '1901 NW Blue Parkway',
cityLine: 'Unity Village, MO 64065',
addressNote: 'Physical address, not for mail',
nonprofit: 'Next Generation of Unity is a qualified 501(c)(3) nonprofit organization.',
taxId: '33-2819320',
email: 'info@nextgenerationofunity.org',
}

View file

@ -32,10 +32,7 @@ export type RequestAction = "new" | "update";
export type RequestField = {
key: string;
/** A short title for the field. */
label: string;
/** A line under the title: what it's for, or where it shows. */
help?: string;
input?: "text" | "date" | "url" | "email" | "textarea";
placeholder?: string;
to?: { path: string } | { link: "website" | "email" | "action"; label: string } | { block: "card" };
@ -59,7 +56,7 @@ const STATE: RequestField = { key: "state", label: "State or province", placehol
const COUNTRY: RequestField = { key: "country", label: "Country", placeholder: "eg. US", to: { path: "country" } };
const WEBSITE: RequestField = { key: "website", label: "Website", input: "url", placeholder: "https://", to: { link: "website", label: "Website" } };
const EMAIL: RequestField = { key: "email", label: "Contact email", input: "email", to: { link: "email", label: "Email" } };
const DESCRIPTION: RequestField = { key: "description", label: "Short description", help: "A line or two shown on its card in lists and at the top of its page.", input: "textarea", to: { block: "card" } };
const DESCRIPTION: RequestField = { key: "description", label: "Short description", input: "textarea", to: { block: "card" } };
export const REQUEST_TYPES: RequestType[] = [
{
@ -71,8 +68,8 @@ export const REQUEST_TYPES: RequestType[] = [
entity: "blog_posts",
heading: "title",
fields: [
{ key: "author", label: "Author", help: "Their name as it should appear on the post.", to: { path: "guest_author" } },
{ key: "excerpt", label: "Short description", help: "A line or two shown on the post's preview card, eg. in the Community blog.", input: "textarea", to: { path: "excerpt" } },
{ key: "author", label: "Author's name, as it should appear", to: { path: "guest_author" } },
{ key: "excerpt", label: "A line or two for the post's card", input: "textarea", to: { path: "excerpt" } },
],
},
{
@ -103,11 +100,11 @@ export const REQUEST_TYPES: RequestType[] = [
heading: "name",
preset: { kind: "group" },
fields: [
{ key: "region", label: "Region", help: "The Unity region it's part of, if you know it.", placeholder: "eg. Great Lakes" },
{ key: "region", label: "Region it's in", placeholder: "eg. Great Lakes" },
CITY,
STATE,
COUNTRY,
{ key: "meets", label: "Meeting time", placeholder: "eg. 2nd Sundays, 6:00pm", to: { path: "group.meets" } },
{ key: "meets", label: "When it meets", placeholder: "eg. 2nd Sundays, 6:00pm", to: { path: "group.meets" } },
WEBSITE,
EMAIL,
DESCRIPTION,
@ -144,8 +141,8 @@ export const REQUEST_TYPES: RequestType[] = [
entity: "teams",
heading: "name",
fields: [
{ key: "organization", label: "Organization", help: "The organization the team belongs to.", placeholder: "eg. NGU national" },
{ key: "tagline", label: "Tagline", help: "What the team does, in a line.", to: { path: "tagline" } },
{ key: "organization", label: "Which organization it belongs to", placeholder: "eg. NGU national" },
{ key: "tagline", label: "What it does, in a line", to: { path: "tagline" } },
EMAIL,
DESCRIPTION,
],
@ -159,9 +156,9 @@ export const REQUEST_TYPES: RequestType[] = [
entity: "awards",
heading: "name",
fields: [
{ key: "organization", label: "Given by", help: "The organization that gives the award.", placeholder: "eg. NGU national" },
{ key: "organization", label: "Who gives it", placeholder: "eg. NGU national" },
{ key: "description", label: "What it's for", input: "textarea", to: { path: "description" } },
{ key: "recipients", label: "Recipients", help: "Who received it, and in which year.", input: "textarea" },
{ key: "recipients", label: "Who received it, and when", input: "textarea" },
],
},
{
@ -174,7 +171,7 @@ export const REQUEST_TYPES: RequestType[] = [
heading: "display_name",
fields: [
{ key: "pronouns", label: "Pronouns", placeholder: "eg. she/her", to: { path: "pronouns" } },
{ key: "tagline", label: "Role or title", help: "Shown under their name, eg. Retreat Team Lead.", to: { path: "tagline" } },
{ key: "tagline", label: "Role or title", to: { path: "tagline" } },
CITY,
STATE,
{ key: "email", label: "Public email", input: "email", to: { path: "public_email" } },

View file

@ -230,11 +230,6 @@ export const linksChild = {
The first row supplies the logo and color when the event sets
neither, so the order here is data rather than a display choice.
An organization host can name a team (any organization's) to show
in its place: the event page reads "Hosted by" that team, linked
to its page, while the logo and color still come from the
organization.
A person supplies neither: there is no color on a person and a
headshot is not a logo, so a person-hosted event with no color
of its own falls through to the section default. */
@ -264,15 +259,6 @@ export const hostsChild = {
blankLabel: "Default: none",
help: "Use if the host is an individual, choose between person and org host, not both.",
},
{
path: "team_id",
label: "Shown as team",
widget: "select",
optionsFrom: "teams",
blankLabel: "Default: the organization",
help: "Optional: a team to name as the host instead, eg. the retreat team. Any organization's team.",
when: { path: "org_id", filled: true },
},
],
};
@ -294,7 +280,6 @@ export const BLOCK_TYPES = [
["schedule", "Schedule", "Entries in one tab per day, each folding out for more. The text is an optional intro."],
["table", "Table", "A grid of text, eg. a comparison chart: one row per line, cells split by |, the first row the header."],
["cards", "Link cards", "Cards with a picture, title and description, each a link to a page or a file, like a link shared in a chat; up to three in a row. Paste a link and press Fetch preview, or Choose a file."],
["people", "People", "People tiles: a team's members, or people picked one by one as items (each with their title), or both."],
["divider", "Divider", "A thin line between parts."],
];
@ -303,8 +288,6 @@ export const SCHEDULE_ENTRY = { scope: "parent", path: "type", value: "schedule"
/* Item fields for a link card, and for every other kind of item. */
export const CARD_ITEM = { scope: "parent", path: "type", value: "cards" };
export const NOT_CARD_ITEM = { scope: "parent", path: "type", value: ["list", "links", "schedule"] };
/* An item that's a person on a people block. */
export const PEOPLE_ITEM = { scope: "parent", path: "type", value: "people" };
export const blockTypeLabel = (type) => BLOCK_TYPES.find(([value]) => value === type)?.[1] ?? type;
@ -401,22 +384,13 @@ export const blocksChild = {
when: { path: "type", value: "image" },
help: "Describes the picture for someone who can't see it, eg. Campers around a fire at dusk",
},
{
path: "team_id",
label: "Team",
widget: "select",
optionsFrom: "teams",
blankLabel: "Default: none, just the people below",
help: "Shows the team's members as tiles, its leads first. People added as items show after it.",
when: { path: "type", value: "people" },
},
],
children: [
{
key: "items",
label: "Items",
addLabel: "Add item",
when: { path: "type", value: ["list", "links", "schedule", "cards", "people"] },
when: { path: "type", value: ["list", "links", "schedule", "cards"] },
title: (row) => [row.day, row.time, row.text].filter(Boolean).join(" · ") || "New item",
blank: { text: "" },
fields: [
@ -438,16 +412,7 @@ export const blocksChild = {
help: "A page on this site (eg. /retreats), anywhere else, or a file (Choose a file). Fetch preview fills the title, description and picture from a page; a file fills its name and first-page picture.",
when: CARD_ITEM,
},
{
path: "person_id",
label: "Person",
widget: "select",
optionsFrom: "people",
required: true,
help: "Shown as a tile with their photo, linked to their page",
when: PEOPLE_ITEM,
},
{ path: "text", label: "Text", required: true, help: "Schedules: the entry's title. Cards: the card's title. People: their title on the tile, eg. Speaker" },
{ path: "text", label: "Text", required: true, help: "Schedules: the entry's title. Cards: the card's title" },
{
path: "location",
label: "Location",

View file

@ -48,9 +48,6 @@ export const siteUrl = (path: string): string => new URL(path, SITE_ORIGIN).href
const PAGES: Record<string, PageText> = { ...siteConfiguration.pages, ...fromServer.pages }
/* Every static page's path and text, for the not-found page's suggestions. */
export const SITE_PAGES: Readonly<Record<string, PageText>> = PAGES
/** A static page's title and intro, from site.json's "pages". */
export function sitePage(path: string): PageText {
const page = PAGES[path]

View file

@ -1,70 +0,0 @@
/* ═══════════════════════════════════════════════════════════════
SUGGEST: what a mistyped or out-of-date address was probably for
The not-found page offers the closest pages to the address that
failed. Each candidate (a static page, or a record from
/directory) is scored by how alike its URL ID or name is to the
address's last part, and its full path to the whole address:
the Dice coefficient over letter pairs, so a typo, a missing
hyphen or an old base (/chapters/lynnwood for /groups/lynnwood)
still lands close. Scores run 0 to 1; anything under MIN_SCORE is
a guess not worth showing.
═══════════════════════════════════════════════════════════════ */
export type Candidate = { href: string; label: string; detail?: string; keys: string[] }
const MIN_SCORE = 0.4
/* Lowercase letters and digits only: "Lynnwood-Group" → "lynnwoodgroup". */
const squash = (text: string) => text.toLowerCase().replace(/[^a-z0-9]/g, '')
function pairs(text: string): Map<string, number> {
const out = new Map<string, number>()
for (let i = 0; i < text.length - 1; i += 1) {
const pair = text.slice(i, i + 2)
out.set(pair, (out.get(pair) ?? 0) + 1)
}
return out
}
/* Dice coefficient of two strings' letter pairs: 1 is identical. */
export function likeness(a: string, b: string): number {
const x = squash(a)
const y = squash(b)
if (!x || !y) return 0
if (x === y) return 1
if (x.length < 2 || y.length < 2) return 0
const left = pairs(x)
const right = pairs(y)
let shared = 0
for (const [pair, count] of left) shared += Math.min(count, right.get(pair) ?? 0)
return (2 * shared) / (x.length - 1 + (y.length - 1))
}
function decode(text: string): string {
try {
return decodeURIComponent(text)
} catch {
return text
}
}
export function suggest(pathname: string, candidates: Candidate[], limit = 5): Candidate[] {
const segments = decode(pathname).split('/').filter(Boolean)
const last = segments.at(-1) ?? ''
const whole = segments.join(' ')
if (!last) return []
return candidates
.map((candidate) => ({
candidate,
score: Math.max(
likeness(whole, candidate.href),
...candidate.keys.map((key) => likeness(last, key)),
),
}))
.filter(({ score }) => score >= MIN_SCORE)
.sort((a, b) => b.score - a.score)
.slice(0, limit)
.map(({ candidate }) => candidate)
}

View file

@ -38,14 +38,11 @@ export type ContentBlock = {
| 'schedule'
| 'table'
| 'cards'
| 'people'
text?: string | null
media?: string | null
href?: string | null
/** An image's alt text. */
alt?: string | null
/** A people block's team, shown as its members' tiles. */
team_id?: string | null
/** Who a quote is by. */
cite?: string | null
items?: ContentBlockItem[]
@ -87,8 +84,6 @@ export type EventHost = {
id: string
name: string
org_kind?: string | null
/** An organization host's team, shown in its place (054). */
team?: { id: string; name: string } | null
}
/* ── Events ──────────────────────────────────────────────────── */

View file

@ -7,4 +7,4 @@
box or a build banner can read the same value later.
═══════════════════════════════════════════════════════════════ */
export const SITE_VERSION = "NGU-Web.v1.10.3";
export const SITE_VERSION = "NGU-Web.v1.10.2";

View file

@ -5,7 +5,7 @@ export const PAGE_LINKS = [
{ label: "Home", path: "/" },
{ label: "Retreats", path: "/retreats" },
{ label: "Community", path: "/community" },
{ label: "Organization", path: "/organization" },
{ label: "Leadership", path: "/leadership" },
{ label: "Resources", path: "/resources" },
{ label: "History", path: "/history" },
];
@ -31,10 +31,11 @@ export const PAGE_SECTIONS = {
{ label: "Unity Regions", hash: "#regions" },
{ label: "Partner Organizations", hash: "#partners" },
],
"/organization": [
{ label: "Mission & Values", hash: "#mission" },
{ label: "Leadership", hash: "#leadership" },
{ label: "Details & Contact", hash: "#contact" },
"/leadership": [
{ label: "Board & Staff", hash: "#board-staff" },
{ label: "Retreat Team", hash: "#retreat-team" },
{ label: "Committees & Volunteers", hash: "#committees" },
{ label: "Contact Us", hash: "#contact" },
],
"/resources": [
{ label: "Unity Teachings", hash: "#unity" },
@ -48,7 +49,7 @@ export const PAGE_SECTIONS = {
// Right-side actions. `variant` picks the styling, not the destination.
export const NAV_ACTIONS = [
{ label: "Contact Us", to: "/organization#contact", variant: "ghost" },
{ label: "Contact Us", to: "/leadership#contact", variant: "ghost" },
{
label: "Give",
to: "/give",

View file

@ -295,14 +295,12 @@ function Facts({ event, accent }: { event: EventRecord; accent: string }) {
sentence, so they're joined with commas and an "and" rather than
stacked. A host whose id didn't resolve to a route renders as
plain text, refHref returns null for that, because a dead link
is worse than a name. An organization host with a team set shows
the team instead, linked to the team's page. */
is worse than a name. */
function HostList({ hosts, accent }: { hosts: EventHost[]; accent: string }) {
return (
<>
{hosts.map((host, index) => {
const to = host.team ? refHref('team', host.team.id) : refHref(host.kind, host.id, host.org_kind)
const name = host.team?.name ?? host.name
const to = refHref(host.kind, host.id, host.org_kind)
return (
<span key={`${host.kind}:${host.id}`}>
@ -314,10 +312,10 @@ function HostList({ hosts, accent }: { hosts: EventHost[]; accent: string }) {
className="font-medium hover:underline"
style={{ color: accentText(accent) }}
>
{name}
{host.name}
</Link>
) : (
<span className="font-medium">{name}</span>
<span className="font-medium">{host.name}</span>
)}
</span>
)

66
src/pages/Leadership.tsx Normal file
View file

@ -0,0 +1,66 @@
import PageShell from "../components/PageShell.tsx";
import ComingSoon from "../components/ComingSoon.tsx";
import { sitePage } from "../lib/site.ts";
import PeopleTiles from "../components/PeopleTiles.tsx";
import { ACCENTS, BRAND } from "../lib/color.ts"
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/leadership");
const SECTIONS = [
{
id: "board-staff",
title: "Board & Staff",
blurb: "The people guiding Next Generation of Unity day to day.",
accent: BRAND,
content: (
<div className="max-w-6xl mx-auto px-6">
<PeopleTiles size="lg" teams={{ id: "ngu-board",}} />
</div>
),
},
{
id: "retreat-team",
title: "Retreat Team",
blurb: "Volunteers who plan and lead our gatherings throughout the year.",
accent: ACCENTS.green,
content: (
<div className="max-w-6xl mx-auto px-6">
<PeopleTiles size="lg" teams="ngu-retreat-team" />
</div>
),
},
{
id: "committees",
title: "Committees & Volunteers",
blurb: "Additional roles and contributors.",
accent: ACCENTS.amber,
content: <ComingSoon what="this list of committees and volunteers" />,
},
{
id: "contact",
title: "Contact Us",
blurb: "Reach out to our staff",
accent: ACCENTS.deep,
content: (
<div className="max-w-6xl mx-auto px-6">
<a
href="mailto:info@nextgenerationofunity.org"
className="inline-block py-2.5 px-6 btn border border-link text-link transition-all duration-200 hover:scale-105 active:scale-[0.98]"
>
info@nextgenerationofunity.org
</a>
</div>
),
},
];
export default function Leadership() {
return (
<PageShell
title={PAGE.title}
intro={PAGE.description}
sections={SECTIONS}
/>
);
}

View file

@ -1,133 +1,16 @@
/* ═══════════════════════════════════════════════════════════════
NOT FOUND: any address no route matches
Rather than a dead end, the closest pages to the address that
failed: the static pages (site.json's) and every public, listed
record (GET /directory), scored by suggest.ts against the
address. So /organisation offers Organization, /retreat offers
Retreats, and an old /chapters/lynnwood offers the Lynnwood group.
Below them, the main pages to start from.
The server sends this same page with a 404 status for an unknown
address (routes/pages.js), so search engines drop it.
═══════════════════════════════════════════════════════════════ */
import { ArrowRight } from '@phosphor-icons/react'
import { useMemo } from 'react'
import { Link, useLocation } from 'react-router-dom'
import PageShell from '../components/PageShell.tsx'
import { PAGE_LINKS } from '../navConfig.ts'
import { SITE_PAGES } from '../lib/site.ts'
import { useDirectory, type Directory } from '../lib/useContent.ts'
import { blogHref, eventHref, orgHref, personHref, teamHref, awardHref } from '../lib/hrefs.ts'
import { suggest, type Candidate } from '../lib/suggest.ts'
import { ACCENTS, BRAND } from '../lib/color.ts'
const ORG_KIND_LABEL: Record<string, string> = {
national: 'Organization',
region: 'Region',
group: 'Group',
partner: 'Partner',
}
/* Everything an address could have meant: the static pages, then
each kind of record, with the words to match it by. */
function candidates(directory: Directory | null): Candidate[] {
const pages: Candidate[] = Object.entries(SITE_PAGES).map(([path, page]) => ({
href: path,
label: page.title,
detail: 'Page',
keys: [path.slice(1), page.title],
}))
if (!directory) return pages
const record = (href: string, id: string, name: string, detail: string): Candidate => ({
href,
label: name,
detail,
keys: [id, name],
})
return [
...pages,
...directory.events.map((e) => record(eventHref(e.id), e.id, e.name, 'Event')),
...directory.organizations.map((o) => record(orgHref(o.id, o.kind), o.id, o.name, ORG_KIND_LABEL[o.kind] ?? 'Organization')),
...directory.teams.map((t) => record(teamHref(t.id), t.id, t.name, `Team, ${t.org_name}`)),
...directory.awards.map((a) => record(awardHref(a.id), a.id, a.name, 'Award')),
...directory.people.map((p) => record(personHref(p.id), p.id, p.name, 'Person')),
...directory.blog_posts.map((b) => record(blogHref(b.id), b.id, b.name, 'Blog post')),
]
}
import { Link } from "react-router-dom";
export default function NotFound() {
const { pathname } = useLocation()
const { data: directory, loading } = useDirectory()
const matches = useMemo(() => suggest(pathname, candidates(directory ?? null)), [pathname, directory])
return (
<PageShell
title="That page isn’t here"
intro="The link may be out of date, or the address may have a typo."
sections={[
{
id: 'suggestions',
title: matches.length ? 'Were you looking for' : 'Nothing close by that name',
accent: BRAND,
content: (
<div className="mx-auto max-w-6xl px-6">
{loading && !directory ? (
<div className="skeleton !min-h-32" aria-label="Looking for similar pages" />
) : matches.length ? (
<ul className="max-w-2xl divide-y divide-brand/15 bg-raised shadow-sm">
{matches.map((match) => (
<li key={match.href}>
<Link
to={match.href}
className="group flex items-center gap-4 px-5 py-4 transition-colors hover:bg-tint-soft"
>
<span className="min-w-0 flex-1">
<span className="block font-display font-bold text-ink">{match.label}</span>
<span className="block text-sm text-muted">
{match.detail} · {match.href}
</span>
</span>
<ArrowRight
className="shrink-0 text-link transition-transform group-hover:translate-x-1"
weight="bold"
aria-hidden="true"
/>
<section className="px-6 py-20">
<h1 className="text-4xl font-bold">That page isn't here</h1>
<p className="mt-4 text-lg">
The link may be out of date.{" "}
<Link to="/" className="underline">
Go to the home page
</Link>
</li>
))}
</ul>
) : (
<p className="notice max-w-xl p-6 text-body">
Try one of the main pages below, or the menu at the top.
.
</p>
)}
</div>
),
},
{
id: 'start',
title: 'Start from',
accent: ACCENTS.green,
content: (
<div className="mx-auto flex max-w-6xl flex-wrap gap-3 px-6">
{PAGE_LINKS.map((page) => (
<Link
key={page.path}
to={page.path}
className="btn border border-brand/50 px-5 py-2 text-link transition-colors hover:bg-tint"
>
{page.label}
</Link>
))}
</div>
),
},
]}
/>
)
</section>
);
}

View file

@ -1,136 +0,0 @@
/* ═══════════════════════════════════════════════════════════════
ORGANIZATION: /organization (it was /leadership, which the API
redirects here)
NGU itself, in three parts:
mission Mission, Vision & Values: the national organization
record's own description and content blocks (Data →
Organizations → NGU), so editors change them with the
block editor
leadership that record's teams, each with its people (OrgTeams):
the Board of Trustees, the Retreat Team, committees
and volunteers, in the admin's order
contact NGU's address, nonprofit status and email
(src/data/organizationDetails.ts), and the record's
own contact links (OrgContact)
The record is the one organization of kind national, found rather
than named, so its URL ID can change.
═══════════════════════════════════════════════════════════════ */
import PageShell from '../components/PageShell.tsx'
import ComingSoon from '../components/ComingSoon.tsx'
import ContentBlocks from '../components/ContentBlocks.tsx'
import OrgTeams, { hasTeams } from '../components/OrgTeams.tsx'
import OrgContact from '../components/OrgContact.tsx'
import { sitePage } from '../lib/site.ts'
import { useOrganizations } from '../lib/organizations.ts'
import { useOrganization, type OrganizationRecord } from '../lib/useContent.ts'
import { ORGANIZATION_DETAILS } from '../data/organizationDetails.ts'
import { ACCENTS, BRAND } from '../lib/color.ts'
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage('/organization')
export default function Organization() {
const national = useOrganizations('national')
const id = national.organizations[0]?.id
const record = useOrganization(id)
const org = record.data ?? null
const failed = national.error || record.error
const loading = !failed && !org && (national.loading || record.loading || Boolean(id))
const pending = (what: string) =>
failed ? (
<p className="mx-auto max-w-6xl px-6 text-danger">Couldn’t load {what} right now.</p>
) : loading ? (
<div className="mx-auto max-w-6xl px-6">
<div className="skeleton !min-h-40" aria-label={`Loading ${what}`} />
</div>
) : null
return (
<PageShell
title={PAGE.title}
intro={PAGE.description}
sections={[
{
id: 'mission',
title: 'Mission, Vision & Values',
accent: BRAND,
content: pending('our mission') ?? <Mission org={org} />,
},
{
id: 'leadership',
title: 'Leadership',
blurb: 'Our board, retreat team, committees and volunteers.',
accent: ACCENTS.green,
content:
pending('our leadership') ??
(org && hasTeams(org) ? (
<div className="mx-auto max-w-6xl px-6">
<OrgTeams org={org} accent={ACCENTS.green} />
</div>
) : (
<ComingSoon what="our leadership list" />
)),
},
{
id: 'contact',
title: 'Details & Contact',
accent: ACCENTS.deep,
content: <Contact org={org} />,
},
]}
/>
)
}
function Mission({ org }: { org: OrganizationRecord | null }) {
const paragraphs = org?.description ?? []
const blocks = org?.blocks ?? []
if (paragraphs.length === 0 && blocks.length === 0) return <ComingSoon what="our mission, vision and values" />
return (
<div className="mx-auto max-w-6xl space-y-6 px-6">
{paragraphs.map((paragraph, index) => (
<p key={index} className="max-w-3xl text-lg leading-relaxed text-body">
{paragraph}
</p>
))}
<div className="max-w-3xl">
<ContentBlocks blocks={blocks} accent={BRAND} />
</div>
</div>
)
}
function Contact({ org }: { org: OrganizationRecord | null }) {
const details = ORGANIZATION_DETAILS
return (
<div className="mx-auto grid max-w-6xl gap-8 px-6 md:grid-cols-2">
<div className="space-y-3 text-body">
<address className="not-italic leading-relaxed">
{details.street}
<br />
{details.cityLine}
<br />
<span className="text-sm text-muted">({details.addressNote})</span>
</address>
<p className="text-sm text-muted">
{details.nonprofit} Tax ID: {details.taxId}.
</p>
</div>
<div className="space-y-4">
<a
href={`mailto:${details.email}`}
className="btn inline-block border border-link px-6 py-2.5 text-link transition-colors hover:bg-tint"
>
{details.email}
</a>
{org && <OrgContact org={org} accent={ACCENTS.deep} />}
</div>
</div>
)
}

View file

@ -10,23 +10,26 @@
a region redirects to the canonical path rather than rendering a
correct page at a wrong address.
Its leadership, team by team, is OrgTeams (shared with the
Organization page); its contact buttons are OrgContact.
Leadership arrives flat with team_id and team_name on each row,
so grouping costs nothing. `teams` is fetched alongside anyway:
a team with no current public members would otherwise be
invisible here instead of listed, and its page unreachable.
═══════════════════════════════════════════════════════════════ */
import { Link, Navigate, useLocation, useParams } from 'react-router-dom'
import PageShell from '../components/PageShell.tsx'
import PageState from '../components/PageState.tsx'
import PlatformIcon from '../components/PlatformIcon.tsx'
import ContentBlocks from '../components/ContentBlocks.tsx'
import OrgTeams, { hasTeams } from '../components/OrgTeams.tsx'
import OrgContact from '../components/OrgContact.tsx'
import PeopleTiles from '../components/PeopleTiles.tsx'
import EventListCards from './sections/EventList-Cards.tsx'
import {
useOrganization,
type Leader,
type OrganizationRecord,
} from '../lib/useContent.ts'
import { orgHref, orgListHref } from '../lib/hrefs.ts'
import { orgHref, orgListHref, teamHref } from '../lib/hrefs.ts'
import { mediaUrl } from '../lib/media.ts'
import { initialsFor } from '../lib/organizations.ts'
import Logo from '../components/Logo.tsx'
@ -91,20 +94,69 @@ export default function OrganizationDetail() {
<ContentBlocks blocks={org.blocks} accent={accent} />
</div>
<OrgContact org={org} accent={accent} />
<Contact org={org} accent={accent} />
</div>
),
},
]
if (hasTeams(org)) {
const teamBlocks = groupLeadership(org)
if (teamBlocks.length > 0) {
sections.push({
id: 'leadership',
title: 'Who runs it',
accent,
content: (
<div className="max-w-6xl mx-auto px-6">
<OrgTeams org={org} accent={accent} />
<div className="max-w-6xl mx-auto px-6 space-y-12">
{teamBlocks.map((block) => (
<div key={block.key}>
<div className="mb-4">
{block.teamId ? (
<h3 className="text-xl font-bold">
<Link
to={teamHref(block.teamId)}
className="hover:underline"
style={{ color: accentText(accent) }}
>
{block.label}
</Link>
</h3>
) : (
block.label && (
<h3 className="text-xl font-bold" style={{ color: accentText(accent) }}>
{block.label}
</h3>
)
)}
{block.tagline && (
<p className="mt-1 text-sm" style={{ color: BODY }}>
{block.tagline}
</p>
)}
</div>
{block.people.length > 0 ? (
<PeopleTiles
size="lg"
accent={block.accent || accent}
people={block.people.map((leader) => ({
id: leader.person_id,
name: leader.display_name,
title: leader.title,
pronouns: leader.pronouns,
public_email: leader.public_email,
photo: mediaUrl(leader.photo),
is_owner: leader.is_owner,
}))}
/>
) : (
<p className="text-sm italic" style={{ color: BODY }}>
No members listed yet.
</p>
)}
</div>
))}
</div>
),
})
@ -256,6 +308,53 @@ function Facts({
)
}
function Contact({ org, accent }: { org: OrganizationRecord; accent: string }) {
const hasAny =
org.links.length > 0 || org.socials.length > 0 || org.website || org.email
if (!hasAny) return null
return (
<div className="flex flex-wrap gap-3">
{org.links.map((link) => (
<a
key={link.url}
href={link.url}
target="_blank"
rel="noreferrer"
className="inline-flex items-center gap-2 btn px-5 py-2 text-sm text-white transition-transform hover:scale-105"
style={{ background: accent }}
>
<PlatformIcon platform={link.platform} />
{link.label}
</a>
))}
{/* website and email arrive as bare strings (splitLinks in
shape.js); socials are whole link rows. */}
{[
org.website ? { url: org.website, label: 'Website', platform: null } : null,
org.email ? { url: `mailto:${org.email}`, label: org.email, platform: null } : null,
...org.socials,
]
.filter((link): link is NonNullable<typeof link> => Boolean(link))
.map((link) => (
<a
key={link.url}
href={link.url}
target="_blank"
rel="noreferrer"
className="inline-flex items-center gap-2 btn border px-4 py-1.5 text-sm transition-colors hover:bg-tint"
style={{ borderColor: accent, color: accentText(accent) }}
>
<PlatformIcon platform={link.platform} />
{link.label}
</a>
))}
</div>
)
}
function GroupMark({ file, name, accent }: { file?: string | null; name: string; accent: string }) {
return (
<Logo
@ -273,3 +372,67 @@ function GroupMark({ file, name, accent }: { file?: string | null; name: string;
/>
)
}
/* ── Leadership → team blocks ────────────────────────────────── */
type TeamBlock = {
key: string
teamId: string | null
label: string | null
tagline?: string | null
accent?: string | null
people: Leader[]
}
/* Order comes from `teams` (the admin's sort_order), not from the
order people happen to appear in. Three cases to cover:
affiliations with no team at all, teams with nobody in them, and
people filed under a team that is no longer published. */
function groupLeadership(org: OrganizationRecord): TeamBlock[] {
const byTeam = new Map<string, Leader[]>()
const loose: Leader[] = []
for (const leader of org.leadership) {
if (!leader.team_id) {
loose.push(leader)
continue
}
const list = byTeam.get(leader.team_id)
if (list) list.push(leader)
else byTeam.set(leader.team_id, [leader])
}
const blocks: TeamBlock[] = []
// People who hold a role in the organization without sitting on a
// team. Usually the leads. No heading, they are the page.
if (loose.length > 0) {
blocks.push({ key: 'loose', teamId: null, label: null, people: loose })
}
for (const team of org.teams) {
blocks.push({
key: team.id,
teamId: team.id,
label: team.name,
tagline: team.tagline,
accent: team.color,
people: byTeam.get(team.id) ?? [],
})
byTeam.delete(team.id)
}
// Whatever is left is filed under an unpublished team. Its page
// isn't reachable, so the heading is plain text, but the people
// are real and shouldn't silently vanish from the org.
for (const [teamId, people] of byTeam) {
blocks.push({
key: teamId,
teamId: null,
label: people[0]?.team_name ?? null,
people,
})
}
return blocks
}

View file

@ -61,8 +61,8 @@ export default function PersonDetail() {
notFound={notFound}
onRetry={reload}
noun="person"
backTo="/organization"
backLabel="Organization"
backTo="/leadership"
backLabel="Leadership"
/>
)
}
@ -247,7 +247,7 @@ function Facts({ person, accent }: { person: PersonRecord; accent: string }) {
{person.location_label && <span style={{ color: BODY }}>{person.location_label}</span>}
<Link to="/organization#leadership" className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
<Link to="/leadership" className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
Leadership
</Link>
</div>

View file

@ -36,8 +36,8 @@ export default function TeamDetail() {
notFound={notFound}
onRetry={reload}
noun="team"
backTo="/organization"
backLabel="Organization"
backTo="/leadership"
backLabel="Leadership"
/>
)
}

View file

@ -235,10 +235,8 @@ export default function RequestForm() {
<div className="mt-4 grid gap-4 sm:grid-cols-2">
{type.fields.map((f) => {
const id = `request-detail-${f.key}`;
const helpId = f.help ? `${id}-help` : undefined;
const common = {
id,
"aria-describedby": helpId,
value: details[f.key] ?? "",
placeholder: f.placeholder,
maxLength: 2000,
@ -250,11 +248,6 @@ export default function RequestForm() {
<label htmlFor={id} className="block text-sm font-medium text-body">
{f.label}
</label>
{f.help && (
<p id={helpId} className="mt-0.5 text-xs" style={{ color: MUTED }}>
{f.help}
</p>
)}
{f.input === "textarea" ? (
<textarea {...common} rows={3} onChange={(e) => set(e.target.value)} className={`mt-2 resize-y ${fieldClass}`} />
) : (
@ -305,10 +298,8 @@ export default function RequestForm() {
<OptionalTag />
</div>
<p className="mt-1 max-w-prose text-sm" style={{ color: MUTED }}>
Why a file: a blog post sent as a Word document (.docx) can be imported straight onto the site, its
headings, lists, tables and links as written, so nothing needs retyping. For anything else, a document
with the details, photos (JPEG or PNG) or a PDF saves us asking. Up to {MAX_FILES} files,{" "}
{MAX_FILE_MB} MB each.
A Word document (.docx) with the details or the post itself, photos (JPEG or PNG) or a PDF. Up to{" "}
{MAX_FILES}, {MAX_FILE_MB} MB each.
</p>
<input
id="request-files"