Present: slide order, presentation settings, blocks drawn for a screen
- Setup's Order list: drag or move any slide; saved in the address - A heading-only section titles the slides after it, no slide of its own - Event Presentation settings (095): background image and color, dim, frame, accent, text color, logo - Blocks: Presentation text and Leave out of the presentation; map blocks get a slide per section, map only, no details, location slides - Presented, links are plain text, people a row of round photos and names, organizations their logos Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a79559d290
commit
7e21a0dd40
16 changed files with 652 additions and 68 deletions
|
|
@ -181,6 +181,14 @@ export const blocksChild = (ownerKind) => ({
|
|||
enumeration("list_style", ["plain"]),
|
||||
// Organizations blocks (093): the kind listed when none are picked.
|
||||
enumeration("org_kind", ["region", "group", "partner", "ministry"]),
|
||||
// How it's presented (095): EventPresent.tsx.
|
||||
bool("present_hide"),
|
||||
text("present_text"),
|
||||
bool("present_map_split"),
|
||||
bool("present_map_no_list"),
|
||||
bool("present_map_no_details"),
|
||||
enumeration("present_places", ["picked", "none"]),
|
||||
text("present_place_keys"),
|
||||
],
|
||||
children: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -69,6 +69,14 @@ export const events = {
|
|||
bool("in_timeline"),
|
||||
bool("show_contents"),
|
||||
text("links_heading"),
|
||||
// Its page presented (095).
|
||||
text("present_background"),
|
||||
text("present_background_color"),
|
||||
int("present_dim"),
|
||||
enumeration("present_frame", ["border", "none"]),
|
||||
text("present_accent"),
|
||||
text("present_text_color"),
|
||||
text("present_logo"),
|
||||
|
||||
// A repeating schedule. Columns rather than a side table: the
|
||||
// schedule is always exactly one per event, and the public view
|
||||
|
|
|
|||
56
server/src/migrations/095_presentation.sql
Normal file
56
server/src/migrations/095_presentation.sql
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
-- ═══════════════════════════════════════════════════════════════
|
||||
-- 095 PRESENTATION SETTINGS
|
||||
--
|
||||
-- How an event's page looks presented (EventPresent.tsx), set on
|
||||
-- the event; nothing here changes the page itself.
|
||||
--
|
||||
-- On events (v_events is SELECT e.*, so no rebuild):
|
||||
-- present_background an image behind every slide
|
||||
-- present_background_color the slides' background color; with an
|
||||
-- image, laid over it at present_dim
|
||||
-- present_dim percent of the color over the image,
|
||||
-- 0 to 90; null 60
|
||||
-- present_frame null the accent bar, title line and
|
||||
-- timer; 'border' an accent border around
|
||||
-- the slide; 'none' the slide alone
|
||||
-- present_accent in place of the event's color
|
||||
-- present_text_color the slides' text; null the background
|
||||
-- color's readable one, else the site's
|
||||
-- present_logo in the slide's bottom-right corner
|
||||
--
|
||||
-- On content blocks (any owner's; only an event's are presented):
|
||||
-- present_hide left out of the presentation
|
||||
-- present_text shown presented in place of its text,
|
||||
-- eg. a shorter heading
|
||||
-- present_map_split a map: a slide per map section (094)
|
||||
-- present_map_no_list a map: no locations list beside it
|
||||
-- present_map_no_details a map: no location detail lines
|
||||
-- present_places a map: which locations get a slide of
|
||||
-- their own; null every marked one,
|
||||
-- 'picked' present_place_keys, 'none'
|
||||
-- present_place_keys the venue's location_keys (088),
|
||||
-- comma-separated
|
||||
-- ═══════════════════════════════════════════════════════════════
|
||||
|
||||
ALTER TABLE events ADD COLUMN present_background TEXT;
|
||||
ALTER TABLE events ADD COLUMN present_background_color TEXT;
|
||||
ALTER TABLE events ADD COLUMN present_dim INTEGER
|
||||
CHECK (present_dim BETWEEN 0 AND 90);
|
||||
ALTER TABLE events ADD COLUMN present_frame TEXT
|
||||
CHECK (present_frame IN ('border', 'none'));
|
||||
ALTER TABLE events ADD COLUMN present_accent TEXT;
|
||||
ALTER TABLE events ADD COLUMN present_text_color TEXT;
|
||||
ALTER TABLE events ADD COLUMN present_logo TEXT;
|
||||
|
||||
ALTER TABLE content_blocks ADD COLUMN present_hide INTEGER NOT NULL DEFAULT 0
|
||||
CHECK (present_hide IN (0, 1));
|
||||
ALTER TABLE content_blocks ADD COLUMN present_text TEXT;
|
||||
ALTER TABLE content_blocks ADD COLUMN present_map_split INTEGER NOT NULL DEFAULT 0
|
||||
CHECK (present_map_split IN (0, 1));
|
||||
ALTER TABLE content_blocks ADD COLUMN present_map_no_list INTEGER NOT NULL DEFAULT 0
|
||||
CHECK (present_map_no_list IN (0, 1));
|
||||
ALTER TABLE content_blocks ADD COLUMN present_map_no_details INTEGER NOT NULL DEFAULT 0
|
||||
CHECK (present_map_no_details IN (0, 1));
|
||||
ALTER TABLE content_blocks ADD COLUMN present_places TEXT
|
||||
CHECK (present_places IN ('picked', 'none'));
|
||||
ALTER TABLE content_blocks ADD COLUMN present_place_keys TEXT;
|
||||
|
|
@ -595,6 +595,16 @@ content.get("/events/:id", (c) => {
|
|||
...shapeEvent(row, links, cards, hosts),
|
||||
show_contents: row.show_contents === 1,
|
||||
links_heading: row.links_heading,
|
||||
// Its page presented (095).
|
||||
present: {
|
||||
background: row.present_background,
|
||||
background_color: row.present_background_color,
|
||||
dim: row.present_dim,
|
||||
frame: row.present_frame,
|
||||
accent: row.present_accent,
|
||||
text_color: row.present_text_color,
|
||||
logo: row.present_logo,
|
||||
},
|
||||
blocks: body,
|
||||
people,
|
||||
awards,
|
||||
|
|
|
|||
|
|
@ -64,6 +64,20 @@ export function loadLinks(db, ownerKind, ids) {
|
|||
rather than no key, so the renderer never has to check.
|
||||
───────────────────────────────────────────────────────────── */
|
||||
|
||||
/* A block's presentation settings (095), or null with none set. */
|
||||
function presentOf(row) {
|
||||
const present = {
|
||||
hide: row.present_hide === 1,
|
||||
text: row.present_text,
|
||||
map_split: row.present_map_split === 1,
|
||||
map_no_list: row.present_map_no_list === 1,
|
||||
map_no_details: row.present_map_no_details === 1,
|
||||
places: row.present_places,
|
||||
place_keys: row.present_place_keys ? row.present_place_keys.split(",").filter(Boolean) : [],
|
||||
};
|
||||
return Object.values(present).some((value) => (Array.isArray(value) ? value.length : value)) ? present : null;
|
||||
}
|
||||
|
||||
export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
|
||||
const out = new Map();
|
||||
if (ids.length === 0) return out;
|
||||
|
|
@ -71,7 +85,9 @@ 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, list_style, org_kind
|
||||
word_motion, word_direction, word_seconds, list_style, org_kind,
|
||||
present_hide, present_text, present_map_split, present_map_no_list,
|
||||
present_map_no_details, present_places, present_place_keys
|
||||
FROM content_blocks
|
||||
WHERE owner_kind = ? AND slot IN (?, 'both') AND owner_id IN (${placeholders(ids.length)})
|
||||
ORDER BY owner_id, sort_order`,
|
||||
|
|
@ -99,6 +115,8 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
|
|||
words: row.word_motion || row.word_direction || row.word_seconds
|
||||
? { motion: row.word_motion, direction: row.word_direction, seconds: row.word_seconds }
|
||||
: null,
|
||||
// How it's presented (095), when anything is set.
|
||||
present: presentOf(row),
|
||||
items: [],
|
||||
};
|
||||
byId.set(row.id, block);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue