Group pages: framed facts, tags for organizations and events, every website and email (migration 070)
- Email buttons went to the link's label, not its URL (splitLinks took the label); they use the URL now, with or without mailto:. - Every website and email row is listed, each with its own label, instead of only the first. - The facts at the top of an organization page sit in a framed card: City, Part of <name> Region, Ministry, Meets, Since, and its tags. - Tags (070): Data -> Tags (Online, In-Person to start) replace the Online checkbox on organizations and events. Ticked records get the Online tag; v_events reads the "online" tag as is_online, so the calendar filter and place lines are unchanged. Tags show on the record's page and on group entries in the Community map list and grid. The map no longer keeps online groups off their state's tile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
07c15ce96d
commit
b55b088e16
23 changed files with 344 additions and 93 deletions
|
|
@ -28,6 +28,7 @@ import { frontPage } from "./adminSchema/frontPage.ts";
|
|||
import { blogPosts } from "./adminSchema/blog.ts";
|
||||
import { siteSettings } from "./adminSchema/siteSettings.ts";
|
||||
import { personTagTypes } from "./adminSchema/personTags.ts";
|
||||
import { tags } from "./adminSchema/tags.ts";
|
||||
import { contactTypes } from "./adminSchema/contactTypes.ts";
|
||||
import { redirects } from "./adminSchema/redirects.ts";
|
||||
import {
|
||||
|
|
@ -43,6 +44,7 @@ export const ADMIN_ENTITIES: Record<string, any> = {
|
|||
events,
|
||||
people,
|
||||
person_tag_types: personTagTypes,
|
||||
tags,
|
||||
contact_types: contactTypes,
|
||||
redirects,
|
||||
teams,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { mediaUrl } from "../media.ts";
|
||||
import { PLACE_FIELDS, PUBLISHED_FIELD, LISTED_FIELD, timelineGroup, timelineDetailGroup, linksChild, hostsChild, blocksChild } from "./shared.ts";
|
||||
import { PLACE_FIELDS, PUBLISHED_FIELD, LISTED_FIELD, timelineGroup, timelineDetailGroup, linksChild, hostsChild, blocksChild, tagsChild } from "./shared.ts";
|
||||
|
||||
/* ── Events ──────────────────────────────────────────────────── */
|
||||
|
||||
|
|
@ -178,6 +178,7 @@ export const events = {
|
|||
|
||||
children: [
|
||||
hostsChild,
|
||||
tagsChild,
|
||||
{
|
||||
key: "event_people",
|
||||
label: "People at this event",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { mediaUrl } from "../media.ts";
|
||||
import { PLACE_FIELDS, PUBLISH_FIELDS, timelineGroup, timelineDetailGroup, linksChild, blocksChild } from "./shared.ts";
|
||||
import { PLACE_FIELDS, PUBLISH_FIELDS, timelineGroup, timelineDetailGroup, linksChild, blocksChild, tagsChild } from "./shared.ts";
|
||||
|
||||
/* ── Organizations ───────────────────────────────────────────── */
|
||||
|
||||
|
|
@ -89,6 +89,7 @@ export const organizations = {
|
|||
],
|
||||
|
||||
children: [
|
||||
tagsChild,
|
||||
{
|
||||
key: "region_areas",
|
||||
label: "Map areas",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ export const PLACE_FIELDS = [
|
|||
{ path: "location_label", label: "Display location", help: "Overrides the line built from city and state" },
|
||||
{ path: "latitude", label: "Latitude", widget: "number" },
|
||||
{ path: "longitude", label: "Longitude", widget: "number" },
|
||||
{ path: "is_online", label: "Online", widget: "checkbox" },
|
||||
];
|
||||
|
||||
export const PUBLISHED_FIELD = { path: "is_published", label: "Published", widget: "checkbox" };
|
||||
|
|
@ -198,6 +197,18 @@ export const featuredCardsChild = {
|
|||
],
|
||||
};
|
||||
|
||||
/* An organization's or event's tags (070_tags.sql): Online,
|
||||
In-Person and whatever else Data → Tags holds. */
|
||||
export const tagsChild = {
|
||||
key: "tags",
|
||||
label: "Tags",
|
||||
note: "Shown on its page, eg. Online or In-Person. Tags are made under Data → Tags.",
|
||||
addLabel: "Add tag",
|
||||
title: (row, options) => options?.tags?.find((t) => t.id === row.tag_id)?.label ?? "New tag",
|
||||
blank: { tag_id: "" },
|
||||
fields: [{ path: "tag_id", label: "Tag", widget: "select", optionsFrom: "tags", required: true }],
|
||||
};
|
||||
|
||||
/* The two collections every entity carries. */
|
||||
export const linksChild = {
|
||||
key: "links",
|
||||
|
|
|
|||
32
src/lib/adminSchema/tags.ts
Normal file
32
src/lib/adminSchema/tags.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* ── Tags (070_tags.sql) ─────────────────────────────────────────
|
||||
Data → Tags: descriptors an organization or event can carry, eg.
|
||||
Online, In-Person, shown on its page (and on a group's entry in
|
||||
the Community map). Which records carry a tag is edited on the
|
||||
record. Server side: server/src/admin-schema/tags.js. */
|
||||
|
||||
export const tags = {
|
||||
key: "tags",
|
||||
label: "Tags",
|
||||
singular: "tag",
|
||||
idLabel: "URL ID",
|
||||
slugFrom: "name",
|
||||
|
||||
list: {
|
||||
columns: [
|
||||
{ key: "name", label: "Name", primary: true },
|
||||
{ key: "sort_order", label: "Order" },
|
||||
],
|
||||
filters: [],
|
||||
},
|
||||
|
||||
groups: [
|
||||
{
|
||||
legend: "Tag",
|
||||
note: "The tag with URL ID online marks an event as online: the calendar's Online filter and its place line read it.",
|
||||
fields: [
|
||||
{ path: "name", label: "Name", required: true, help: "As shown, eg. In-Person" },
|
||||
{ path: "sort_order", label: "Sort order", widget: "number" },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
@ -114,6 +114,9 @@ export type EventAward = {
|
|||
citation?: string | null
|
||||
}
|
||||
|
||||
/** A descriptor tag (070_tags.sql), eg. Online or In-Person. */
|
||||
export type Tag = { id: string; name: string }
|
||||
|
||||
export type EventRecord = {
|
||||
id: string
|
||||
/** Whose gathering it is: an event_scopes id. */
|
||||
|
|
@ -133,7 +136,10 @@ export type EventRecord = {
|
|||
locality?: string | null
|
||||
state_code?: string | null
|
||||
country?: string | null
|
||||
/** The event carries the "online" tag (v_events). */
|
||||
is_online: boolean
|
||||
/** Its tags: on the event's own page only. */
|
||||
tags?: Tag[]
|
||||
org_logo?: string | null
|
||||
event_logo?: string | null
|
||||
color?: string | null
|
||||
|
|
@ -231,13 +237,17 @@ export type OrganizationRecord = {
|
|||
state_code?: string | null
|
||||
country?: string | null
|
||||
location_label?: string | null
|
||||
is_online: boolean
|
||||
tags: Tag[]
|
||||
description: string[]
|
||||
blocks: ContentBlock[]
|
||||
links: Link[]
|
||||
socials: Link[]
|
||||
/* splitLinks in shape.js lifts these out as bare strings: the
|
||||
website's url, the email's label, the instagram handle. */
|
||||
/** Every website and email row (an email's url is the bare address). */
|
||||
websites: Link[]
|
||||
emails: Link[]
|
||||
/* splitLinks in shape.js lifts these out as bare strings, for
|
||||
cards: the first website's url, the first email's address, the
|
||||
instagram handle. */
|
||||
website?: string | null
|
||||
email?: string | null
|
||||
instagram?: string | null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue