Add a featured event as a hero option

Front page → Feature gains "Featured event" (migration 033): the
event's card beside the headline, with its photo or colour, dates or
schedule, place, tagline, action buttons and a link to its page,
under a "Featured event" badge, over either backdrop.

Front page → Featured event pins one. Blank uses the countdown's
event, and a pinned event that's over or unpublished falls back to
it, so the hero and the countdown never disagree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-27 20:58:37 -05:00
parent 29202f2eb1
commit d6477b6d30
7 changed files with 187 additions and 11 deletions

View file

@ -1218,6 +1218,7 @@ const frontPage = {
["none", "Nothing: No additional overlay"],
["livestream", "Livestream: the stream, with a LIVE badge"],
["video", "Featured video: click to play"],
["event", "Featured event: an event's card"],
],
blankLabel: "Default: nothing",
help: "Switch to Livestream when you go live, and back when you're done",
@ -1232,7 +1233,7 @@ const frontPage = {
],
},
{
legend: "Photos, livestream and video",
legend: "Photos, livestream, video and event",
fields: [
{
path: "slide_seconds",
@ -1256,6 +1257,15 @@ const frontPage = {
"/front-page/ or a link ending in .mp4 or .webm",
},
{ path: "video_title", label: "Video title", full: true, help: "Shown after \"Featured video\" above the headline" },
{
path: "hero_event_id",
label: "Featured event",
widget: "select",
optionsFrom: "events",
blankLabel: "Default: the countdown's event",
full: true,
help: "For the Featured event feature. A pinned event that's over falls back to the countdown's",
},
],
},
{

View file

@ -12,12 +12,13 @@
import { useRecord, type Resource } from './useRecord.ts'
import type { EventSeries } from './eventSeries.ts'
import type { Link } from './useContent.ts'
/** What fills the hero's background. */
export type HeroBackdrop = 'brand' | 'photos'
/** What sits beside the words, over the backdrop. */
export type HeroFeature = 'none' | 'livestream' | 'video'
export type HeroFeature = 'none' | 'livestream' | 'video' | 'event'
/** The CHECK list on front_page_sections.section. */
export type FrontPageSectionKey =
@ -51,6 +52,8 @@ export type Hero = {
livestream: { url: string; title?: string | null } | null
/** A link to embed or a video file; see videoSource in embeds.ts. */
video: { url: string; title?: string | null } | null
/** With the 'event' feature: the pinned event, else the countdown's. */
event: HeroEvent | null
}
export type FrontPageSection = {
@ -105,6 +108,14 @@ export type FeaturedCard = {
image: { file: string; kind: string } | null
}
/** The countdown's event plus what the hero's event card draws. */
export type HeroEvent = CountdownEvent & {
tagline?: string | null
card_image?: string | null
org_logo?: string | null
links: Link[]
}
export type FrontPage = {
hero: Hero
sections: FrontPageSection[]