Let the front page countdown filter by event scope and type
Admin > Front page > Countdown gains two optional dropdowns, "Only this scope" and "Only this type", each defaulting to any. They narrow which event counts as "the next one": National + Retreat counts down to the next national retreat and skips a sooner regional class. A pinned event still wins over both. When nothing matches, the countdown band doesn't render, as before. Migration 026 adds front_page.countdown_scope_id, a foreign key to event_scopes (ON DELETE SET NULL, so removing a scope returns it to "any"), and countdown_event_type, checked against the same values as events.event_type. Adding an event type now widens both CHECKs; the note in eventTypes.ts and the guide say so. Also clears the older em-dashes from home.js and eventTypes.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
54bf649b8d
commit
68f08b633c
6 changed files with 83 additions and 11 deletions
|
|
@ -1063,9 +1063,31 @@ const frontPage = {
|
|||
label: "Count down to",
|
||||
widget: "select",
|
||||
optionsFrom: "events",
|
||||
blankLabel: "Default: the next upcoming event ",
|
||||
blankLabel: "Default: the next upcoming event",
|
||||
help: "Leave blank almost always. A pinned event that's over falls back to the next one",
|
||||
},
|
||||
{
|
||||
path: "countdown_scope_id",
|
||||
label: "Only this scope",
|
||||
widget: "select",
|
||||
optionsFrom: "event_scopes",
|
||||
blankLabel: "Default: any scope",
|
||||
help: "Narrows the next upcoming event. Ignored when an event is pinned above",
|
||||
},
|
||||
{
|
||||
path: "countdown_event_type",
|
||||
label: "Only this type",
|
||||
widget: "select",
|
||||
options: [
|
||||
["retreat", "Retreat"],
|
||||
["class", "Class"],
|
||||
["workshop", "Workshop"],
|
||||
["meeting", "Meeting"],
|
||||
["other", "Other"],
|
||||
],
|
||||
blankLabel: "Default: any type",
|
||||
help: "Combines with the scope: National + Retreat counts down to the next national retreat",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue