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
|
|
@ -89,12 +89,15 @@ export default function ContentBlocks({
|
|||
anchorPrefix?: string
|
||||
}) {
|
||||
const presenting = usePresenting()
|
||||
// Presented, a block set to is left out and the rest take their
|
||||
// Presentation text (095).
|
||||
if (presenting && blocks) {
|
||||
blocks = blocks
|
||||
.filter((block) => !block.present?.hide)
|
||||
.map((block) => (block.present?.text ? { ...block, text: block.present.text } : block))
|
||||
// Presented, a block shown only on the page is left out and the
|
||||
// rest take their Presentation text (095, 099); on the page, a block
|
||||
// shown only in the presentation is.
|
||||
if (blocks) {
|
||||
blocks = presenting
|
||||
? blocks
|
||||
.filter((block) => !block.present?.hide)
|
||||
.map((block) => (block.present?.text ? { ...block, text: block.present.text } : block))
|
||||
: blocks.filter((block) => !block.present?.only)
|
||||
}
|
||||
if (!blocks?.length) return null
|
||||
// Headings get ids so a post's contents (PostContents) and a shared
|
||||
|
|
|
|||
|
|
@ -497,10 +497,15 @@ const SUB_ITEM_FIELDS = [
|
|||
/* An event's blocks' presentation fields (095), EventPresent.tsx. */
|
||||
export const PRESENT_BLOCK_FIELDS = [
|
||||
{
|
||||
path: "present_hide",
|
||||
label: "Leave out of the presentation",
|
||||
widget: "checkbox",
|
||||
help: "The page still shows it.",
|
||||
path: "present_show",
|
||||
label: "Shown",
|
||||
widget: "select",
|
||||
options: [
|
||||
["page", "Only on the page"],
|
||||
["presentation", "Only in the presentation"],
|
||||
],
|
||||
blankLabel: "Default: on the page and in the presentation",
|
||||
help: "Only in the presentation keeps it off the page, eg. a welcome line for the screen.",
|
||||
},
|
||||
{
|
||||
path: "present_text",
|
||||
|
|
|
|||
|
|
@ -76,7 +76,10 @@ export type ContentBlock = {
|
|||
|
||||
/** A block's presentation settings (095), EventPresent.tsx. */
|
||||
export type BlockPresent = {
|
||||
/** Only on the page: left out of the presentation (099). */
|
||||
hide: boolean
|
||||
/** Only in the presentation: left off the page (099). */
|
||||
only: boolean
|
||||
/** In place of its text, eg. a shorter heading. */
|
||||
text: string | null
|
||||
/** A map: a slide per map section. */
|
||||
|
|
|
|||
|
|
@ -92,7 +92,10 @@ export default function EventDetail() {
|
|||
const accent = event.color || BRAND
|
||||
const groups = peopleGroups(event.people, accent)
|
||||
// Two headings or more make a list worth showing, as on a post.
|
||||
const contents = event.show_contents ? headingAnchors(event.blocks).entries : []
|
||||
// Not a heading shown only in the presentation (099).
|
||||
const contents = event.show_contents
|
||||
? headingAnchors(event.blocks.filter((block) => !block.present?.only)).entries
|
||||
: []
|
||||
const withContents = contents.length >= 2
|
||||
|
||||
const sections: ShellSection[] = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue