Blocks: Shown on the page, in the presentation, or both
- present_show (099) replaces present_hide: only on the page, or only in the presentation, kept off the page and its contents list - Blocks with the old Leave out ticked become Only on the page Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2282bee23c
commit
ae06cd2b4f
8 changed files with 52 additions and 14 deletions
|
|
@ -182,7 +182,8 @@ export const blocksChild = (ownerKind) => ({
|
|||
// 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"),
|
||||
// Where it shows (099): null both, the page or the presentation.
|
||||
enumeration("present_show", ["page", "presentation"]),
|
||||
text("present_text"),
|
||||
bool("present_map_split"),
|
||||
bool("present_map_no_list"),
|
||||
|
|
|
|||
20
server/src/migrations/099_present_show.sql
Normal file
20
server/src/migrations/099_present_show.sql
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
-- ═══════════════════════════════════════════════════════════════
|
||||
-- 099 WHERE A BLOCK SHOWS: THE PAGE, THE PRESENTATION OR BOTH
|
||||
--
|
||||
-- present_hide (095) could only leave a block out of the
|
||||
-- presentation. present_show says where it shows instead:
|
||||
--
|
||||
-- null the page and the presentation
|
||||
-- 'page' only on the page (was present_hide = 1)
|
||||
-- 'presentation' only in the presentation (EventPresent.tsx), eg.
|
||||
-- a slide's welcome line the page doesn't need
|
||||
--
|
||||
-- present_hide is copied over, then dropped.
|
||||
-- ═══════════════════════════════════════════════════════════════
|
||||
|
||||
ALTER TABLE content_blocks ADD COLUMN present_show TEXT
|
||||
CHECK (present_show IN ('page', 'presentation'));
|
||||
|
||||
UPDATE content_blocks SET present_show = 'page' WHERE present_hide = 1;
|
||||
|
||||
ALTER TABLE content_blocks DROP COLUMN present_hide;
|
||||
|
|
@ -67,7 +67,9 @@ export function loadLinks(db, ownerKind, ids) {
|
|||
/* A block's presentation settings (095), or null with none set. */
|
||||
function presentOf(row) {
|
||||
const present = {
|
||||
hide: row.present_hide === 1,
|
||||
// Where it shows (099).
|
||||
hide: row.present_show === "page",
|
||||
only: row.present_show === "presentation",
|
||||
text: row.present_text,
|
||||
map_split: row.present_map_split === 1,
|
||||
map_no_list: row.present_map_no_list === 1,
|
||||
|
|
@ -88,7 +90,7 @@ export function loadBlocks(db, ownerKind, ids, slot = "body", depth = 0) {
|
|||
.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,
|
||||
present_hide, present_text, present_map_split, present_map_no_list,
|
||||
present_show, present_text, present_map_split, present_map_no_list,
|
||||
present_map_no_details, present_places, present_place_keys,
|
||||
present_list_overview, present_list_items
|
||||
FROM content_blocks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue