Organizations block: the Partners page's cards, picked one by one or every one of a kind
Migration 093 adds the 'organizations' block type (rebuilding content_blocks for its CHECK, as 088 did), content_blocks.org_kind and content_block_items.org_id. OrgListCards takes `nested` for a block: no page gutter, names a level under the block's heading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e9ea75a68d
commit
bd271ef02d
8 changed files with 182 additions and 13 deletions
|
|
@ -311,6 +311,7 @@ export const BLOCK_TYPES = [
|
|||
["people", "People", "People tiles: a team's members, or people picked one by one as items (each with their title), or both."],
|
||||
["map", "Map", "A venue's map with its locations marked and listed beside it (Data → Venues). A schedule on the same page with the same venue links its locations here."],
|
||||
["events", "Events", "Event cards, eg. the workshops on offer: picture, type, date, title and card text, each linking to the event's page."],
|
||||
["organizations", "Organizations", "Organization cards, as on the Partners page: picked one by one as items, or every listed one of a kind."],
|
||||
["divider", "Divider", "A thin line between parts."],
|
||||
];
|
||||
|
||||
|
|
@ -340,6 +341,8 @@ export const NOT_CARD_ITEM = { scope: "parent", path: "type", value: ["list", "l
|
|||
export const PEOPLE_ITEM = { scope: "parent", path: "type", value: "people" };
|
||||
/* An item that's an event card on an events block (088). */
|
||||
export const EVENT_ITEM = { scope: "parent", path: "type", value: "events" };
|
||||
/* An item that's an organization on an organizations block (093). */
|
||||
export const ORG_ITEM = { scope: "parent", path: "type", value: "organizations" };
|
||||
|
||||
/* A venues option (the /admin/options query) as a Venue: its
|
||||
locations arrive as JSON. */
|
||||
|
|
@ -529,6 +532,20 @@ export const blocksChild = {
|
|||
when: { path: "type", value: TEXT_TYPES },
|
||||
help: (row) => TEXT_HELP[row?.type],
|
||||
},
|
||||
{
|
||||
path: "org_kind",
|
||||
label: "List",
|
||||
widget: "select",
|
||||
options: [
|
||||
["partner", "Partners"],
|
||||
["region", "Regions"],
|
||||
["group", "Groups"],
|
||||
["ministry", "Ministries"],
|
||||
],
|
||||
blankLabel: "Default: only the organizations picked below",
|
||||
help: "Every published, listed one of this kind, by name. Organizations picked as items replace this list.",
|
||||
when: { path: "type", value: "organizations" },
|
||||
},
|
||||
{
|
||||
path: "list_style",
|
||||
label: "Style",
|
||||
|
|
@ -637,7 +654,7 @@ export const blocksChild = {
|
|||
key: "items",
|
||||
label: "Items",
|
||||
addLabel: "Add item",
|
||||
when: { path: "type", value: ["list", "links", "schedule", "cards", "people", "events"] },
|
||||
when: { path: "type", value: ["list", "links", "schedule", "cards", "people", "events", "organizations"] },
|
||||
title: (row) => [row.day, row.time || row.start_time, row.text].filter(Boolean).join(" · ") || "New item",
|
||||
blank: { text: "" },
|
||||
fields: [
|
||||
|
|
@ -687,12 +704,22 @@ export const blocksChild = {
|
|||
help: "The event the card shows and links to. An unpublished one is left out.",
|
||||
when: EVENT_ITEM,
|
||||
},
|
||||
{
|
||||
path: "org_id",
|
||||
label: "Organization",
|
||||
widget: "select",
|
||||
optionsFrom: "organizations",
|
||||
fills: "text",
|
||||
required: true,
|
||||
help: "Shown as its card, in this order. An unpublished one is left out.",
|
||||
when: ORG_ITEM,
|
||||
},
|
||||
eventField(SCHEDULE_ENTRY),
|
||||
{
|
||||
path: "text",
|
||||
label: "Text",
|
||||
required: true,
|
||||
help: "Schedules: the entry's title. Cards: the card's title. Events: the title shown, filled from the event. People: their title on the tile, eg. Speaker",
|
||||
help: "Schedules: the entry's title. Cards: the card's title. Events: the title shown, filled from the event. People: their title on the tile, eg. Speaker. Organizations: filled from it, only the admin shows it",
|
||||
},
|
||||
placeField(SCHEDULE_ENTRY),
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ export type ContentBlock = {
|
|||
| 'people'
|
||||
| 'map'
|
||||
| 'events'
|
||||
| 'organizations'
|
||||
text?: string | null
|
||||
media?: string | null
|
||||
href?: string | null
|
||||
|
|
@ -56,6 +57,8 @@ export type ContentBlock = {
|
|||
cite?: string | null
|
||||
/** A list block's style (092): null bold text, 'plain' the old look. */
|
||||
list_style?: 'plain' | null
|
||||
/** An organizations block's kind, listed when none are picked (093). */
|
||||
org_kind?: 'region' | 'group' | 'partner' | 'ministry' | null
|
||||
/** A video block's WebVTT file, for an uploaded video (066). */
|
||||
captions?: string | null
|
||||
items?: ContentBlockItem[]
|
||||
|
|
@ -138,6 +141,8 @@ export type ContentBlockItem = {
|
|||
/** A featured event's heading and subheading (090). */
|
||||
heading?: string | null
|
||||
subheading?: string | null
|
||||
/** An organizations block's organization (093). */
|
||||
org_id?: string | null
|
||||
/** A block entry's sub-items. */
|
||||
items?: ContentBlockItem[]
|
||||
/** Its block's tags it has, by key (087). */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue