Schedule tags: a block's own tags, tag tabs, chips, a tag filter and tag slides

A schedule block gets its own tags (content_block_tags, migration 087):
a name, a color and whether it's a tab. Entries and sub-items pick them
from a checklist. Each tag is a tab after the days, gathering what it's
on from every day under the day's name; a tagged entry comes whole and
an untagged block brings only its tagged sub-items. Rows show their tags
as chips. The presentation can show only one tag's entries and adds a
slide per tag after the days.

Entries name a tag by a key the admin makes when the tag is added, so a
rename keeps them, since the block's rows are rewritten on every save.
For that the admin engine gets a function blank (fresh values for every
new row and copy, with a `seeded` column that doesn't count as input),
`lends` (a row's options for the collections nested in it) and a
checklist widget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-03 02:04:06 -06:00
parent 7885d10249
commit 71d58318b6
12 changed files with 539 additions and 122 deletions

View file

@ -86,24 +86,29 @@ const PAST = "showcase-past-event";
plain entry, one with a location and person, one folding out with
a description, graphic and map, one linked, a heading, a featured
entry, a block with sub-items, a break, typed and picked times,
and one with no day (it lands in a tab of its own). */
tags (one a tab of its own in its color, one with No tab), and one
with no day (it lands in a tab of its own). */
const SCHEDULE = [
"schedule",
{ text: "The weekend at a glance. Tap an entry for more." },
[
{ day: "Friday", start_time: "16:00", text: "Arrivals and check-in", location: "Front desk" },
{ day: "Friday", start_time: "16:00", text: "Arrivals and check-in", location: "Front desk", tags: "showcase-youth,showcase-all" },
{ day: "Friday", kind: "heading", text: "Evening", detail: "A heading across the day" },
{ day: "Friday", time: "7:00 to 8:30pm", text: "Opening session", location: "Main Hall", person_id: "showcase-person", detail: "Welcome and worship", description: "The **opening session** sets the theme for the weekend.\n\nBring a notebook.", media: "/uploads/showcase.jpg", map: "Camp Hebron, Halifax PA", map_image: "/uploads/showcase.jpg" },
{ day: "Saturday", start_time: "08:00", end_time: "09:00", kind: "break", text: "Breakfast", location: "Dining hall" },
{ day: "Saturday", start_time: "09:00", end_time: "10:30", kind: "block", text: "Workshops", location: "Classrooms", detail: "Pick one of three", items: [
{ start_time: "09:00", end_time: "09:45", text: "Leading worship", location: "Room A", person_id: "showcase-member-2", url: "/blog/content-block-showcase" },
{ start_time: "09:00", end_time: "09:45", text: "Speaking with confidence", location: "Room B", featured: 1, description: "A featured sub-item that folds out." },
{ start_time: "09:00", end_time: "09:45", text: "Speaking with confidence", location: "Room B", featured: 1, tags: "showcase-youth", description: "A featured sub-item that folds out." },
{ time: "After the first round", text: "Open questions", location: "Room C" },
] },
{ day: "Saturday", start_time: "19:00", featured: 1, text: "Talent night", location: "Main Hall", person_id: "showcase-member-3", description: "Sign up at the front desk by noon." },
{ day: "Saturday", start_time: "19:00", featured: 1, tags: "showcase-youth", text: "Talent night", location: "Main Hall", person_id: "showcase-member-3", description: "Sign up at the front desk by noon." },
{ day: "Sunday", time: "10:00am", text: "Closing service", location: "Chapel", map: "Main Street, Halifax PA" },
{ time: "Any time", text: "Quiet room open", location: "Library", detail: "An entry with no day" },
],
[
{ tag_key: "showcase-youth", name: "Youth", color: "#00748a" },
{ tag_key: "showcase-all", name: "Everyone", no_tab: 1 },
],
];
/* Every block type, for the blog showcase. [type, fields, items?] */
@ -208,7 +213,7 @@ function insert(table, row) {
}
function blocks(ownerKind, ownerId, slot, list) {
list.forEach(([type, f, items = []], order) => {
list.forEach(([type, f, items = [], tags = []], order) => {
const { lastInsertRowid } = insert("content_blocks", {
owner_kind: ownerKind,
owner_id: ownerId,
@ -221,6 +226,7 @@ function blocks(ownerKind, ownerId, slot, list) {
const entry = insert("content_block_items", { block_id: lastInsertRowid, sort_order: i, ...item });
subitems.forEach((sub, j) => insert("content_block_subitems", { item_id: entry.lastInsertRowid, sort_order: j, ...sub }));
});
tags.forEach((tag, i) => insert("content_block_tags", { block_id: lastInsertRowid, sort_order: i, ...tag }));
});
}