Replace the front page with an admin-driven home
The home page is rebuilt from scratch and configured from a new Front page tab in the admin, backed by migration 017 and served by GET /api/front-page. Hero: brand, photos (crossfading slideshow with progress and pause) or livestream (YouTube/Facebook/Vimeo embed with a LIVE badge), switched by hand. After it, bands the admin can reorder, retitle or hide: a countdown to the next event (series-aware), the National Retreats carousel, a numbers band (typed in or counted from the database), a horizontal rail of featured timeline entries, and a "Find your way in" pathfinder replacing the old connect section. The CRUD engine gains a `singleton` flag: the entity has one row, made by its migration, and create and delete are refused. The list screen opens that row and the editor drops the slug, back link and delete. shapeSeries moves to shape.js so /front-page can share it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b4b013209b
commit
6a69084de2
25 changed files with 2299 additions and 494 deletions
|
|
@ -47,7 +47,14 @@
|
|||
|
||||
import { Hono } from "hono";
|
||||
|
||||
import { asBool, loadBlocks, loadLinks, paragraphs, splitLinks } from "../shape.js";
|
||||
import {
|
||||
asBool,
|
||||
loadBlocks,
|
||||
loadLinks,
|
||||
paragraphs,
|
||||
shapeSeries,
|
||||
splitLinks,
|
||||
} from "../shape.js";
|
||||
|
||||
const content = new Hono();
|
||||
|
||||
|
|
@ -108,25 +115,6 @@ function shapeHost(row) {
|
|||
};
|
||||
}
|
||||
|
||||
/* The repeating schedule, or null for a one-off. Weekdays collapse
|
||||
from seven flags to a list of the ticked ones, Sunday first; an
|
||||
empty list means "starts_on's weekday", which the client resolves
|
||||
since it already holds starts_on. Occurrences are not sent — they
|
||||
are derived, and the client derives them against its own today. */
|
||||
const SERIES_WEEKDAYS = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
||||
|
||||
function shapeSeries(row) {
|
||||
if (!asBool(row.is_series)) return null;
|
||||
return {
|
||||
frequency: row.series_frequency,
|
||||
interval: row.series_interval,
|
||||
weekdays: SERIES_WEEKDAYS.filter((day) => asBool(row[`series_${day}`])),
|
||||
start_time: row.series_start_time,
|
||||
end_time: row.series_end_time,
|
||||
count: row.series_count,
|
||||
};
|
||||
}
|
||||
|
||||
function shapeEvent(row, links, cardBlocks, hosts = []) {
|
||||
const { actions, instagram } = splitLinks(links);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue