Events block: featured events open in full above the cards, under a heading

Migration 090 adds heading and subheading to content_block_items. An
events block's item ticked Featured shows in full above the cards,
under its heading and subheading when set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-11 02:57:26 -06:00
parent a7495f09e5
commit 8a79206998
6 changed files with 88 additions and 28 deletions

View file

@ -207,6 +207,9 @@ export const blocksChild = (ownerKind) => ({
// block's venue map (088).
text("event_id"),
text("location_key"),
// A featured event's heading and subheading (090).
text("heading"),
text("subheading"),
],
children: [
{

View file

@ -0,0 +1,15 @@
-- ═══════════════════════════════════════════════════════════════
-- 090 FEATURED EVENTS IN AN EVENTS BLOCK
--
-- An events block's item ticked Featured (086's `featured`) shows
-- opened in full above the cards, under its own heading and
-- subheading, both optional:
--
-- heading eg. This year's keynote
-- subheading a line under it
--
-- Other item kinds ignore both.
-- ═══════════════════════════════════════════════════════════════
ALTER TABLE content_block_items ADD COLUMN heading TEXT;
ALTER TABLE content_block_items ADD COLUMN subheading TEXT;

View file

@ -116,7 +116,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
const itemRows = db
.prepare(
`SELECT i.id, i.block_id, i.day, i.kind, ${ENTRY_FIELDS}
`SELECT i.id, i.block_id, i.day, i.kind, i.heading, i.subheading, ${ENTRY_FIELDS}
FROM content_block_items i
LEFT JOIN v_people_public p ON p.id = i.person_id AND p.is_published = 1
WHERE i.block_id IN (${placeholders(blockIds.length)})
@ -128,7 +128,14 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
// ride along anyway rather than branching on the block's type.
const itemsById = new Map();
for (const row of itemRows) {
const item = { ...scheduleEntry(row), day: row.day, kind: row.kind ?? "entry", items: [] };
const item = {
...scheduleEntry(row),
day: row.day,
kind: row.kind ?? "entry",
heading: row.heading,
subheading: row.subheading,
items: [],
};
itemsById.set(row.id, item);
byId.get(row.block_id)?.items.push(item);
}