Your wording pass on adminSchema.ts and fields.tsx: "Default: ..."
blank options, "eg." examples, "URL ID" for slugs, and relabelled
front page sections, stat sources and hero fields.
On top of it:
- Content block row titles end with an ellipsis when the paragraph
is cut. preview() in src/lib/text.ts does it for anything that
shortens text: it collapses whitespace, cuts on a word and adds
"..." only when it actually shortened.
- No em-dashes in the editor, front end or server: placeholders
("Internal note: ..."), the Organizations blurb, the URL ID help,
empty table cells (now "-"), the Award dropdown ("Torch Award
(NGU)" in OPTION_QUERIES), a boot error message, and every comment
in the admin files. Also cleared from the files added this branch
(QR page, directory route, embeds, hero, migration 024), and the
QR page's team labels read "Board (NGU)".
- A few comments where removing the dash had run two sentences
together get a comma, colon or parentheses back.
- docs/updating-data-in-code.md matches the new labels and gains a
"Writing text in the editor" section with these conventions;
CLAUDE.md lists them under Rules and gotchas.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
79 lines
3.2 KiB
SQL
79 lines
3.2 KiB
SQL
-- ═══════════════════════════════════════════════════════════════
|
|
-- 024 FRONT PAGE: FEATURED VIDEO
|
|
--
|
|
-- A fourth hero mode, 'video': a recorded video beside the words,
|
|
-- the way 'livestream' puts a stream there, but without the LIVE
|
|
-- badge and without autoplay: a visitor presses play.
|
|
--
|
|
-- Its own two columns rather than reusing the livestream's, so a
|
|
-- featured video and a stream can both be set up ahead of time and
|
|
-- the mode switches between them, as photos and livestream already
|
|
-- can.
|
|
--
|
|
-- video_url a YouTube, Vimeo or Facebook link (turned into an
|
|
-- embed), or a video file: a filename in
|
|
-- public/front-page/, a /path, or an https URL ending
|
|
-- in .mp4, .webm, .m4v, .mov or .ogv, which plays in
|
|
-- the browser's own player
|
|
-- video_title shown after "Featured video" above the headline
|
|
--
|
|
-- hero_mode's CHECK can't be altered in place, so front_page is
|
|
-- rebuilt. Its children (slides, sections, stats, paths) reference
|
|
-- it by name; the runner has foreign keys off, so the DROP leaves
|
|
-- them alone and the rename puts front_page back underneath them.
|
|
-- No view or other table's trigger names front_page, so the rename
|
|
-- needs no legacy_alter_table. front_page_touch goes with the old
|
|
-- table and is recreated last.
|
|
--
|
|
-- PRAGMA user_version; -- reads 23 before this file
|
|
-- ═══════════════════════════════════════════════════════════════
|
|
|
|
CREATE TABLE front_page_new (
|
|
id TEXT PRIMARY KEY CHECK (id = 'home'),
|
|
|
|
hero_mode TEXT NOT NULL DEFAULT 'brand'
|
|
CHECK (hero_mode IN ('brand', 'photos', 'livestream', 'video')),
|
|
eyebrow TEXT,
|
|
headline TEXT NOT NULL DEFAULT 'Next Generation of Unity',
|
|
subhead TEXT,
|
|
primary_label TEXT,
|
|
primary_url TEXT,
|
|
secondary_label TEXT,
|
|
secondary_url TEXT,
|
|
|
|
slide_seconds INTEGER NOT NULL DEFAULT 7
|
|
CHECK (slide_seconds BETWEEN 3 AND 60),
|
|
|
|
livestream_url TEXT,
|
|
livestream_title TEXT,
|
|
|
|
video_url TEXT,
|
|
video_title TEXT,
|
|
|
|
countdown_event_id TEXT REFERENCES events (id) ON DELETE SET NULL,
|
|
|
|
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
) STRICT;
|
|
|
|
INSERT INTO front_page_new
|
|
(id, hero_mode, eyebrow, headline, subhead,
|
|
primary_label, primary_url, secondary_label, secondary_url,
|
|
slide_seconds, livestream_url, livestream_title,
|
|
countdown_event_id, updated_at)
|
|
SELECT
|
|
id, hero_mode, eyebrow, headline, subhead,
|
|
primary_label, primary_url, secondary_label, secondary_url,
|
|
slide_seconds, livestream_url, livestream_title,
|
|
countdown_event_id, updated_at
|
|
FROM front_page;
|
|
|
|
DROP TABLE front_page;
|
|
|
|
ALTER TABLE front_page_new RENAME TO front_page;
|
|
|
|
CREATE TRIGGER front_page_touch
|
|
AFTER UPDATE ON front_page
|
|
FOR EACH ROW WHEN new.updated_at = old.updated_at
|
|
BEGIN
|
|
UPDATE front_page SET updated_at = datetime('now') WHERE id = new.id;
|
|
END;
|