diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md index bd861f7..7e99a0e 100644 --- a/docs/updating-data-in-code.md +++ b/docs/updating-data-in-code.md @@ -33,7 +33,7 @@ what a dropdown in the admin editor says. | The **label** a dropdown shows in the admin | code | [one file](#renaming-what-a-dropdown-shows) | | The **list of allowed values** behind a fixed dropdown | database CHECK + code | [a migration and three files](#adding-removing-or-renaming-a-stored-value) | | Navigation, page section titles, colours, the site banner, history decades, the map grid | code | [the file named below](#other-content-that-lives-in-code) | -| A static page's title and intro (also its search title and description), the site's name, description, preview image, icons, search indexing | the database, over `site.json` | Admin → Panel → Site settings (superadmins). Blank uses `site.json`, which also holds the site's address and the pages' defaults. See `docs/seo.md` | +| A static page's title and intro (also its search title and description), the site's name, description, preview image, icons, search indexing, privacy contact email | the database, over `site.json` | Admin → Panel → Site settings (superadmins). Blank uses `site.json`, which also holds the site's address and the pages' defaults. See `docs/seo.md` | | Uploaded images | disk + the `media` table | Admin → Tools → Media, or any image field. See `docs/media-uploads.md` | The rule of thumb from `CLAUDE.md`: data belongs in the database, @@ -273,7 +273,8 @@ The numbers band's "Number Source" dropdown works the same way: | Site-wide announcement banner | `src/data/bannerConfig.ts` | `enabled: false` hides it. Bump `id` when the message changes, so people who dismissed the old one see the new one. | | History page decade headers | `src/data/historyDecades.ts` | Title, tagline and blurb per decade. | | Chapter map tiles and area names | `src/data/mapGrid.ts` | `AREAS` (tile positions) and `AREA_NAMES`. Which region paints which tile is in the database (Admin → Data → Organizations → a region → Map areas). | -| Feedback form types | `src/data/feedbackTypes.ts` **and** `TYPES` in `server/src/routes/feedback.js` | Keep the ids identical in both; the server stores unknown ids as `general`. Labels and hints are client-only. | +| Feedback form types | `src/data/feedbackTypes.ts` **and** `TYPES` in `server/src/routes/feedback.js` | Keep the ids identical in both; the server stores unknown ids as `general`. Labels and hints are client-only. `DATA_REQUEST` ('privacy') isn't a tile: the Privacy page's form sends it, and the server requires an email for it. | +| 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. | | 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` | | | Organization kind labels ("Region", "Chapter") | `ORG_KIND_LABEL` in `src/lib/hrefs.ts` | | diff --git a/server/src/admin-schema.js b/server/src/admin-schema.js index 18ec7ab..72935f7 100644 --- a/server/src/admin-schema.js +++ b/server/src/admin-schema.js @@ -935,6 +935,7 @@ const siteSettings = { text("favicon"), text("apple_touch_icon"), enumeration("indexing", ["on", "off"]), + text("privacy_email"), ], children: [ diff --git a/server/src/migrations/039_privacy_contact.sql b/server/src/migrations/039_privacy_contact.sql new file mode 100644 index 0000000..4e37428 --- /dev/null +++ b/server/src/migrations/039_privacy_contact.sql @@ -0,0 +1,11 @@ +-- ═══════════════════════════════════════════════════════════════ +-- 039 PRIVACY CONTACT +-- +-- The address the Privacy page gives for privacy questions and data +-- requests (Panel → Site settings). Null falls back to site.json's +-- privacyEmail; blank in both, the page points to its request form +-- only. Data requests themselves are feedback rows of type +-- 'privacy' (routes/feedback.js), triaged in Admin → Feedback. +-- ═══════════════════════════════════════════════════════════════ + +ALTER TABLE site_settings ADD COLUMN privacy_email TEXT; diff --git a/server/src/pageMeta.js b/server/src/pageMeta.js index 5eb85ba..d0a21c8 100644 --- a/server/src/pageMeta.js +++ b/server/src/pageMeta.js @@ -102,12 +102,13 @@ export function siteFor(db) { ...base.robots, index: row.indexing ? row.indexing === "on" : base.robots?.index !== false, }, + privacyEmail: row.privacy_email || base.privacyEmail || "", pages, }; } /* What the browser app reads for headings and titles. */ -const forBrowser = (site) => ({ title: site.title, pages: site.pages }); +const forBrowser = (site) => ({ title: site.title, pages: site.pages, privacyEmail: site.privacyEmail }); /* robots.txt for this database's setting, as the build writes it. */ export function robotsTxt(site) { diff --git a/server/src/routes/feedback.js b/server/src/routes/feedback.js index 25fb7f2..0c377a4 100644 --- a/server/src/routes/feedback.js +++ b/server/src/routes/feedback.js @@ -29,10 +29,10 @@ const LIMITS = { const MIN_MESSAGE = 10; -// Must match FEEDBACK_TYPES in src/pages/sections/FeedbackForm.jsx. +// Must match FEEDBACK_TYPES and DATA_REQUEST in src/data/feedbackTypes.ts. // Anything else falls back to 'general' rather than being rejected, // a renamed option shouldn't lose someone's submission. -const TYPES = ["broken", "confusing", "outdated", "request", "praise", "other"]; +const TYPES = ["broken", "confusing", "outdated", "request", "praise", "other", "privacy"]; /* ── Input cleaning ──────────────────────────────────────────── */ @@ -76,6 +76,10 @@ feedback.post("/", async (c) => { const errors = {}; if (message.length < MIN_MESSAGE) errors.message = "Please write a little more."; if (!looksLikeEmail(email)) errors.email = "That email doesn't look right."; + // A data request (Privacy page) has to be answerable. + else if (feedbackType === "privacy" && !email) { + errors.email = "We need an email address to reply to a data request."; + } if (Object.keys(errors).length > 0) { return c.json({ error: "Validation failed", fields: errors }, 422); diff --git a/site.json b/site.json index 786515f..8d330e0 100644 --- a/site.json +++ b/site.json @@ -2,6 +2,7 @@ "title": "Next Generation of Unity", "url": "https://nextgenerationofunity.org", "description": "", + "privacyEmail": "", "robots": { "index": true }, diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 94767b0..1198c82 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -4,6 +4,7 @@ import { PAGE_LINKS, PAGE_SECTIONS, NAV_ACTIONS } from "../navConfig.ts"; import Banner from "./Banner.tsx"; import nguLogo from "../assets/logos/NGU_Logo.svg"; import Footer from "./Footer.tsx"; +import PrivacyNotice from "./PrivacyNotice.tsx"; /* ── Right-side nav actions ──────────────────────────────── */ @@ -269,6 +270,7 @@ export default function Layout() { {/*Site Footer applied to every page*/}
{paragraph}
+ ))} + {part.list && ( +{paragraph}
+ ))} ++ 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.{' '} + + Privacy Policy + +
+ +- {email - ? `We'll follow up at ${email} if we have questions.` - : "You sent this anonymously, so we won't be able to reply, but we read everything that comes in."} + {request + ? `We'll reply to ${email}. We may ask you to confirm it's you before we change or delete anything.` + : email + ? `We'll follow up at ${email} if we have questions.` + : "You sent this anonymously, so we won't be able to reply, but we read everything that comes in."}
- What you expected to happen, and what happened instead, is the most - useful thing you can give us. + {request + ? "Say what you'd like: to see the information we hold about you, to correct it, or to have it deleted. Tell us how you've been in touch with NGU (a retreat, a chapter, this site) so we can find it." + : "What you expected to happen, and what happened instead, is the most useful thing you can give us."}