People blocks and host teams
- A "People" content block: a team's members as people tiles, people
picked one by one as items (each with a title), or both.
content_blocks gains team_id (migration 054 rebuilds it for the
type CHECK); a picked person rides on the item's person_id.
- An organization host can name a team (any organization's) to show
in its place: event_hosts.team_id, carried by v_event_hosts. The
event page reads "Hosted by" the team, linked to its page.
- Admin fields can show on `when: { path, filled: true }`.
- The showcase post has a people block; the past showcase event is
hosted by the region shown as its team.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6f86a113e0
commit
7c7cdaac14
10 changed files with 228 additions and 11 deletions
|
|
@ -230,6 +230,11 @@ export const linksChild = {
|
|||
|
||||
The first row supplies the logo and color when the event sets
|
||||
neither, so the order here is data rather than a display choice.
|
||||
|
||||
An organization host can name a team (any organization's) to show
|
||||
in its place: the event page reads "Hosted by" that team, linked
|
||||
to its page, while the logo and color still come from the
|
||||
organization.
|
||||
A person supplies neither: there is no color on a person and a
|
||||
headshot is not a logo, so a person-hosted event with no color
|
||||
of its own falls through to the section default. */
|
||||
|
|
@ -259,6 +264,15 @@ export const hostsChild = {
|
|||
blankLabel: "Default: none",
|
||||
help: "Use if the host is an individual, choose between person and org host, not both.",
|
||||
},
|
||||
{
|
||||
path: "team_id",
|
||||
label: "Shown as team",
|
||||
widget: "select",
|
||||
optionsFrom: "teams",
|
||||
blankLabel: "Default: the organization",
|
||||
help: "Optional: a team to name as the host instead, eg. the retreat team. Any organization's team.",
|
||||
when: { path: "org_id", filled: true },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
@ -280,6 +294,7 @@ export const BLOCK_TYPES = [
|
|||
["schedule", "Schedule", "Entries in one tab per day, each folding out for more. The text is an optional intro."],
|
||||
["table", "Table", "A grid of text, eg. a comparison chart: one row per line, cells split by |, the first row the header."],
|
||||
["cards", "Link cards", "Cards with a picture, title and description, each a link to a page or a file, like a link shared in a chat; up to three in a row. Paste a link and press Fetch preview, or Choose a file."],
|
||||
["people", "People", "People tiles: a team's members, or people picked one by one as items (each with their title), or both."],
|
||||
["divider", "Divider", "A thin line between parts."],
|
||||
];
|
||||
|
||||
|
|
@ -288,6 +303,8 @@ export const SCHEDULE_ENTRY = { scope: "parent", path: "type", value: "schedule"
|
|||
/* Item fields for a link card, and for every other kind of item. */
|
||||
export const CARD_ITEM = { scope: "parent", path: "type", value: "cards" };
|
||||
export const NOT_CARD_ITEM = { scope: "parent", path: "type", value: ["list", "links", "schedule"] };
|
||||
/* An item that's a person on a people block. */
|
||||
export const PEOPLE_ITEM = { scope: "parent", path: "type", value: "people" };
|
||||
|
||||
export const blockTypeLabel = (type) => BLOCK_TYPES.find(([value]) => value === type)?.[1] ?? type;
|
||||
|
||||
|
|
@ -384,13 +401,22 @@ export const blocksChild = {
|
|||
when: { path: "type", value: "image" },
|
||||
help: "Describes the picture for someone who can't see it, eg. Campers around a fire at dusk",
|
||||
},
|
||||
{
|
||||
path: "team_id",
|
||||
label: "Team",
|
||||
widget: "select",
|
||||
optionsFrom: "teams",
|
||||
blankLabel: "Default: none, just the people below",
|
||||
help: "Shows the team's members as tiles, its leads first. People added as items show after it.",
|
||||
when: { path: "type", value: "people" },
|
||||
},
|
||||
],
|
||||
children: [
|
||||
{
|
||||
key: "items",
|
||||
label: "Items",
|
||||
addLabel: "Add item",
|
||||
when: { path: "type", value: ["list", "links", "schedule", "cards"] },
|
||||
when: { path: "type", value: ["list", "links", "schedule", "cards", "people"] },
|
||||
title: (row) => [row.day, row.time, row.text].filter(Boolean).join(" · ") || "New item",
|
||||
blank: { text: "" },
|
||||
fields: [
|
||||
|
|
@ -412,7 +438,16 @@ export const blocksChild = {
|
|||
help: "A page on this site (eg. /retreats), anywhere else, or a file (Choose a file). Fetch preview fills the title, description and picture from a page; a file fills its name and first-page picture.",
|
||||
when: CARD_ITEM,
|
||||
},
|
||||
{ path: "text", label: "Text", required: true, help: "Schedules: the entry's title. Cards: the card's title" },
|
||||
{
|
||||
path: "person_id",
|
||||
label: "Person",
|
||||
widget: "select",
|
||||
optionsFrom: "people",
|
||||
required: true,
|
||||
help: "Shown as a tile with their photo, linked to their page",
|
||||
when: PEOPLE_ITEM,
|
||||
},
|
||||
{ path: "text", label: "Text", required: true, help: "Schedules: the entry's title. Cards: the card's title. People: their title on the tile, eg. Speaker" },
|
||||
{
|
||||
path: "location",
|
||||
label: "Location",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue