/* ═══════════════════════════════════════════════════════════════ ADMIN FORM MANIFESTS The presentation half of server/src/admin-schema.js: labels, widgets, grouping, and which select pulls from which option list. The server decides what's storable; this decides what the form looks like. Paths here must match column names there, and nested paths ('region.scope') match the side-table keys. Adding a field is one entry. Adding an entity is one file in adminSchema/ (its manifest), one line in ADMIN_ENTITIES below, and one descriptor on the server, with no new page component. Field sets and collections several entities share are in adminSchema/shared.ts. A value seeded in a repeater's `blank` must also be declared as a default: on the matching server column, or a row the user adds and never fills in reads as real input instead of being skipped. ═══════════════════════════════════════════════════════════════ */ import { organizations } from "./adminSchema/organizations.ts"; import { events } from "./adminSchema/events.ts"; import { people } from "./adminSchema/people.ts"; import { teams } from "./adminSchema/teams.ts"; import { awards } from "./adminSchema/awards.ts"; import { timeline } from "./adminSchema/timeline.ts"; import { frontPage } from "./adminSchema/frontPage.ts"; import { blogPosts, communityPage } from "./adminSchema/blog.ts"; import { siteSettings } from "./adminSchema/siteSettings.ts"; export const ADMIN_ENTITIES: Record = { organizations, events, people, teams, awards, timeline, front_page: frontPage, blog_posts: blogPosts, community_page: communityPage, site_settings: siteSettings, }; export function slugify(value) { return String(value ?? "") .toLowerCase() .normalize("NFKD") .replace(/[^\w\s-]/g, "") .trim() .replace(/[\s_]+/g, "-") .replace(/-+/g, "-") .slice(0, 64); }