Call local chapters groups, everywhere
The organization kind is 'group', its side table is groups, pages live at /groups/<id> and the Community page's section is #groups. Migration 052 converts existing databases: the kind and the tables whose CHECKs name chapters are rebuilt, the front page count and request category follow, and the site's own /chapters/ and #chapters links in records are rewritten. Request files now go in Requests/Groups on the shared drive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
175a18976d
commit
38aff34c97
42 changed files with 473 additions and 254 deletions
|
|
@ -10,7 +10,7 @@
|
|||
exercises all of it:
|
||||
|
||||
/regions/showcase-region region: areas, map note, links, blocks
|
||||
/chapters/showcase-chapter chapter: meets, started, region
|
||||
/groups/showcase-group group: meets, started, region
|
||||
/teams/showcase-team team: a lead and members
|
||||
/awards/showcase-award award: recipients, one at an event
|
||||
/people/showcase-person person: bio, links, roles past and
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
Published but unlisted by default: every page above works, and
|
||||
none of it shows in the site's lists, counts, map or QR page.
|
||||
One consequence: a region's page lists only listed chapters,
|
||||
One consequence: a region's page lists only listed groups,
|
||||
teams, awards and events, so the showcase region's are empty.
|
||||
--listed lists everything instead, and
|
||||
adds timeline entries, so the Community map, Retreats bands,
|
||||
|
|
@ -71,7 +71,7 @@ const IMAGE = "/uploads/showcase.jpg";
|
|||
const POST_ID = "content-block-showcase";
|
||||
|
||||
const REGION = "showcase-region";
|
||||
const CHAPTER = "showcase-chapter";
|
||||
const GROUP = "showcase-group";
|
||||
const TEAM = "showcase-team";
|
||||
const AWARD = "showcase-award";
|
||||
const PERSON = "showcase-person";
|
||||
|
|
@ -229,7 +229,7 @@ tx(db, () => {
|
|||
db.prepare(`DELETE FROM affiliations WHERE person_id LIKE 'showcase-%' OR org_id LIKE 'showcase-%'`).run();
|
||||
db.prepare(`DELETE FROM teams WHERE id LIKE 'showcase-%'`).run();
|
||||
db.prepare(`DELETE FROM people WHERE id LIKE 'showcase-%'`).run();
|
||||
db.prepare(`DELETE FROM organizations WHERE id = ?`).run(CHAPTER);
|
||||
db.prepare(`DELETE FROM organizations WHERE id = ?`).run(GROUP);
|
||||
db.prepare(`DELETE FROM organizations WHERE id LIKE 'showcase-%'`).run();
|
||||
|
||||
/* ── Organizations ── */
|
||||
|
|
@ -256,11 +256,11 @@ tx(db, () => {
|
|||
blocks("organization", REGION, "body", pageBody("region"));
|
||||
|
||||
insert("organizations", {
|
||||
id: CHAPTER,
|
||||
kind: "chapter",
|
||||
name: "Showcase Chapter",
|
||||
id: GROUP,
|
||||
kind: "group",
|
||||
name: "Showcase Group",
|
||||
short_name: "Showcase Ch.",
|
||||
tagline: "A chapter with every field filled in",
|
||||
tagline: "A group with every field filled in",
|
||||
color: "#138ba0",
|
||||
logo: IMAGE,
|
||||
...place,
|
||||
|
|
@ -270,10 +270,10 @@ tx(db, () => {
|
|||
is_listed: LISTED,
|
||||
sort_order: 99,
|
||||
});
|
||||
insert("chapters", { id: CHAPTER, region_id: REGION, meets: "2nd Sundays, 6:00pm", started: "Since 2021" });
|
||||
links("organization", CHAPTER, standardLinks("Showcase Chapter"));
|
||||
blocks("organization", CHAPTER, "card", cardText("chapter"));
|
||||
blocks("organization", CHAPTER, "body", pageBody("chapter"));
|
||||
insert("groups", { id: GROUP, region_id: REGION, meets: "2nd Sundays, 6:00pm", started: "Since 2021" });
|
||||
links("organization", GROUP, standardLinks("Showcase Group"));
|
||||
blocks("organization", GROUP, "card", cardText("group"));
|
||||
blocks("organization", GROUP, "body", pageBody("group"));
|
||||
|
||||
/* ── People ── */
|
||||
insert("people", {
|
||||
|
|
@ -290,7 +290,7 @@ tx(db, () => {
|
|||
country: "US",
|
||||
location_label: "Exampletown, PA",
|
||||
bio: "Showcase Person is test data. This bio has two paragraphs so the page's spacing can be checked.\n\nThe second paragraph. Everything about this person is made up by seed-showcase.js.",
|
||||
primary_org_id: CHAPTER,
|
||||
primary_org_id: GROUP,
|
||||
is_published: 1,
|
||||
is_listed: LISTED,
|
||||
});
|
||||
|
|
@ -343,7 +343,7 @@ tx(db, () => {
|
|||
blocks("team", TEAM, "body", pageBody("team"));
|
||||
|
||||
insert("affiliations", { person_id: PERSON, org_id: REGION, team_id: TEAM, title: "Showcase Team Lead", role: "lead", is_owner: 1, started_on: "2023-01-01", is_public: 1, sort_order: 0 });
|
||||
insert("affiliations", { person_id: PERSON, org_id: CHAPTER, title: "Former Chapter Coordinator", role: "volunteer", started_on: "2021-01-01", ended_on: "2022-12-31", is_public: 1, sort_order: 1 });
|
||||
insert("affiliations", { person_id: PERSON, org_id: GROUP, title: "Former Group Coordinator", role: "volunteer", started_on: "2021-01-01", ended_on: "2022-12-31", is_public: 1, sort_order: 1 });
|
||||
MEMBERS.forEach((id, i) =>
|
||||
insert("affiliations", { person_id: id, org_id: REGION, team_id: TEAM, title: ["Treasurer", "Secretary", null][i], role: i === 2 ? "member" : "board", is_public: 1, sort_order: i + 1 }),
|
||||
);
|
||||
|
|
@ -409,7 +409,7 @@ tx(db, () => {
|
|||
is_published: 1,
|
||||
is_listed: LISTED,
|
||||
});
|
||||
insert("event_hosts", { event_id: SERIES, org_id: CHAPTER, sort_order: 0 });
|
||||
insert("event_hosts", { event_id: SERIES, org_id: GROUP, sort_order: 0 });
|
||||
links("event", SERIES, [{ kind: "action", label: "Join on Zoom", url: "https://example.org/zoom" }]);
|
||||
blocks("event", SERIES, "card", cardText("series"));
|
||||
|
||||
|
|
@ -489,7 +489,7 @@ db.close();
|
|||
console.log(`✓ Showcase written (${LISTED ? "listed" : "unlisted: pages only"}):`);
|
||||
for (const path of [
|
||||
`/regions/${REGION}`,
|
||||
`/chapters/${CHAPTER}`,
|
||||
`/groups/${GROUP}`,
|
||||
`/teams/${TEAM}`,
|
||||
`/awards/${AWARD}`,
|
||||
`/people/${PERSON}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue