diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md index 6a629b9..8fa6a36 100644 --- a/docs/updating-data-in-code.md +++ b/docs/updating-data-in-code.md @@ -183,6 +183,7 @@ also in `server/src/admin-schema/` and a CHECK): | Content blocks → Shown in (slot) | card, body | **yes** | `paragraphs()` in `server/src/shape.js` (card), `ContentBlocks.tsx` (body) | | Content blocks → Type | heading, subheading, paragraph, list, links, quote, image, divider, video, button, callout, schedule, table, cards, people, map, events | **yes**, `BLOCK_TYPES` (with each type's description) | `ContentBlocks.tsx` (one renderer per type). Which fields each type shows is `when` on the fields in `blocksChild` (`src/lib/adminSchema/shared.ts`). | | Content blocks → Schedule items → Type | (blank: normal entry), block, break, heading | **yes**, migration 086 | `SCHEDULE_KINDS` in `src/lib/adminSchema/shared.ts`; drawn by `ScheduleBlock.tsx` and `EventPresent.tsx` (which slides each kind gets; the presentation cuts the event's page into sections at its Heading blocks). A block's sub-items are `content_block_subitems`. A schedule's own tags (087) are `content_block_tags`, rows of the block typed in the admin (not a fixed list); entries name them by `tag_key`, made in the admin as the tag is added. A schedule's Venue (088) lends its locations (Data → Venues, `venue_locations`) to its entries' Map location, named by `location_key` the same way; an entry's Event (a workshop) fills what it leaves blank in `shape.js` (`attachEvents`). | +| Content blocks → List → Style | (blank: bold text, normal detail), plain (plain text, gray detail) | **yes**, migration 092 | The Style field in `src/lib/adminSchema/shared.ts`; drawn by the `list` case in `ContentBlocks.tsx`. | | Timeline → Kind (+ list filter) | milestone, event, organization, award, people | no | `KIND_NAMES` in `src/pages/sections/history/TimelineEntry.tsx` | | Timeline → Points at (+ list filter) | event, organization, award, person, team | no | `refHref` in `src/lib/hrefs.ts` | | Timeline → Precision (and on events/orgs) | year, month, day | no | the history page's grouping | diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js index 80e5956..6b37c79 100644 --- a/server/src/admin-schema/columns.js +++ b/server/src/admin-schema/columns.js @@ -175,6 +175,8 @@ export const blocksChild = (ownerKind) => ({ text("team_id"), // Map and schedule blocks (088): whose map and locations. text("venue_id"), + // List blocks (092): null bold text, 'plain' the old look. + enumeration("list_style", ["plain"]), ], children: [ { diff --git a/server/src/migrations/092_list_style.sql b/server/src/migrations/092_list_style.sql new file mode 100644 index 0000000..5865aae --- /dev/null +++ b/server/src/migrations/092_list_style.sql @@ -0,0 +1,13 @@ +-- ═══════════════════════════════════════════════════════════════ +-- 092 A LIST BLOCK'S STYLE +-- +-- How a list block's items read: +-- +-- null the item's text bold, its detail in the body color +-- plain the text plain, the detail gray (the look before 092) +-- +-- Other block types ignore it. +-- ═══════════════════════════════════════════════════════════════ + +ALTER TABLE content_blocks ADD COLUMN list_style TEXT + CHECK (list_style IN ('plain')); diff --git a/server/src/shape.js b/server/src/shape.js index 2d31f80..739e9b2 100644 --- a/server/src/shape.js +++ b/server/src/shape.js @@ -71,7 +71,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) { const blockRows = db .prepare( `SELECT id, owner_id, type, text, media, href, alt, cite, captions, team_id, venue_id, - word_motion, word_direction, word_seconds + word_motion, word_direction, word_seconds, list_style FROM content_blocks WHERE owner_kind = ? AND slot IN (?, 'both') AND owner_id IN (${placeholders(ids.length)}) ORDER BY owner_id, sort_order`, @@ -93,6 +93,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) { captions: row.captions, team_id: row.team_id, venue_id: row.venue_id, + list_style: row.list_style, // Its rotating words' motion (084), when it has its own. words: row.word_motion || row.word_direction || row.word_seconds ? { motion: row.word_motion, direction: row.word_direction, seconds: row.word_seconds } diff --git a/src/components/ContentBlocks.tsx b/src/components/ContentBlocks.tsx index 8b0ebbc..c3f96de 100644 --- a/src/components/ContentBlocks.tsx +++ b/src/components/ContentBlocks.tsx @@ -389,7 +389,10 @@ function Block({ ) - case 'list': + case 'list': { + // Bold text and a plain detail, unless the block is set Plain + // (092): plain text, gray detail. + const plain = block.list_style === 'plain' return (