People blocks and host teams

- A "People" content block: a team's members as people tiles, people
  picked one by one as items (each with a title), or both.
  content_blocks gains team_id (migration 054 rebuilds it for the
  type CHECK); a picked person rides on the item's person_id.
- An organization host can name a team (any organization's) to show
  in its place: event_hosts.team_id, carried by v_event_hosts. The
  event page reads "Hosted by" the team, linked to its page.
- Admin fields can show on `when: { path, filled: true }`.
- The showcase post has a people block; the past showcase event is
  hosted by the region shown as its team.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-30 20:26:26 -05:00
parent 6f86a113e0
commit 7c7cdaac14
10 changed files with 228 additions and 11 deletions

View file

@ -27,6 +27,9 @@
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),
@ -38,6 +41,7 @@
═══════════════════════════════════════════════════════════════ */
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'
@ -326,6 +330,19 @@ 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

@ -163,10 +163,14 @@ 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 want = Array.isArray(field.when.value) ? field.when.value : [field.when.value];
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];
return want.includes(source?.[field.when.path]);
}