- People tags (062): Data → People tags (Musicians seeded); a person's Directories repeater tags them and their Specialty line shows on their tile. A People directory section preset shows a tag's first 12 and links to its full page, /directory/<tag>, with page meta and a sitemap entry. Tiles' details panels show a person's links. - Ministries (063): a new organization kind. A group picks its ministry and its page says "Ministry: <name>", linked to the ministry's website. Ministries have no public page, list, sitemap or timeline entry, and aren't offered where a record links to its organization. organizations is rebuilt for the kind CHECK. - Organization contacts (064): Data → Contact types; a private Contacts repeater on each organization (editors and up, readRole on a child collection). Tools → Newsletter → Recipients filters them by type, kind, region and published and downloads a Mailchimp CSV. - A trigger refusing a save with a sentence is shown as that message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
134 lines
4.7 KiB
TypeScript
134 lines
4.7 KiB
TypeScript
import { mediaUrl } from "../media.ts";
|
|
import { PLACE_FIELDS, PUBLISH_FIELDS, timelineGroup, timelineDetailGroup, linksChild, blocksChild } from "./shared.ts";
|
|
|
|
/* ── Organizations ───────────────────────────────────────────── */
|
|
|
|
export const organizations = {
|
|
key: "organizations",
|
|
label: "Organizations",
|
|
singular: "organization",
|
|
idLabel: "URL ID",
|
|
slugFrom: "name",
|
|
|
|
list: {
|
|
columns: [
|
|
{ key: "name", label: "Name", primary: true },
|
|
{ key: "kind", label: "Kind" },
|
|
{ key: "locality", label: "City" },
|
|
{ key: "state_code", label: "State" },
|
|
{ key: "is_published", label: "Live", widget: "bool" },
|
|
{ key: "is_listed", label: "Listed", widget: "bool" },
|
|
],
|
|
filters: [
|
|
{ key: "kind", label: "Kind", options: ["national", "region", "group", "partner", "ministry"] },
|
|
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
|
|
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
|
|
],
|
|
},
|
|
|
|
groups: [
|
|
{
|
|
legend: "Identity",
|
|
fields: [
|
|
{
|
|
path: "kind",
|
|
label: "Kind",
|
|
widget: "select",
|
|
options: ["national", "region", "group", "partner", "ministry"],
|
|
required: true,
|
|
help: "Changing this swaps which extra fields apply. A ministry (a Unity church) has no page; its groups name it",
|
|
},
|
|
{ path: "name", label: "Name", required: true },
|
|
{ path: "short_name", label: "Short name" },
|
|
{ path: "tagline", label: "Tagline", full: true },
|
|
{ path: "color", label: "Color", widget: "color" },
|
|
{ path: "logo", label: "Logo", widget: "image", folder: "logos", resolve: mediaUrl, full: true },
|
|
],
|
|
},
|
|
{
|
|
legend: "Region",
|
|
when: { path: "kind", value: "region" },
|
|
fields: [
|
|
{
|
|
path: "region.scope",
|
|
label: "Scope",
|
|
widget: "select",
|
|
options: ["domestic", "international", "virtual"],
|
|
required: true,
|
|
},
|
|
{ path: "region.map_note", label: "Map note", full: true },
|
|
],
|
|
},
|
|
{
|
|
legend: "Group",
|
|
when: { path: "kind", value: "group" },
|
|
fields: [
|
|
{
|
|
path: "group.region_id",
|
|
label: "Region",
|
|
widget: "select",
|
|
optionsFrom: "regions",
|
|
blankLabel: "Default: none",
|
|
},
|
|
{
|
|
path: "group.ministry_id",
|
|
label: "Ministry",
|
|
widget: "select",
|
|
optionsFrom: "ministries",
|
|
blankLabel: "Default: none",
|
|
help: "The Unity ministry it belongs to, named on its page (linked to the ministry's website)",
|
|
},
|
|
{ path: "group.meets", label: "Meets", help: "2nd Sundays, 6:00pm" },
|
|
{ path: "group.started", label: "Started", help: "Since 2021" },
|
|
],
|
|
},
|
|
{ legend: "Place", fields: PLACE_FIELDS },
|
|
timelineGroup("organization"),
|
|
timelineDetailGroup("organization"),
|
|
{ legend: "Publishing", fields: PUBLISH_FIELDS },
|
|
],
|
|
|
|
children: [
|
|
{
|
|
key: "region_areas",
|
|
label: "Map areas",
|
|
when: { path: "kind", value: "region" },
|
|
addLabel: "Add area",
|
|
title: (row) => row.area_code || "New area",
|
|
blank: { area_code: "", share: 1 },
|
|
fields: [
|
|
{ path: "area_code", label: "Area code", required: true, help: "Two letter state code or Country name" },
|
|
{ path: "share", label: "Share", widget: "number", help: "1 for the whole tile, 0.5 for half" },
|
|
{
|
|
path: "edge",
|
|
label: "Edge",
|
|
widget: "select",
|
|
options: ["top", "bottom"],
|
|
blankLabel: "Default: whole tile",
|
|
},
|
|
{ path: "note", label: "Note", help: "details to explain why it's half or other note" },
|
|
],
|
|
},
|
|
{
|
|
key: "contacts",
|
|
label: "Contacts",
|
|
note:
|
|
"Private: never on the public site, and only editors and up see them. " +
|
|
"Tools → Newsletter → Recipients exports them. Types are made under Data → Contact types.",
|
|
addLabel: "Add contact",
|
|
title: (row, options) =>
|
|
[options?.contact_types?.find((t) => t.id === row.type_id)?.label, row.name || row.email]
|
|
.filter(Boolean)
|
|
.join(" · ") || "New contact",
|
|
blank: { type_id: "", name: "", email: "", phone: "" },
|
|
fields: [
|
|
{ path: "type_id", label: "Type", widget: "select", optionsFrom: "contact_types", required: true },
|
|
{ path: "name", label: "Name" },
|
|
{ path: "email", label: "Email", help: "An email or a phone is needed" },
|
|
{ path: "phone", label: "Phone" },
|
|
],
|
|
},
|
|
linksChild,
|
|
blocksChild,
|
|
],
|
|
};
|