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:
Zaldimmar 2026-10-06 04:58:56 -05:00
parent 07c15ce96d
commit b55b088e16
23 changed files with 344 additions and 93 deletions

View file

@ -14,6 +14,7 @@
Organization page); its contact buttons are OrgContact.
═══════════════════════════════════════════════════════════════ */
import type { ReactNode } from 'react'
import { Link, Navigate, useLocation, useParams } from 'react-router-dom'
import PageShell from '../components/PageShell.tsx'
@ -21,6 +22,7 @@ import PageState from '../components/PageState.tsx'
import ContentBlocks from '../components/ContentBlocks.tsx'
import OrgTeams, { hasTeams } from '../components/OrgTeams.tsx'
import OrgContact from '../components/OrgContact.tsx'
import Tags from '../components/Tags.tsx'
import EventListCards from './sections/EventList-Cards.tsx'
import {
useOrganization,
@ -220,6 +222,12 @@ export default function OrganizationDetail() {
/* ── Pieces ──────────────────────────────────────────────────── */
/* "Mid-Atlantic" reads as "Mid-Atlantic Region"; a name that already
ends in Region keeps it. */
const regionName = (name?: string | null) => (name && !/region$/i.test(name.trim()) ? `${name} Region` : name)
/* The facts at the top, framed: one labeled cell each (city, region,
ministry, meeting time, since) and the record's tags. */
function Facts({
org,
accent,
@ -229,50 +237,49 @@ function Facts({
}) {
const where =
org.location_label || [org.locality, org.state_code].filter(Boolean).join(', ')
const group = org.kind === 'group' ? org.details : null
const link = 'font-semibold hover:underline'
const facts = ([
['City', where],
[
'Part of',
group?.region_id && (
<Link to={orgHref(group.region_id, 'region')} className={link} style={{ color: accentText(group.region_color || accent) }}>
{regionName(group.region_name)}
</Link>
),
],
[
'Ministry',
group?.ministry_name &&
(group.ministry_url ? (
<a href={group.ministry_url} target="_blank" rel="noreferrer" className={link} style={{ color: accentText(accent) }}>
{group.ministry_name}
</a>
) : (
group.ministry_name
)),
],
['Meets', group?.meets],
['Since', group?.started],
] as [string, ReactNode][]).filter(([, value]) => Boolean(value))
if (facts.length === 0 && org.tags.length === 0) return null
return (
<div className="flex flex-wrap items-center gap-x-6 gap-y-3 text-sm">
{where && <span style={{ color: BODY }}>{where}</span>}
{org.kind === 'group' && org.details.region_id && (
<span style={{ color: BODY }}>
Part of{' '}
<Link
to={orgHref(org.details.region_id, 'region')}
className="font-medium hover:underline"
style={{ color: org.details.region_color || accent }}
>
{org.details.region_name}
</Link>
</span>
<div className="max-w-3xl border-t-4 bg-raised p-5 shadow-sm" style={{ borderColor: accent }}>
{facts.length > 0 && (
<dl className="grid grid-cols-1 gap-x-8 gap-y-4 sm:grid-cols-2">
{facts.map(([label, value]) => (
<div key={label}>
<dt className="text-xs font-semibold uppercase tracking-wide text-muted">{label}</dt>
<dd className="mt-0.5 font-semibold text-ink">{value}</dd>
</div>
))}
</dl>
)}
{org.kind === 'group' && org.details.ministry_name && (
<span style={{ color: BODY }}>
Ministry:{' '}
{org.details.ministry_url ? (
<a
href={org.details.ministry_url}
target="_blank"
rel="noreferrer"
className="font-medium hover:underline"
style={{ color: accentText(accent) }}
>
{org.details.ministry_name}
</a>
) : (
org.details.ministry_name
)}
</span>
)}
{org.kind === 'group' && org.details.meets && (
<span style={{ color: BODY }}>Meets {org.details.meets}</span>
)}
{org.kind === 'group' && org.details.started && (
<span style={{ color: BODY }}>Since {org.details.started}</span>
)}
{org.is_online && <span style={{ color: BODY }}>Online</span>}
<Tags tags={org.tags} accent={accent} className={facts.length > 0 ? 'mt-4' : ''} />
</div>
)
}