Page management, step 2: the core pages as sections

Migrations 081 and 082: Feedback, Request, QR codes, Give, Privacy and
Terms become pages of sections. Their forms and embeds are section types
any page can use; Give's words and all of Privacy and Terms become blocks.
The privacy contact email is written into the policy and its setting goes.
Core pages keep their address and can't be deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aidan Dona 2026-10-16 23:24:34 -05:00
parent 1342691f49
commit f33c0008fe
27 changed files with 298 additions and 645 deletions

View file

@ -62,7 +62,7 @@ In dev, Vite proxies `/api` to the target set in `vite.config.ts`, so the API mu
- All pages use `PageShell.tsx` as the wrapper unless explicitly noted otherwise. - All pages use `PageShell.tsx` as the wrapper unless explicitly noted otherwise.
- Pages live in `src/pages/`; section-level components go in `src/pages/sections/`. - Pages live in `src/pages/`; section-level components go in `src/pages/sections/`.
- `src/data/` holds only hardcoded data shared across multiple section files (e.g. `historyDecades.ts`, map grid). Everything else comes from SQLite, through hooks in `src/lib/`. - `src/data/` holds only hardcoded data shared across multiple section files (e.g. `historyDecades.ts`, map grid). Everything else comes from SQLite, through hooks in `src/lib/`.
- Pages are rows of `site_pages` (migration 080), edited in Pages → Page management: address, title, intro, Hidden (Not found below viewer) and Disabled (out of the menus, sitemap and search). New pages are made there and are pages of sections; `PageAtPath.tsx` (the `*` route) draws whatever page is at an address, and the few still drawn in code are listed in `src/pages/fixedPages.ts` (and `FIXED_PAGES` in `server/src/admin-schema/sitePages.js`, which can't be deleted). Record routes (`/events/:id`...) stay in `App.tsx`, and their first path segments are reserved. Menu links are Pages → Navigation (`site_nav_links`, `server/src/siteNav.js`, read through `src/lib/useSiteNav.ts`); `navConfig.ts` only holds the defaults the app starts from before that loads. - Pages are rows of `site_pages` (migration 080), edited in Pages → Page management: address, title, intro, Hidden (Not found below viewer) and Disabled (out of the menus, sitemap and search). Every page but the front page is a page of sections (forms and embeds are section types, `src/pages/sections/FormSections.tsx`), and new ones are made there; `PageAtPath.tsx` (the `*` route) draws whatever page is at an address. The pages the code links to (`CORE_PAGES` in `server/src/admin-schema/sitePages.js`: /give, /feedback, /request, /qr, /privacy, /terms) keep their address and can't be deleted. Record routes (`/events/:id`...) stay in `App.tsx`, and their first path segments are reserved. Menu links are Pages → Navigation (`site_nav_links`, `server/src/siteNav.js`, read through `src/lib/useSiteNav.ts`); `navConfig.ts` only holds the defaults the app starts from before that loads.
- `api.ts` is the shared caching client used by frontend data hooks. - `api.ts` is the shared caching client used by frontend data hooks.
- `docs/updating-data-in-code.md`: where content that isn't in the database lives (admin dropdown labels, fixed value lists, nav, banner, decades, map grid) and how to change it. Keep it current when adding a dropdown or code-owned content. - `docs/updating-data-in-code.md`: where content that isn't in the database lives (admin dropdown labels, fixed value lists, nav, banner, decades, map grid) and how to change it. Keep it current when adding a dropdown or code-owned content.
- Images: every record image (logos, photos, backgrounds, block images) is an upload, in a folder by use: `/uploads/logos/`, `/uploads/images/`, `/uploads/thumbnails/` (saved previews), `/uploads/captions/` (videos' .vtt files); a logo or icon image field sets `folder: "logos"` (`docs/media-uploads.md`, Folders). A bare filename resolves to `/uploads/<file>` (`src/lib/media.ts`, and `server/src/pageMeta.js` for previews). Only the site's own chosen assets, the NGU logos in the nav, footer and admin, are bundled from `src/assets/logos/`. Logo images hide themselves on load error (`onError`). - Images: every record image (logos, photos, backgrounds, block images) is an upload, in a folder by use: `/uploads/logos/`, `/uploads/images/`, `/uploads/thumbnails/` (saved previews), `/uploads/captions/` (videos' .vtt files); a logo or icon image field sets `folder: "logos"` (`docs/media-uploads.md`, Folders). A bare filename resolves to `/uploads/<file>` (`src/lib/media.ts`, and `server/src/pageMeta.js` for previews). Only the site's own chosen assets, the NGU logos in the nav, footer and admin, are bundled from `src/assets/logos/`. Logo images hide themselves on load error (`onError`).

View file

@ -78,7 +78,7 @@
## Page Editing ## Page Editing
- [ ] **Page management revamp**, in steps (answers from 2026-10-16: disabled means out of the menus, sitemap and search with the address still working; admins can make new pages; the front page, the Community blog's settings, the form and embed pages and Privacy/Terms all become pages of sections; section types like the hero, stats, featured cards, calendar and countdown can go on any page, each with its own content). - [ ] **Page management revamp**, in steps (answers from 2026-10-16: disabled means out of the menus, sitemap and search with the address still working; admins can make new pages; the front page, the Community blog's settings, the form and embed pages and Privacy/Terms all become pages of sections; section types like the hero, stats, featured cards, calendar and countdown can go on any page, each with its own content).
- [x] Step 1, the page registry (Done, below). - [x] Step 1, the page registry (Done, below).
- [ ] Step 2: Feedback, Request, Give, QR codes become pages of sections (a section type each for the form, the giving embed and the QR maker); Privacy and Terms become editable blocks (their data request form a section type). - [x] Step 2, the core pages as sections (Done, below).
- [ ] Step 3: section types with their own settings: the Community blog (its slots, pinned posts and feeds move into the section, so it can go on any page), then the front page's hero, countdown, retreats, calendar, stats, timeline, featured cards and connect, and the front page itself a page of sections. - [ ] Step 3: section types with their own settings: the Community blog (its slots, pinned posts and feeds move into the section, so it can go on any page), then the front page's hero, countdown, retreats, calendar, stats, timeline, featured cards and connect, and the front page itself a page of sections.
## Admin ## Admin
@ -123,7 +123,9 @@
# Part 2: Done # Part 2: Done
## Page management (branch `page-management`, on top of `page-features`, no PR yet; migration 080, back up the database before deploying) ## Page management (branch `page-management`, on top of `page-features`, no PR yet; migrations 080 to 082, back up the database before deploying)
- [x] **Core pages as sections** (migrations 081, 082): Feedback, Request, QR codes, Give, Privacy and Terms are pages of sections now, edited in Page management like any other. Their forms and embeds are section types any page can use (Website feedback form, Request form, Data request form, Giving button, QR code maker); Give's words, and all of Privacy and Terms, are blocks (headings, paragraphs, lists), with "Last updated" in the section's blurb. The privacy contact email was written into the policy's text and its Site settings field is gone. These pages keep their address (the site's code links to them) and can't be deleted. The privacy notice's link now goes to #cookies-and-browser-storage.
- [ ] Check in a browser: each of the six pages (reading width of Privacy and Terms, the giving modal opening), editing a Privacy paragraph, a Request form section put on another page.
- [x] **Page registry** (migration 080): every page of the site is a row in Pages → Page management (admins and up): its address, title, intro, Hidden (Not found below viewer) and Disabled (out of the menus, the sitemap and search; the address still works), and the order of its admin card. New pages are made there, as pages of sections at the address given (any address but the admin's, the API's, the records' and the account pages'). The admin home's Pages group opens with a Page management banner (New page, Menus), then a card per page. The six page editors (Retreats, Community...) are one editor now; site.json's `pages` and Navigation's page list moved into the registry and are gone. The fixed pages (Feedback, Request, Give, QR codes, Privacy, Terms, the front page) take their words from it too and can't be deleted. - [x] **Page registry** (migration 080): every page of the site is a row in Pages → Page management (admins and up): its address, title, intro, Hidden (Not found below viewer) and Disabled (out of the menus, the sitemap and search; the address still works), and the order of its admin card. New pages are made there, as pages of sections at the address given (any address but the admin's, the API's, the records' and the account pages'). The admin home's Pages group opens with a Page management banner (New page, Menus), then a card per page. The six page editors (Retreats, Community...) are one editor now; site.json's `pages` and Navigation's page list moved into the registry and are gone. The fixed pages (Feedback, Request, Give, QR codes, Privacy, Terms, the front page) take their words from it too and can't be deleted.
- [ ] Check in a browser: the admin home's banner and page cards, making a page (address, sections) and opening it, hiding and disabling one (menus, the page signed out), renaming Feedback, the Under page select in Navigation. - [ ] Check in a browser: the admin home's banner and page cards, making a page (address, sections) and opening it, hiding and disabling one (menus, the page signed out), renaming Feedback, the Under page select in Navigation.

View file

@ -291,7 +291,7 @@ The numbers band's "Number Source" dropdown works the same way:
| A page section's accent color | `BRAND` and `ACCENTS` in `src/lib/color.ts` | Pages pick from these (`accent: ACCENTS.green`); add a color there, not a hex in a page. Each is readable as text on white and the tints. | | A page section's accent color | `BRAND` and `ACCENTS` in `src/lib/color.ts` | Pages pick from these (`accent: ACCENTS.green`); add a color there, not a hex in a page. Each is readable as text on white and the tints. |
| The palette (the 16-color grid the theme is drawn from) | `PALETTE` in `src/lib/color.ts` | Four families, a column each. `PALETTE_LIGHT` / `PALETTE_DARK` are the fills things colored by data use (a person's initials tile, `paletteFill`); the page background's layers (how many circles, their sizes and parallax speeds) are `LAYERS` in `src/components/PageBackdrop.tsx` and its shades are in `PageBackdrop.css`; the admin home's two alternating group colors are `BLOCK_COLORS` in `src/pages/admin/AdminHome.tsx`. | | The palette (the 16-color grid the theme is drawn from) | `PALETTE` in `src/lib/color.ts` | Four families, a column each. `PALETTE_LIGHT` / `PALETTE_DARK` are the fills things colored by data use (a person's initials tile, `paletteFill`); the page background's layers (how many circles, their sizes and parallax speeds) are `LAYERS` in `src/components/PageBackdrop.tsx` and its shades are in `PageBackdrop.css`; the admin home's two alternating group colors are `BLOCK_COLORS` in `src/pages/admin/AdminHome.tsx`. |
| The accessibility panel's choices (bottom right of every public page) | `SETTINGS` in `src/components/AccessibilityPanel.tsx`; the color blind modes are `VISIONS` and `SWAPS` in `src/lib/color.ts` | Each choice is an attribute on `<html>` styled in `src/index.css`, and `index.html` sets it again before the first paint, so a new one goes in all three. A color blind mode replaces all three color families, teal, green and amber (`SWAPS`, picked by simulating each type: see the comment there), in code, in data colors as they load (`src/lib/api.ts`, never under /admin), in CSS (the `--pal-*` variables in `src/index.css`, which hold the same values as `SWAPS`: change both) and in the theme tokens drawn from them. A palette hex in a component or CSS file should be `var(--pal-<family>-<shade>)` (eg. `var(--pal-amber-2)`), or a color blind mode won't reach it. Reading mode is `src/components/ReaderView.tsx`, which reads the hidden page and writes out its headings, paragraphs, links and described pictures. A part it can't read well (a carousel, tabs, details behind a click, a map) draws its own text version when `useReadingMode()` (`src/lib/readingMode.ts`) is on: the hero, pathfinder, stats, history rail, event lists, calendar (the next six weeks), featured cards, org lists and groups map, history timeline, schedule, people tiles and video player; the countdown draws nothing. A new component with any of those should do the same. Something saved or sent (the newsletter's colors) is a stored hex, which is never swapped. | | The accessibility panel's choices (bottom right of every public page) | `SETTINGS` in `src/components/AccessibilityPanel.tsx`; the color blind modes are `VISIONS` and `SWAPS` in `src/lib/color.ts` | Each choice is an attribute on `<html>` styled in `src/index.css`, and `index.html` sets it again before the first paint, so a new one goes in all three. A color blind mode replaces all three color families, teal, green and amber (`SWAPS`, picked by simulating each type: see the comment there), in code, in data colors as they load (`src/lib/api.ts`, never under /admin), in CSS (the `--pal-*` variables in `src/index.css`, which hold the same values as `SWAPS`: change both) and in the theme tokens drawn from them. A palette hex in a component or CSS file should be `var(--pal-<family>-<shade>)` (eg. `var(--pal-amber-2)`), or a color blind mode won't reach it. Reading mode is `src/components/ReaderView.tsx`, which reads the hidden page and writes out its headings, paragraphs, links and described pictures. A part it can't read well (a carousel, tabs, details behind a click, a map) draws its own text version when `useReadingMode()` (`src/lib/readingMode.ts`) is on: the hero, pathfinder, stats, history rail, event lists, calendar (the next six weeks), featured cards, org lists and groups map, history timeline, schedule, people tiles and video player; the countdown draws nothing. A new component with any of those should do the same. Something saved or sent (the newsletter's colors) is a stored hex, which is never swapped. |
| Privacy Policy and Terms wording | `src/pages/Privacy.tsx`, `src/pages/Terms.tsx` | The `PARTS` list, and `LAST_UPDATED` whenever the wording changes. The Privacy page must stay true of the code: what the feedback form stores, what the browser keeps, which embeds wait for a click. | | Privacy Policy and Terms wording | the database (082) | Admin → Pages → Page management → Privacy Policy or Terms of Service: their sections' blocks, and the "Last updated" date in the section's blurb whenever the wording changes. The privacy contact email is in the policy's text. The Privacy page must stay true of the code: what the feedback form stores, what the browser keeps, which embeds wait for a click. |
| Event type labels and plurals (public site) | `src/lib/eventTypes.ts` | Also the order of the type filter chips. | | Event type labels and plurals (public site) | `src/lib/eventTypes.ts` | Also the order of the type filter chips. |
| Event and person role labels (public site) | `ROLE_LABEL` in `src/pages/EventDetail.tsx` and `src/pages/PersonDetail.tsx` | | | Event and person role labels (public site) | `ROLE_LABEL` in `src/pages/EventDetail.tsx` and `src/pages/PersonDetail.tsx` | |
| Organization kind labels ("Region", "Group") | the Kind options in `src/lib/adminSchema/organizations.ts` (admin) | | | Organization kind labels ("Region", "Group") | the Kind options in `src/lib/adminSchema/organizations.ts` (admin) | |

View file

@ -33,6 +33,12 @@ const sectionsChild = {
"events", "events",
"timeline", "timeline",
"people_directory", "people_directory",
// What used to be whole pages (081).
"feedback_form",
"request_form",
"data_request_form",
"giving",
"qr_maker",
]), ]),
text("scope_id"), text("scope_id"),
enumeration("event_type", ["retreat", "class", "workshop", "meeting", "other"]), enumeration("event_type", ["retreat", "class", "workshop", "meeting", "other"]),
@ -62,9 +68,10 @@ const sectionsChild = {
}; };
/* Pages the site draws in code (src/pages/fixedPages.ts): they can be /* Pages the site's own code links to (the footer's defaults, the
renamed, moved, hidden or disabled, never deleted. */ Request buttons, the privacy notice, Tools → QR codes): renamed,
export const FIXED_PAGES = ["home", "give", "feedback", "request", "qr", "privacy", "terms"]; hidden or disabled, but never moved or deleted. */
export const CORE_PAGES = { home: "/", give: "/give", feedback: "/feedback", request: "/request", qr: "/qr", privacy: "/privacy", terms: "/terms" };
/* Addresses a page can't take: the admin, the API, the uploads, the /* Addresses a page can't take: the admin, the API, the uploads, the
records' own pages and the account pages. */ records' own pages and the account pages. */
@ -81,7 +88,9 @@ function checkPage(db, id) {
if (first && RESERVED.includes(first)) { if (first && RESERVED.includes(first)) {
throw new HttpError(422, "Validation failed", { path: `/${first} belongs to another part of the site. Pick another address.` }); throw new HttpError(422, "Validation failed", { path: `/${first} belongs to another part of the site. Pick another address.` });
} }
if (id === "home" && page.path !== "/") throw new HttpError(422, "Validation failed", { path: "The front page stays at /." }); if (CORE_PAGES[id] && page.path !== CORE_PAGES[id]) {
throw new HttpError(422, "Validation failed", { path: `The site links to this page at ${CORE_PAGES[id]}, so its address stays.` });
}
if (id !== "home" && page.path === "/") throw new HttpError(422, "Validation failed", { path: "/ is the front page." }); if (id !== "home" && page.path === "/") throw new HttpError(422, "Validation failed", { path: "/ is the front page." });
} }
@ -93,7 +102,7 @@ export const pages = {
idColumn: "id", idColumn: "id",
idKind: "slug", idKind: "slug",
concurrency: "updated_at", concurrency: "updated_at",
undeletable: FIXED_PAGES, undeletable: Object.keys(CORE_PAGES),
list: { list: {
columns: ["title", "path", "is_hidden", "is_disabled", "updated_at"], columns: ["title", "path", "is_hidden", "is_disabled", "updated_at"],

View file

@ -30,7 +30,6 @@ export const siteSettings = {
text("favicon"), text("favicon"),
text("apple_touch_icon"), text("apple_touch_icon"),
enumeration("indexing", ["on", "off"]), enumeration("indexing", ["on", "off"]),
text("privacy_email"),
text("notify_emails"), text("notify_emails"),
text("access_group_viewer"), text("access_group_viewer"),
text("access_group_editor"), text("access_group_editor"),

View file

@ -0,0 +1,65 @@
-- ═══════════════════════════════════════════════════════════════
-- 081 SECTION TYPES
--
-- page_sections.preset takes the parts of the site that were whole
-- pages, so those pages become pages of sections like any other
-- (082 builds them):
--
-- feedback_form the website feedback form (Feedback)
-- request_form the request form (Request)
-- data_request_form the data request form (Privacy)
-- giving the Church Center giving button (Give)
-- qr_maker the QR code maker (QR codes)
--
-- and the front page's bands, to go on any page with content of
-- their own (they're offered once they're built): hero, countdown,
-- calendar, stats, featured_cards, connect.
--
-- The CHECK can't change in place, so the table is rebuilt.
-- ═══════════════════════════════════════════════════════════════
CREATE TABLE page_sections_new (
id INTEGER PRIMARY KEY AUTOINCREMENT,
page_id TEXT NOT NULL REFERENCES site_pages (id) ON DELETE CASCADE,
sort_order INTEGER NOT NULL DEFAULT 0,
anchor TEXT NOT NULL
CONSTRAINT "A section's URL ID can use only lowercase letters, numbers and hyphens, eg. leadership."
CHECK (anchor <> '' AND anchor NOT GLOB '*[^a-z0-9-]*'),
title TEXT NOT NULL
CONSTRAINT "A section title can be 30 characters at most (it's listed in the page's side nav)."
CHECK (length(title) <= 30),
blurb TEXT,
accent TEXT CHECK (accent IN ('teal', 'deep', 'green', 'amber')),
preset TEXT CHECK (preset IN ('community_blog', 'group_map', 'region_list', 'partner_list',
'events', 'timeline', 'people_directory',
'feedback_form', 'request_form', 'data_request_form', 'giving', 'qr_maker',
'hero', 'countdown', 'calendar', 'stats', 'featured_cards', 'connect')),
-- An events preset's filter and first view.
scope_id TEXT REFERENCES event_scopes (id) ON DELETE SET NULL,
event_type TEXT CHECK (event_type IN ('retreat', 'class', 'workshop', 'meeting', 'other')),
view TEXT CHECK (view IN ('carousel', 'grid', 'map')),
-- Organization cards (067): the kinds listed by themselves.
org_kinds TEXT CHECK (org_kinds IN ('partner', 'ministry', 'partner,ministry')),
UNIQUE (page_id, anchor)
) STRICT;
INSERT INTO page_sections_new
(id, page_id, sort_order, anchor, title, blurb, accent, preset, scope_id, event_type, view, org_kinds)
SELECT id, page_id, sort_order, anchor, title, blurb, accent, preset, scope_id, event_type, view, org_kinds
FROM page_sections;
-- page_section_orgs, page_section_tags and content_blocks' owner
-- trigger name page_sections; legacy mode leaves them alone through
-- the rename.
PRAGMA legacy_alter_table = ON;
DROP TABLE page_sections;
ALTER TABLE page_sections_new RENAME TO page_sections;
PRAGMA legacy_alter_table = OFF;
CREATE INDEX page_sections_page_idx ON page_sections (page_id, sort_order);
CREATE TRIGGER page_sections_cleanup
AFTER DELETE ON page_sections
BEGIN
DELETE FROM content_blocks WHERE owner_kind = 'page_section' AND owner_id = CAST(old.id AS TEXT);
END;

View file

@ -0,0 +1,98 @@
-- ═══════════════════════════════════════════════════════════════
-- 082 CORE PAGES AS SECTIONS
--
-- Feedback, Request, QR codes, Give, Privacy and Terms were drawn in
-- code; now each is a page of sections like any other, with what
-- it said put in as blocks, so it's edited in Page management:
--
-- Feedback a feedback_form section
-- Request a request_form section
-- QR codes a qr_maker section
-- Give a giving section: its two paragraphs, then the
-- Church Center button
-- Privacy the policy as heading, paragraph and list blocks,
-- then a data_request_form section
-- Terms the terms as blocks
--
-- The privacy contact email (Site settings) was written into the
-- policy's text by the page; it's written into the blocks now, and
-- the setting goes (this text is where it's changed from now on).
-- ═══════════════════════════════════════════════════════════════
INSERT INTO page_sections (page_id, sort_order, anchor, title, blurb, preset) VALUES ('feedback', 0, 'website', 'Website Feedback', 'Found a broken link, spotted something out of date, or want the site to do something it doesn''t? This form goes straight to the people who maintain it.', 'feedback_form');
INSERT INTO page_sections (page_id, sort_order, anchor, title, blurb, preset) VALUES ('request', 0, 'request', 'Send a request', 'Tell us what you''d like on the site, or what should change. Attach a Word document with the details and we''ll take it from there.', 'request_form');
INSERT INTO page_sections (page_id, sort_order, anchor, title, blurb, preset) VALUES ('qr', 0, 'make', 'Make a QR code', 'Pick a page from the main navigation, any event, organization, team, award, person or blog post, or type any link. Site pages always point at the live site. Choose what sits in the center and the colors; a warning shows if the code might not scan.', 'qr_maker');
INSERT INTO page_sections (page_id, sort_order, anchor, title, blurb, preset) VALUES ('give', 0, 'give', 'Give to NGU', 'Your giving funds scholarships, retreats, leadership development and the continued growth of the Next Generation of Unity leaders, teachers and community members.', 'giving');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'give' AND anchor = 'give'), 'body', 0, 'paragraph', 'Gifts are processed securely through Church Center. The form opens right here on the page and you can give once or set up a recurring gift, and you don''t need an account to do either.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'give' AND anchor = 'give'), 'body', 1, 'paragraph', 'If you would like to send a check, please email our Board Treasurer at [treasurer@nextgenerationofunity.org](mailto:treasurer@nextgenerationofunity.org) to get an address.');
INSERT INTO page_sections (page_id, sort_order, anchor, title, blurb, preset) VALUES ('privacy', 0, 'privacy', 'Privacy Policy', 'Last updated: October 3, 2026', NULL);
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 0, 'heading', 'In short');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 1, 'paragraph', 'We collect some information about the people who use this site and take part in Next Generation of Unity (NGU). We use it to run our programs and this website, we don''t sell it, and we don''t use advertising or tracking cookies.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 2, 'paragraph', 'If you want to see, correct or delete what we hold about you, ' || (CASE WHEN (SELECT privacy_email FROM site_settings WHERE id = 'site') IS NOT NULL THEN 'email [' || (SELECT privacy_email FROM site_settings WHERE id = 'site') || '](mailto:' || (SELECT privacy_email FROM site_settings WHERE id = 'site') || ') or use the ' ELSE 'use the ' END) || '[request form](#requests) below.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 3, 'heading', 'What we collect');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 4, 'paragraph', 'Depending on how you use the site and our programs:');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 5, 'list', NULL);
CREATE TEMP TABLE IF NOT EXISTS _list (id INTEGER);
DELETE FROM _list;
INSERT INTO _list (id) VALUES (last_insert_rowid());
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 0, '**Feedback and requests you send.** Your message, the page it''s about, and, if you give them, your name and email. With it we keep your browser''s description (its user agent) and a scrambled form of your IP address that can''t be turned back into the address; we use it only to spot abuse. Files you attach to a [request](/request) are kept with it.');
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 1, '**People on the site.** Leaders, speakers and volunteers can appear with a name, photo, role, short bio and public contact details. Staff may also keep private details, such as a birth date, private email, phone number or address, which are never shown on the site and can only be seen by our editors.');
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 2, '**Server records.** Like most websites, our server keeps short-lived logs of requests (the page asked for, the time, and the IP address that asked) to keep the site running and secure.');
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 3, '**Staff accounts.** For NGU staff and volunteers who sign in to edit the site: name, email, role, and a record of sign-ins. Passwords are stored only in a form that can''t be read back.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 6, 'heading', 'Young people');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 7, 'paragraph', 'We don''t show information about anyone under 18 on this site: no names, photos or details. If you believe something about a minor appears here, tell us and we''ll take it down.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 8, 'heading', 'How we use it');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 9, 'paragraph', 'To answer you, to run our retreats, groups and other programs, to keep this site accurate and working, and to keep it secure. We don''t sell or rent your information, and we don''t use it for advertising.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 10, 'heading', 'Artificial intelligence');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 11, 'paragraph', 'We used AI tools to help write this website''s code and build its structure. Those tools have no access to our database. Information you give us, and information we hold about the people in our community, is not given to AI systems, and isn''t used to train them.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 12, 'heading', 'Other services');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 13, 'paragraph', 'We try not to rely on other companies, but a few parts of the site are provided by them. When you use those parts, what you enter or do there goes to that company and is covered by its own privacy policy:');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 14, 'list', NULL);
CREATE TEMP TABLE IF NOT EXISTS _list (id INTEGER);
DELETE FROM _list;
INSERT INTO _list (id) VALUES (last_insert_rowid());
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 0, '**Giving** is handled by Church Center (Planning Center), at [ngu.churchcenteronline.com](https://ngu.churchcenteronline.com). Payment details go to them, not to us. Church Center''s script loads when you open our Giving page, and its giving form opens when you press Give; Church Center may use Google Analytics in that form, under its own privacy policy.');
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 1, '**Videos** come from YouTube, Facebook or Vimeo, and **maps** from Google Maps. Nothing from them loads until you press play or choose to show the map.');
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 2, '**Links** to social media, Substack and other sites take you to those sites, which follow their own rules.');
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 3, '**Staff sign-in** can use a Google account on our own domain.');
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 4, '**Files attached to requests** are stored in our Google Workspace (Google Drive), and our staff may be told of a new request by email through it.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 15, 'paragraph', 'This site runs on a server we rent and manage ourselves; your information is stored there, not with an outside website service, apart from request files as above.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 16, 'heading', 'Cookies and browser storage');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 17, 'paragraph', 'This site doesn''t use advertising or tracking cookies, and doesn''t use Google Analytics. To see which pages are read, we use [Plausible Analytics](https://plausible.io), which we host ourselves on our own server using its free, open-source [Community Edition](https://github.com/plausible/community-edition/): it sets no cookies, doesn''t follow you across sites, and keeps no personal information, only counts of visits to each page; nothing from it is shared or sold. The site also keeps a few small things in your own browser so it works the way you left it:');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 18, 'list', NULL);
CREATE TEMP TABLE IF NOT EXISTS _list (id INTEGER);
DELETE FROM _list;
INSERT INTO _list (id) VALUES (last_insert_rowid());
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 0, 'That you closed the announcement banner or the privacy notice.');
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 1, 'Whether you chose the light or dark look.');
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 2, 'Your accessibility choices: the dyslexia-friendly font, reading mode and color blind mode.');
INSERT INTO content_block_items (block_id, sort_order, text) VALUES ((SELECT id FROM _list), 3, 'For staff who sign in: a sign-in cookie that keeps you signed in, and a short-lived one used while signing in with Google.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 19, 'paragraph', 'None of these are shared with anyone. If you press play on a video or show a map, that service (YouTube, Facebook, Vimeo or Google) may set its own cookies from then on. You can clear all of this in your browser''s settings at any time.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 20, 'heading', 'Your choices');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 21, 'paragraph', 'You can ask to see the information we hold about you, to correct it, or to have it deleted. To do that, ' || (CASE WHEN (SELECT privacy_email FROM site_settings WHERE id = 'site') IS NOT NULL THEN 'email [' || (SELECT privacy_email FROM site_settings WHERE id = 'site') || '](mailto:' || (SELECT privacy_email FROM site_settings WHERE id = 'site') || ') or use the ' ELSE 'use the ' END) || '[request form](#requests) below. We may ask you to confirm it''s you before we change or delete anything, and we''ll tell you when it''s done. Some records we may need to keep, such as records of gifts that the law requires; if so, we''ll say which and why.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 22, 'heading', 'Changes to this policy');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'privacy' AND anchor = 'privacy'), 'body', 23, 'paragraph', 'If we change how we handle information, we''ll update this page and the date at the top. See also our [Terms of Service](/terms).');
INSERT INTO page_sections (page_id, sort_order, anchor, title, blurb, preset) VALUES ('privacy', 1, 'requests', 'Data requests', 'Ask to see, correct or delete the information we hold about you.', 'data_request_form');
INSERT INTO page_sections (page_id, sort_order, anchor, title, blurb, preset) VALUES ('terms', 0, 'terms', 'Terms of Service', 'Last updated: September 28, 2026', NULL);
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 0, 'heading', 'Using this site');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 1, 'paragraph', 'This website belongs to Next Generation of Unity (NGU). By using it you agree to these terms. If you don''t agree, please don''t use the site.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 2, 'paragraph', 'You''re welcome to read, share and link to anything here. Please don''t try to break or overload the site, get into parts of it you haven''t been given access to, or use it to break the law.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 3, 'heading', 'Our content');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 4, 'paragraph', 'The words, logos, photos and videos on this site belong to NGU or to the people who made them, and are used with permission. You can share them for personal and non-commercial use with credit to NGU. For anything else, including using our name or logo, ask us first.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 5, 'heading', 'What you send us');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 6, 'paragraph', 'When you send feedback or a request, you let us use it to answer you and to improve the site and our programs. Please don''t send anything unlawful, abusive, or someone else''s private information.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 7, 'heading', 'Programs, events and giving');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 8, 'paragraph', 'Dates, places and details of retreats and other events can change. The event''s organizers have the final word, and registering for an event may come with its own terms.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 9, 'paragraph', 'Gifts are made through Church Center (Planning Center), under its terms. Questions about a gift can come to us.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 10, 'heading', 'Other sites');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 11, 'paragraph', 'We link to and show videos, maps and posts from other sites. We don''t control them and aren''t responsible for what they say or do; their own terms and privacy policies apply.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 12, 'heading', 'Staff accounts');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 13, 'paragraph', 'Accounts for editing the site are for NGU staff and volunteers we''ve set up. Keep your password and sign-in to yourself. We can change or close an account at any time.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 14, 'heading', 'No guarantees');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 15, 'paragraph', 'We work to keep this site accurate and running, but it''s provided as it is, without guarantees that it will always be available, complete or free of mistakes. To the extent the law allows, NGU isn''t liable for losses that come from using it.');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 16, 'heading', 'Changes');
INSERT INTO content_blocks (owner_kind, owner_id, slot, sort_order, type, text) VALUES ('page_section', (SELECT CAST(id AS TEXT) FROM page_sections WHERE page_id = 'terms' AND anchor = 'terms'), 'body', 17, 'paragraph', 'We may update these terms; the date at the top says when they last changed. How we handle personal information is in our [Privacy Policy](/privacy), and you can reach us through the [feedback form](/feedback).');
DROP TABLE IF EXISTS _list;
ALTER TABLE site_settings DROP COLUMN privacy_email;

View file

@ -100,7 +100,6 @@ export function siteFor(db) {
...base.robots, ...base.robots,
index: row.indexing ? row.indexing === "on" : base.robots?.index !== false, index: row.indexing ? row.indexing === "on" : base.robots?.index !== false,
}, },
privacyEmail: row.privacy_email || base.privacyEmail || "",
// The admin's colors (theme.js): only #rrggbb values and fixed // The admin's colors (theme.js): only #rrggbb values and fixed
// text, so safe inside <style>. // text, so safe inside <style>.
themeCss: themeCss(db), themeCss: themeCss(db),
@ -114,7 +113,6 @@ export function siteFor(db) {
const forBrowser = (site, nav) => ({ const forBrowser = (site, nav) => ({
title: site.title, title: site.title,
pages: site.pages, pages: site.pages,
privacyEmail: site.privacyEmail,
requestFiles: driveReady(), requestFiles: driveReady(),
nav, nav,
}); });

View file

@ -2,7 +2,6 @@
"title": "Next Generation of Unity", "title": "Next Generation of Unity",
"url": "https://nextgenerationofunity.org", "url": "https://nextgenerationofunity.org",
"description": "", "description": "",
"privacyEmail": "",
"robots": { "robots": {
"index": true "index": true
}, },

View file

@ -49,8 +49,7 @@ const lazyPage = (load) =>
throw err throw err
}), }),
) )
// Every page at its address (Pages → Page management): its sections, // Every page at its address (Pages → Page management): its sections.
// or one of the few the site draws in code (fixedPages.ts).
const PageAtPath = lazyPage(() => import("./pages/PageAtPath.tsx")) const PageAtPath = lazyPage(() => import("./pages/PageAtPath.tsx"))
// Profile accounts (076): signing in, an invite's welcome, the profile. // Profile accounts (076): signing in, an invite's welcome, the profile.
const SignIn = lazyPage(() => import("./pages/SignIn.tsx")) const SignIn = lazyPage(() => import("./pages/SignIn.tsx"))

View file

@ -1,46 +0,0 @@
/* ═══════════════════════════════════════════════════════════════
LEGAL TEXT
The Privacy and Terms pages: a list of headed parts, each a few
paragraphs or a bullet list, in a readable column. The words live
in the page files; this only lays them out the same way.
═══════════════════════════════════════════════════════════════ */
import type { ReactNode } from 'react'
export type LegalPart = {
/** Anchor for linking to one part, eg. 'cookies'. */
id: string
heading: string
body: ReactNode[]
list?: ReactNode[]
/** After the list. */
after?: ReactNode[]
}
export default function LegalText({ parts }: { parts: LegalPart[] }) {
return (
<div className="mx-auto max-w-3xl space-y-10 px-6 leading-relaxed text-body">
{parts.map((part) => (
<section key={part.id} id={part.id}>
<h3 className="text-xl font-bold text-ink">{part.heading}</h3>
<div className="mt-3 space-y-3">
{part.body.map((paragraph, i) => (
<p key={i}>{paragraph}</p>
))}
{part.list && (
<ul className="list-disc space-y-2 pl-6">
{part.list.map((item, i) => (
<li key={i}>{item}</li>
))}
</ul>
)}
{part.after?.map((paragraph, i) => (
<p key={i}>{paragraph}</p>
))}
</div>
</section>
))}
</div>
)
}

View file

@ -48,7 +48,7 @@ export default function PrivacyNotice() {
<p> <p>
No tracking cookies here. Videos and maps come from YouTube, Facebook or Google only when you press No tracking cookies here. Videos and maps come from YouTube, Facebook or Google only when you press
play or show them, and those services may set their own cookies then.{' '} play or show them, and those services may set their own cookies then.{' '}
<Link to="/privacy#cookies" className="font-semibold text-link underline underline-offset-2"> <Link to="/privacy#cookies-and-browser-storage" className="font-semibold text-link underline underline-offset-2">
Privacy Policy Privacy Policy
</Link> </Link>
</p> </p>

View file

@ -233,7 +233,8 @@ const helpText = (field, row) => (typeof field.help === "function" ? field.help(
export function Field({ field, value, row, options, error, onChange, onPatch }: any) { export function Field({ field, value, row, options, error, onChange, onPatch }: any) {
const id = `f-${field.path.replace(/\./g, "-")}`; const id = `f-${field.path.replace(/\./g, "-")}`;
const widget = field.widget ?? "text"; const widget = field.widget ?? "text";
const locked = Boolean(field.readOnly); // readOnly may be a test of the row (a core page's address).
const locked = Boolean(typeof field.readOnly === "function" ? field.readOnly(row) : field.readOnly);
// The select's options, rebuilt only when their source changes // The select's options, rebuilt only when their source changes
// (or, with filterBy, the row they're filtered by), not on every // (or, with filterBy, the row they're filtered by), not on every

View file

@ -216,7 +216,7 @@ h1, h2, h3, h4, h5, h6 {
margin: 1.5cm; margin: 1.5cm;
} }
/* Church Center's giving modal (Giving.tsx) is a transparent iframe /* Church Center's giving modal (the giving section, FormSections.tsx) is a transparent iframe
over the whole page, drawn for light pages. On a dark page the over the whole page, drawn for light pages. On a dark page the
browser sees the iframe's scheme differ from ours and paints its browser sees the iframe's scheme differ from ours and paints its
background opaque, so the page behind goes solid white. Telling it background opaque, so the page behind goes solid white. Telling it

View file

@ -20,7 +20,12 @@ const PRESETS = {
partner_list: "Organization cards (partners, ministries)", partner_list: "Organization cards (partners, ministries)",
events: "Event carousel or grid", events: "Event carousel or grid",
timeline: "Timeline", timeline: "Timeline",
people_directory: "People directory (a tag's people)", people_directory: "People directory (tabs of people tags)",
feedback_form: "Website feedback form",
request_form: "Request form",
data_request_form: "Data request form (see, correct or delete)",
giving: "Giving button (Church Center)",
qr_maker: "QR code maker",
}; };
const ACCENT_OPTIONS = [ const ACCENT_OPTIONS = [
@ -166,10 +171,10 @@ const sectionsChild = (presets: string[]) => ({
const COMMUNITY = { path: "id", value: "community" }; const COMMUNITY = { path: "id", value: "community" };
const ALL_PRESETS = Object.keys(PRESETS); const ALL_PRESETS = Object.keys(PRESETS);
/* The pages the site draws in code (src/pages/fixedPages.ts, and the /* Pages the site's own code links to: their address stays
front page): no sections of their own yet. */ (server/src/admin-schema/sitePages.js, CORE_PAGES). */
export const FIXED_PAGE_IDS = ["home", "give", "feedback", "request", "qr", "privacy", "terms"]; const CORE_PAGE_IDS = ["home", "give", "feedback", "request", "qr", "privacy", "terms"];
const isFixed = (row) => FIXED_PAGE_IDS.includes(row?.id); const isHome = (row) => row?.id === "home";
const communityGroups = (groups) => groups.map((group) => ({ ...group, when: COMMUNITY })); const communityGroups = (groups) => groups.map((group) => ({ ...group, when: COMMUNITY }));
const communityChildren = (children) => children.map((child) => ({ ...child, when: COMMUNITY })); const communityChildren = (children) => children.map((child) => ({ ...child, when: COMMUNITY }));
@ -202,7 +207,11 @@ export const pages = {
path: "path", path: "path",
label: "Address", label: "Address",
required: true, required: true,
help: "Where it lives on the site, eg. /library. Lowercase letters, numbers, hyphens and /. Changing it breaks old links: update Navigation's too.", help: (row) =>
CORE_PAGE_IDS.includes(row?.id)
? "The site's own links point here, so this page's address stays."
: "Where it lives on the site, eg. /library. Lowercase letters, numbers, hyphens and /. Changing it breaks old links: update Navigation's too.",
readOnly: (row) => CORE_PAGE_IDS.includes(row?.id),
}, },
{ path: "description", label: "Intro", widget: "textarea", full: true, help: "The line under the title, and its description in search." }, { path: "description", label: "Intro", widget: "textarea", full: true, help: "The line under the title, and its description in search." },
{ {
@ -223,13 +232,7 @@ export const pages = {
{ {
legend: "Its content", legend: "Its content",
note: "The front page's content is edited in Pages → Front page: its hero, and the bands it shows.", note: "The front page's content is edited in Pages → Front page: its hero, and the bands it shows.",
when: { test: (row) => row?.id === "home" }, when: { test: isHome },
fields: [],
},
{
legend: "Its content",
note: "This page's content is built into the site (a form, an embed or set text), so it has no sections to edit here yet. Its title, intro, address and switches above are yours.",
when: { test: (row) => isFixed(row) && row?.id !== "home" },
fields: [], fields: [],
}, },
...communityGroups( ...communityGroups(
@ -257,7 +260,7 @@ export const pages = {
], ],
children: [ children: [
{ ...sectionsChild(ALL_PRESETS), when: { test: (row) => !isFixed(row) } }, { ...sectionsChild(ALL_PRESETS), when: { test: (row) => !isHome(row) } },
...communityChildren( ...communityChildren(
[ [
{ {

View file

@ -110,18 +110,6 @@ export const siteSettings = {
}, },
], ],
}, },
{
legend: "Privacy",
fields: [
{
path: "privacy_email",
label: "Privacy contact email",
help: `The Privacy page gives this for privacy questions and data requests, eg. privacy@nextgenerationofunity.org. ${
siteConfiguration.privacyEmail ? `Default: ${siteConfiguration.privacyEmail}` : "Default: none, the page offers its request form only"
}.`,
},
],
},
{ {
legend: "Access (Google groups)", legend: "Access (Google groups)",
note: "Anyone in one of these Workspace groups can sign in to the admin with Google; their account is made at first sign-in, with the highest role their groups give. Their role follows the groups (checked at sign-in, hourly, and by Panel → Re-sync now); out of every group, the account is disabled. Superadmins and accounts made with admin-cli aren't affected. Needs GOOGLE_DIRECTORY_AS on the server (docs/google-sign-in.md).", note: "Anyone in one of these Workspace groups can sign in to the admin with Google; their account is made at first sign-in, with the highest role their groups give. Their role follows the groups (checked at sign-in, hourly, and by Panel → Re-sync now); out of every group, the account is disabled. Superadmins and accounts made with admin-cli aren't affected. Needs GOOGLE_DIRECTORY_AS on the server (docs/google-sign-in.md).",

View file

@ -23,7 +23,7 @@
import siteConfiguration from '../../site.json' import siteConfiguration from '../../site.json'
type SiteText = { title?: string; privacyEmail?: string; requestFiles?: boolean } type SiteText = { title?: string; requestFiles?: boolean }
/* What the server wrote into the page, if it did. */ /* What the server wrote into the page, if it did. */
const fromServer: SiteText = const fromServer: SiteText =
@ -33,10 +33,6 @@ export const SITE_NAME: string = fromServer.title || siteConfiguration.title
export const SITE_ORIGIN: string = siteConfiguration.url export const SITE_ORIGIN: string = siteConfiguration.url
/** Where privacy questions and data requests go (Panel → Site
* settings, else site.json). Blank: the Privacy page's form only. */
export const PRIVACY_EMAIL: string = fromServer.privacyEmail ?? siteConfiguration.privacyEmail
/** Whether the Request form takes files (Google Drive is set up on /** Whether the Request form takes files (Google Drive is set up on
* the server). Unknown (the Vite dev server) offers them, and the * the server). Unknown (the Vite dev server) offers them, and the
* server says so if it can't. */ * server says so if it can't. */

View file

@ -1,46 +0,0 @@
import PageShell from "../components/PageShell.tsx";
import type { PageText } from "./fixedPages.ts";
import FeedbackForm from "./sections/FeedbackForm.tsx";
import { BRAND } from "../lib/color.ts"
/* ═══════════════════════════════════════════════════════════════
Feedback page.
Section ids match the nav hashes. Right now there's one:
#website. Add more entries to SECTIONS as the page grows,
program feedback, retreat surveys, etc.
The form itself lives in sections/FeedbackForm, including its
own type list, location picker, and the POST to /api/feedback.
This file only decides where it sits on the page.
═══════════════════════════════════════════════════════════════ */
const SECTIONS = [
{
id: "website",
title: "Website Feedback",
blurb:
"Found a broken link, spotted something out of date, or want the site to do something it doesn't? This form goes straight to the people who maintain it.",
accent: BRAND,
content: (
// Narrower than the usual max-w-6xl: full-width form fields
// are unpleasant to fill in.
<div className="mx-auto max-w-3xl px-6">
<FeedbackForm />
</div>
),
},
];
/* Its title and intro: its site_pages row (Pages → Page management). */
export default function Feedback({ page: PAGE }: { page: PageText }) {
return (
<PageShell
title={PAGE.title}
intro={PAGE.description ?? undefined}
sections={SECTIONS}
/>
);
}

View file

@ -1,95 +0,0 @@
import { useEffect } from "react";
import PageShell from "../components/PageShell.tsx";
import type { PageText } from "./fixedPages.ts";
import { BRAND } from "../lib/color.ts"
const GIVING_URL =
"https://ngu.churchcenteronline.com/giving?open-in-church-center-modal=true";
const MODAL_SCRIPT_SRC = "https://js.churchcenter.com/modal/v1";
function useChurchCenterModal() {
useEffect(() => {
if (document.querySelector(`script[src="${MODAL_SCRIPT_SRC}"]`)) return;
const script = document.createElement("script");
script.src = MODAL_SCRIPT_SRC;
script.async = true;
document.head.appendChild(script);
// Deliberately not removed on unmount: the script registers a
// document-level click handler, and tearing it down on every
// route change would mean re-fetching it on the way back.
}, []);
}
/* ═══════════════════════════════════════════════════════════════
GIVING SECTION
═══════════════════════════════════════════════════════════════ */
function GivingPanel() {
return (
<div className="max-w-2xl mx-auto px-6 text-center">
<p className="text-body leading-relaxed">
Gifts are processed securely through Church Center. The form opens
right here on the page and you can give once or set up a recurring
gift, and you don&rsquo;t need an account to do either.
</p>
<a
href={GIVING_URL}
className="
mt-8 inline-flex items-center justify-center
btn px-10 py-4
text-base font-semibold tracking-wide text-white
shadow-sm transition
hover:brightness-110 hover:shadow-md
focus-visible:outline-none focus-visible:ring-2
focus-visible:ring-offset-2
motion-reduce:transition-none
"
style={{ backgroundColor: BRAND, "--tw-ring-color": BRAND } as React.CSSProperties}
>
Give through Church Center
</a>
<p className="mt-4 text-sm text-muted">
If you would like to send a check, please email our Board Treasurer at{" "}
<a href="mailto:treasurer@nextgenerationofunity.org" className="text-link underline">
treasurer@nextgenerationofunity.org
</a>{" "}
to get an address.
</p>
</div>
);
}
/* ═══════════════════════════════════════════════════════════════
PAGE
═══════════════════════════════════════════════════════════════ */
/* Its title and intro: its site_pages row (Pages → Page management). */
export default function GivingPage({ page: PAGE }: { page: PageText }) {
useChurchCenterModal();
const sections = [
{
id: "give",
title: "Give to NGU",
blurb:
"Your giving funds scholarships, retreats, leadership development and the continued growth of the Next Generation of Unity leaders, teachers and community members.",
accent: BRAND,
content: <GivingPanel />,
},
];
return (
<PageShell
title={PAGE.title}
intro={PAGE.description ?? undefined}
sections={sections}
/>
);
}

View file

@ -2,16 +2,14 @@
PAGE AT PATH: any address the record routes don't take PAGE AT PATH: any address the record routes don't take
Pages → Page management decides what's where: the site_pages row Pages → Page management decides what's where: the site_pages row
at this path (useSiteNav) is drawn by its code when it's one of at this path (useSiteNav), drawn as its sections (SitePage). The
the fixed pages (fixedPages.ts), or as its sections (SitePage). front page is the index route of its own (Home.tsx). No page there
No page there (or a hidden one, below viewer, which isn't sent): (or a hidden one, below viewer, which isn't sent): Not found.
Not found.
═══════════════════════════════════════════════════════════════ */ ═══════════════════════════════════════════════════════════════ */
import { useLocation } from 'react-router-dom' import { useLocation } from 'react-router-dom'
import { useSiteNav } from '../lib/useSiteNav.ts' import { useSiteNav } from '../lib/useSiteNav.ts'
import { FIXED_PAGES } from './fixedPages.ts'
import NotFound from './NotFound.tsx' import NotFound from './NotFound.tsx'
import SitePage from './SitePage.tsx' import SitePage from './SitePage.tsx'
@ -24,8 +22,5 @@ export default function PageAtPath() {
const page = pageAt(pathname) const page = pageAt(pathname)
if (!page || page.path === '/') return <NotFound /> if (!page || page.path === '/') return <NotFound />
const Fixed = FIXED_PAGES[page.id]
if (Fixed) return <Fixed key={page.id} page={page} />
return <SitePage key={page.id} id={page.id} /> return <SitePage key={page.id} id={page.id} />
} }

View file

@ -1,215 +0,0 @@
import { Link } from "react-router-dom";
import LegalText, { type LegalPart } from "../components/LegalText.tsx";
import PageShell from "../components/PageShell.tsx";
import { DATA_REQUEST } from "../data/feedbackTypes.ts";
import { PRIVACY_EMAIL } from "../lib/site.ts";
import type { PageText } from "./fixedPages.ts";
import FeedbackForm from "./sections/FeedbackForm.tsx";
import { BRAND } from "../lib/color.ts"
/* ═══════════════════════════════════════════════════════════════
Privacy policy, cookie notice included.
What it says must stay true of the code: what the feedback and
request forms store (routes/feedback.js, routes/requests.js), what the browser keeps (Banner,
PrivacyNotice, the theme toggle), which embeds wait for a click
(VideoPlayer, HeroStage, ScheduleBlock), and that nothing about
a minor is shown. Change the date when the wording changes.
The contact address is Panel → Site settings → Privacy contact
email. Requests from the form below are feedback rows of type
'privacy', in Admin → Forms → Data requests.
═══════════════════════════════════════════════════════════════ */
const LAST_UPDATED = "October 3, 2026";
const link = "underline underline-offset-2 text-link";
const contact = PRIVACY_EMAIL ? (
<>
email <a className={link} href={`mailto:${PRIVACY_EMAIL}`}>{PRIVACY_EMAIL}</a> or use the{" "}
<a className={link} href="#requests">request form</a> below
</>
) : (
<>
use the <a className={link} href="#requests">request form</a> below
</>
);
const PARTS: LegalPart[] = [
{
id: "summary",
heading: "In short",
body: [
"We collect some information about the people who use this site and take part in Next Generation of Unity (NGU). We use it to run our programs and this website, we don't sell it, and we don't use advertising or tracking cookies.",
<>If you want to see, correct or delete what we hold about you, {contact}.</>,
],
},
{
id: "what-we-collect",
heading: "What we collect",
body: ["Depending on how you use the site and our programs:"],
list: [
<>
<strong>Feedback and requests you send.</strong> Your message, the page it's about, and, if you
give them, your name and email. With it we keep your browser's description (its user agent) and
a scrambled form of your IP address that can't be turned back into the address; we use it only to
spot abuse. Files you attach to a <Link to="/request" className={link}>request</Link> are kept with it.
</>,
<>
<strong>People on the site.</strong> Leaders, speakers and volunteers can appear with a name,
photo, role, short bio and public contact details. Staff may also keep private details, such as a
birth date, private email, phone number or address, which are never shown on the site and can
only be seen by our editors.
</>,
<>
<strong>Server records.</strong> Like most websites, our server keeps short-lived logs of
requests (the page asked for, the time, and the IP address that asked) to keep the site running
and secure.
</>,
<>
<strong>Staff accounts.</strong> For NGU staff and volunteers who sign in to edit the site: name,
email, role, and a record of sign-ins. Passwords are stored only in a form that can't be read back.
</>,
],
},
{
id: "minors",
heading: "Young people",
body: [
"We don't show information about anyone under 18 on this site: no names, photos or details. If you believe something about a minor appears here, tell us and we'll take it down.",
],
},
{
id: "how-we-use",
heading: "How we use it",
body: [
"To answer you, to run our retreats, groups and other programs, to keep this site accurate and working, and to keep it secure. We don't sell or rent your information, and we don't use it for advertising.",
],
},
{
id: "ai",
heading: "Artificial intelligence",
body: [
"We used AI tools to help write this website's code and build its structure. Those tools have no access to our database. Information you give us, and information we hold about the people in our community, is not given to AI systems, and isn't used to train them.",
],
},
{
id: "third-parties",
heading: "Other services",
body: [
"We try not to rely on other companies, but a few parts of the site are provided by them. When you use those parts, what you enter or do there goes to that company and is covered by its own privacy policy:",
],
list: [
<>
<strong>Giving</strong> is handled by Church Center (Planning Center), at{" "}
<a href="https://ngu.churchcenteronline.com" className="text-link underline underline-offset-2">
ngu.churchcenteronline.com
</a>
. Payment details go to them, not to us. Church Center's script loads when you open our Giving page,
and its giving form opens when you press Give; Church Center may use Google Analytics in that form,
under its own privacy policy.
</>,
<>
<strong>Videos</strong> come from YouTube, Facebook or Vimeo, and <strong>maps</strong> from Google
Maps. Nothing from them loads until you press play or choose to show the map.
</>,
<>
<strong>Links</strong> to social media, Substack and other sites take you to those sites, which
follow their own rules.
</>,
<>
<strong>Staff sign-in</strong> can use a Google account on our own domain.
</>,
<>
<strong>Files attached to requests</strong> are stored in our Google Workspace (Google Drive), and
our staff may be told of a new request by email through it.
</>,
],
after: [
"This site runs on a server we rent and manage ourselves; your information is stored there, not with an outside website service, apart from request files as above.",
],
},
{
id: "cookies",
heading: "Cookies and browser storage",
body: [
<>
This site doesn't use advertising or tracking cookies, and doesn't use Google Analytics. To see which
pages are read, we use{" "}
<a href="https://plausible.io" className="text-link underline underline-offset-2">
Plausible Analytics
</a>
, which we host ourselves on our own server using its free, open-source{" "}
<a
href="https://github.com/plausible/community-edition/"
className="text-link underline underline-offset-2"
>
Community Edition
</a>
: it sets no cookies, doesn't follow you across sites, and keeps no personal information, only counts
of visits to each page; nothing from it is shared or sold. The site also keeps a few small things in
your own browser so it works the way you left it:
</>,
],
list: [
"That you closed the announcement banner or the privacy notice.",
"Whether you chose the light or dark look.",
"Your accessibility choices: the dyslexia-friendly font, reading mode and color blind mode.",
"For staff who sign in: a sign-in cookie that keeps you signed in, and a short-lived one used while signing in with Google.",
],
after: [
"None of these are shared with anyone. If you press play on a video or show a map, that service (YouTube, Facebook, Vimeo or Google) may set its own cookies from then on. You can clear all of this in your browser's settings at any time.",
],
},
{
id: "your-rights",
heading: "Your choices",
body: [
<>
You can ask to see the information we hold about you, to correct it, or to have it deleted. To do
that, {contact}. We may ask you to confirm it's you before we change or delete anything, and we'll
tell you when it's done. Some records we may need to keep, such as records of gifts that the law
requires; if so, we'll say which and why.
</>,
],
},
{
id: "changes",
heading: "Changes to this policy",
body: [
<>
If we change how we handle information, we'll update this page and the date at the top. See also
our <Link className={link} to="/terms">Terms of Service</Link>.
</>,
],
},
];
const SECTIONS = [
{
id: "privacy",
title: "Privacy Policy",
blurb: `Last updated: ${LAST_UPDATED}`,
accent: BRAND,
content: <LegalText parts={PARTS} />,
},
{
id: "requests",
title: "Data requests",
blurb: "Ask to see, correct or delete the information we hold about you.",
accent: BRAND,
content: (
<div className="mx-auto max-w-3xl px-6">
<FeedbackForm fixedType={DATA_REQUEST.id} />
</div>
),
},
];
/* Its title and intro: its site_pages row (Pages → Page management). */
export default function PrivacyPage({ page: PAGE }: { page: PageText }) {
return <PageShell title={PAGE.title} intro={PAGE.description ?? undefined} sections={SECTIONS} />;
}

View file

@ -1,40 +0,0 @@
import PageShell from '../components/PageShell.tsx'
import type { PageText } from './fixedPages.ts'
import QrCodeMaker from './sections/QrCodeMaker.tsx'
import { BRAND } from '../lib/color.ts'
/* ═══════════════════════════════════════════════════════════════
QR CODES PAGE: /qr
A QR code for any page on the site, for flyers, slides and
signs. Unlisted: not in Pages → Navigation's links, so neither
the header nor the footer links here. It lists only published records, so there is
nothing on it a visitor couldn't already reach.
═══════════════════════════════════════════════════════════════ */
const SECTIONS = [
{
id: 'make',
title: 'Make a QR code',
blurb:
'Pick a page from the main navigation, any event, organization, team, award, person or blog post, or type any link. Site pages always point at the live site. Choose what sits in the center and the colors; a warning shows if the code might not scan.',
accent: BRAND,
content: (
<div className="mx-auto max-w-6xl px-6">
<QrCodeMaker />
</div>
),
},
]
/* Its title and intro: its site_pages row (Pages → Page management). */
export default function QrCodes({ page: PAGE }: { page: PageText }) {
return (
<PageShell
title={PAGE.title}
intro={PAGE.description ?? undefined}
sections={SECTIONS}
/>
)
}

View file

@ -1,31 +0,0 @@
import PageShell from "../components/PageShell.tsx";
import type { PageText } from "./fixedPages.ts";
import RequestForm from "./sections/RequestForm.tsx";
import { BRAND } from "../lib/color.ts";
/* ═══════════════════════════════════════════════════════════════
Request page: ask for something to be added to the site or
changed on it. The form (sections/RequestForm) reads ?type= to
start on one kind of request; requestLink() makes those links.
═══════════════════════════════════════════════════════════════ */
const SECTIONS = [
{
id: "request",
title: "Send a request",
blurb:
"Tell us what you'd like on the site, or what should change. Attach a Word document with the details and we'll take it from there.",
accent: BRAND,
content: (
<div className="mx-auto max-w-3xl px-6">
<RequestForm />
</div>
),
},
];
/* Its title and intro: its site_pages row (Pages → Page management). */
export default function Request({ page: PAGE }: { page: PageText }) {
return <PageShell title={PAGE.title} intro={PAGE.description ?? undefined} sections={SECTIONS} />;
}

View file

@ -32,6 +32,7 @@ import EventListCards, { EventCardsToggle } from './sections/EventList-Cards.tsx
import CommunityBlog from './sections/CommunityBlog.tsx' import CommunityBlog from './sections/CommunityBlog.tsx'
import HistoryTimeline from './sections/history/HistoryTimeline.tsx' import HistoryTimeline from './sections/history/HistoryTimeline.tsx'
import { DirectoryTabs, DIRECTORY_PREVIEW } from './sections/PeopleDirectory.tsx' import { DirectoryTabs, DIRECTORY_PREVIEW } from './sections/PeopleDirectory.tsx'
import { DataRequestSection, FeedbackSection, GivingSection, QrSection, RequestSection } from './sections/FormSections.tsx'
/* Year the program starts: decades ending before it get the /* Year the program starts: decades ending before it get the
pre-program look on the timeline. */ pre-program look on the timeline. */
@ -94,6 +95,12 @@ const PRESETS: Record<string, (section: SitePageSection) => Record<string, any>>
Component: DirectoryTabs, Component: DirectoryTabs,
props: { tags: section.tag_ids, limit: DIRECTORY_PREVIEW }, props: { tags: section.tag_ids, limit: DIRECTORY_PREVIEW },
}), }),
// What used to be whole pages (081): FormSections.tsx.
feedback_form: () => ({ Component: FeedbackSection }),
request_form: () => ({ Component: RequestSection }),
data_request_form: () => ({ Component: DataRequestSection }),
giving: () => ({ Component: GivingSection }),
qr_maker: () => ({ Component: QrSection }),
} }
export default function SitePage({ id }: { id: string }) { export default function SitePage({ id }: { id: string }) {

View file

@ -1,92 +0,0 @@
import { Link } from "react-router-dom";
import LegalText, { type LegalPart } from "../components/LegalText.tsx";
import PageShell from "../components/PageShell.tsx";
import type { PageText } from "./fixedPages.ts";
import { BRAND } from "../lib/color.ts"
/* Change the date when the wording changes. */
const LAST_UPDATED = "September 28, 2026";
const link = "underline underline-offset-2 text-link";
const PARTS: LegalPart[] = [
{
id: "using-the-site",
heading: "Using this site",
body: [
"This website belongs to Next Generation of Unity (NGU). By using it you agree to these terms. If you don't agree, please don't use the site.",
"You're welcome to read, share and link to anything here. Please don't try to break or overload the site, get into parts of it you haven't been given access to, or use it to break the law.",
],
},
{
id: "our-content",
heading: "Our content",
body: [
"The words, logos, photos and videos on this site belong to NGU or to the people who made them, and are used with permission. You can share them for personal and non-commercial use with credit to NGU. For anything else, including using our name or logo, ask us first.",
],
},
{
id: "what-you-send",
heading: "What you send us",
body: [
"When you send feedback or a request, you let us use it to answer you and to improve the site and our programs. Please don't send anything unlawful, abusive, or someone else's private information.",
],
},
{
id: "programs-and-giving",
heading: "Programs, events and giving",
body: [
"Dates, places and details of retreats and other events can change. The event's organizers have the final word, and registering for an event may come with its own terms.",
"Gifts are made through Church Center (Planning Center), under its terms. Questions about a gift can come to us.",
],
},
{
id: "other-sites",
heading: "Other sites",
body: [
"We link to and show videos, maps and posts from other sites. We don't control them and aren't responsible for what they say or do; their own terms and privacy policies apply.",
],
},
{
id: "staff-accounts",
heading: "Staff accounts",
body: [
"Accounts for editing the site are for NGU staff and volunteers we've set up. Keep your password and sign-in to yourself. We can change or close an account at any time.",
],
},
{
id: "no-guarantees",
heading: "No guarantees",
body: [
"We work to keep this site accurate and running, but it's provided as it is, without guarantees that it will always be available, complete or free of mistakes. To the extent the law allows, NGU isn't liable for losses that come from using it.",
],
},
{
id: "changes",
heading: "Changes",
body: [
<>
We may update these terms; the date at the top says when they last changed. How we handle personal
information is in our <Link className={link} to="/privacy">Privacy Policy</Link>, and you can reach
us through the <Link className={link} to="/feedback">feedback form</Link>.
</>,
],
},
];
const SECTIONS = [
{
id: "terms",
title: "Terms of Service",
blurb: `Last updated: ${LAST_UPDATED}`,
accent: BRAND,
content: <LegalText parts={PARTS} />,
},
];
/* Its title and intro: its site_pages row (Pages → Page management). */
export default function TermsPage({ page: PAGE }: { page: PageText }) {
return <PageShell title={PAGE.title} intro={PAGE.description ?? undefined} sections={SECTIONS} />;
}

View file

@ -1,23 +0,0 @@
/* ═══════════════════════════════════════════════════════════════
FIXED PAGES
The pages the site still draws in code, by their site_pages id
(Pages → Page management can rename, move, hide or disable them,
not delete them: server/src/admin-schema/sitePages.js,
FIXED_PAGES). Every other page is its sections (SitePage.tsx).
Each takes its title and intro from its row. The front page is
the index route of its own (Home.tsx).
═══════════════════════════════════════════════════════════════ */
import { lazy, type ComponentType } from 'react'
export type PageText = { title: string; description: string | null }
export const FIXED_PAGES: Record<string, ComponentType<{ page: PageText }>> = {
give: lazy(() => import('./Giving.tsx')),
feedback: lazy(() => import('./Feedback.tsx')),
request: lazy(() => import('./Request.tsx')),
qr: lazy(() => import('./QrCodes.tsx')),
privacy: lazy(() => import('./Privacy.tsx')),
terms: lazy(() => import('./Terms.tsx')),
}

View file

@ -0,0 +1,82 @@
/* ═══════════════════════════════════════════════════════════════
FORM AND EMBED SECTIONS
Section types (page_sections.preset, 081) for what used to be
whole pages, so any page can have them: SitePage.tsx draws them
under a section's blocks.
feedback_form the website feedback form
request_form the request form (reads ?type=)
data_request_form a request to see, correct or delete data
giving the Church Center giving button
qr_maker the QR code maker
═══════════════════════════════════════════════════════════════ */
import { useEffect } from 'react'
import FeedbackForm from './FeedbackForm.tsx'
import RequestForm from './RequestForm.tsx'
import QrCodeMaker from './QrCodeMaker.tsx'
import { DATA_REQUEST } from '../../data/feedbackTypes.ts'
import { BRAND } from '../../lib/color.ts'
/* A form reads best narrower than the page. */
const Narrow = ({ children }: { children: React.ReactNode }) => <div className="mx-auto max-w-3xl px-6">{children}</div>
export const FeedbackSection = () => (
<Narrow>
<FeedbackForm />
</Narrow>
)
export const RequestSection = () => (
<Narrow>
<RequestForm />
</Narrow>
)
export const DataRequestSection = () => (
<Narrow>
<FeedbackForm fixedType={DATA_REQUEST.id} />
</Narrow>
)
export const QrSection = () => (
<div className="mx-auto max-w-6xl px-6">
<QrCodeMaker />
</div>
)
/* Giving: Church Center's modal script, loaded with the section, and
the button that opens its form on the page. The words around it
are the section's blocks. */
const GIVING_URL = 'https://ngu.churchcenteronline.com/giving?open-in-church-center-modal=true'
const MODAL_SCRIPT_SRC = 'https://js.churchcenter.com/modal/v1'
function useChurchCenterModal() {
useEffect(() => {
if (document.querySelector(`script[src="${MODAL_SCRIPT_SRC}"]`)) return
const script = document.createElement('script')
script.src = MODAL_SCRIPT_SRC
script.async = true
document.head.appendChild(script)
// Deliberately not removed on unmount: the script registers a
// document-level click handler, and tearing it down on every
// route change would mean fetching it again on the way back.
}, [])
}
export function GivingSection() {
useChurchCenterModal()
return (
<div className="mx-auto max-w-2xl px-6 text-center">
<a
href={GIVING_URL}
className="inline-flex items-center justify-center btn px-10 py-4 text-base font-semibold tracking-wide text-white shadow-sm transition hover:brightness-110 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 motion-reduce:transition-none"
style={{ backgroundColor: BRAND, '--tw-ring-color': BRAND } as React.CSSProperties}
>
Give through Church Center
</a>
</div>
)
}