Regions: featured cards in the region list and on the region's page (migration 072)

A region owns featured cards like the front page does, set in its
editor (shown when Kind is region). They show in its row of the
region list when opened, and in a Featured section on its page.
featured_cards takes an 'organization' owner kind; the table is
rebuilt, and a region's cards go when it does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aidan Dona 2026-10-07 16:56:14 -05:00
parent 07be48d770
commit 2977168af5
9 changed files with 181 additions and 17 deletions

View file

@ -1,5 +1,5 @@
import { mediaUrl } from "../media.ts";
import { PLACE_FIELDS, PUBLISH_FIELDS, timelineGroup, timelineDetailGroup, linksChild, blocksChild, tagsChild } from "./shared.ts";
import { PLACE_FIELDS, PUBLISH_FIELDS, timelineGroup, timelineDetailGroup, linksChild, blocksChild, tagsChild, featuredCardsChild } from "./shared.ts";
/* ── Organizations ───────────────────────────────────────────── */
@ -90,6 +90,11 @@ export const organizations = {
children: [
tagsChild,
{
...featuredCardsChild,
when: { path: "kind", value: "region" },
note: "Shown in this region's row of the region list (when it's opened) and on its page, in this order.",
},
{
key: "region_areas",
label: "Map areas",

View file

@ -12,6 +12,7 @@
*/
import type { BlogPostSummary } from './useBlog.ts'
import type { FeaturedCard } from './useFrontPage.ts'
import { detailPath } from './hrefs.ts'
import { useRecord, type Resource } from './useRecord.ts'
import type { EventType } from './eventTypes.ts'
@ -257,6 +258,8 @@ export type OrganizationRecord = {
map_note?: string | null
areas?: RegionArea[]
groups?: Array<{ id: string; name: string; location_label?: string | null; logo?: string | null }>
/** A region's own featured cards, in order. */
featured?: FeaturedCard[]
region_id?: string | null
region_name?: string | null
region_color?: string | null