Add a Listed flag: published records reachable only by their link
is_listed (migration 027) sits beside is_published on organizations, events, people, teams and awards. Unticked, the record's own page still works, but the site's lists leave it out: the list routes, a region's chapters, an organization's events, teams and awards, the QR page's directory, and the front page's counts and countdown. Places where someone attached it by hand (rosters, hosts, billed people, recipients, timeline, a pinned countdown) still show it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3c02eb8971
commit
cd393e4ab2
7 changed files with 120 additions and 38 deletions
|
|
@ -32,10 +32,21 @@ const PLACE_FIELDS = [
|
|||
|
||||
const PUBLISHED_FIELD = { path: "is_published", label: "Published", widget: "checkbox" };
|
||||
|
||||
/* Only means anything on a published record. Unticked, its own page
|
||||
still works but the site's lists, counts and the QR page leave it
|
||||
out. See 027_listed.sql for exactly which. */
|
||||
const LISTED_FIELD = {
|
||||
path: "is_listed",
|
||||
label: "Listed",
|
||||
widget: "checkbox",
|
||||
help: "Unticked: only reachable by its link",
|
||||
};
|
||||
|
||||
/* For entities whose lists the site orders by hand. Events sort by
|
||||
date and people by sort_name, so they take PUBLISHED_FIELD alone. */
|
||||
date and people by sort_name, so they take the first two alone. */
|
||||
const PUBLISH_FIELDS = [
|
||||
PUBLISHED_FIELD,
|
||||
LISTED_FIELD,
|
||||
{ path: "sort_order", label: "Sort order", widget: "number" },
|
||||
];
|
||||
|
||||
|
|
@ -252,10 +263,12 @@ const organizations = {
|
|||
{ 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", "chapter", "partner"] },
|
||||
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
|
||||
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
|
||||
],
|
||||
},
|
||||
|
||||
|
|
@ -412,6 +425,7 @@ const events = {
|
|||
{ key: "date_label", label: "Dates" },
|
||||
{ key: "status", label: "Status" },
|
||||
{ key: "is_published", label: "Live", widget: "bool" },
|
||||
{ key: "is_listed", label: "Listed", widget: "bool" },
|
||||
],
|
||||
filters: [
|
||||
{ key: "scope_id", label: "Scope", optionsFrom: "event_scopes" },
|
||||
|
|
@ -422,6 +436,7 @@ const events = {
|
|||
},
|
||||
{ key: "status", label: "Status", options: ["upcoming", "past", "cancelled"] },
|
||||
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
|
||||
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
|
||||
],
|
||||
},
|
||||
|
||||
|
|
@ -488,7 +503,7 @@ const events = {
|
|||
},
|
||||
timelineGroup("event"),
|
||||
timelineDetailGroup("event"),
|
||||
{ legend: "Publishing", fields: [PUBLISHED_FIELD] },
|
||||
{ legend: "Publishing", fields: [PUBLISHED_FIELD, LISTED_FIELD] },
|
||||
],
|
||||
|
||||
children: [
|
||||
|
|
@ -546,9 +561,11 @@ const people = {
|
|||
{ key: "tagline", label: "Tagline" },
|
||||
{ key: "locality", label: "City" },
|
||||
{ key: "is_published", label: "Live", widget: "bool" },
|
||||
{ key: "is_listed", label: "Listed", widget: "bool" },
|
||||
],
|
||||
filters: [
|
||||
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
|
||||
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
|
||||
],
|
||||
},
|
||||
|
||||
|
|
@ -603,7 +620,7 @@ const people = {
|
|||
{
|
||||
legend: "Publishing",
|
||||
note: "Unpublished people are invisible everywhere.",
|
||||
fields: [PUBLISHED_FIELD],
|
||||
fields: [PUBLISHED_FIELD, LISTED_FIELD],
|
||||
},
|
||||
],
|
||||
|
||||
|
|
@ -694,10 +711,12 @@ const teams = {
|
|||
{ key: "org_id", label: "Organization" },
|
||||
{ key: "tagline", label: "Tagline" },
|
||||
{ key: "is_published", label: "Live", widget: "bool" },
|
||||
{ key: "is_listed", label: "Listed", widget: "bool" },
|
||||
],
|
||||
filters: [
|
||||
{ key: "org_id", label: "Organization", optionsFrom: "organizations" },
|
||||
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
|
||||
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
|
||||
],
|
||||
},
|
||||
|
||||
|
|
@ -769,10 +788,12 @@ const awards = {
|
|||
{ key: "org_id", label: "Awarded by" },
|
||||
{ key: "description", label: "Description" },
|
||||
{ key: "is_published", label: "Live", widget: "bool" },
|
||||
{ key: "is_listed", label: "Listed", widget: "bool" },
|
||||
],
|
||||
filters: [
|
||||
{ key: "org_id", label: "Awarded by", optionsFrom: "organizations" },
|
||||
{ key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] },
|
||||
{ key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] },
|
||||
],
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue