diff --git a/src/pages/admin/index.astro b/src/pages/admin/index.astro index 874737bf..5d0f2029 100644 --- a/src/pages/admin/index.astro +++ b/src/pages/admin/index.astro @@ -17,6 +17,32 @@ const latestEntryDate = latestEntry?.data.published : "No date"; const totalEvents = calendarEvents.length + recurringCalendarEvents.length; const configuredServices = [contactFormEndpoint, plausibleDomain].filter(Boolean).length; +const speechAdminEntries = speechEntries.map((entry) => { + const categories = entry.data.categories ?? []; + const tags = entry.data.tags ?? []; + const publishedDate = entry.data.published?.slice(0, 10) ?? today; + const speechYear = entry.data.speechYear ?? entry.id.match(/\b(1\d{3}|20\d{2})\b/)?.[1] ?? new Date().getFullYear().toString(); + const categoryText = categories.join(" ").toLowerCase(); + const collection = entry.data.speechCollection ?? ""; + const speaker = categoryText.includes("hak ja han") || collection === "mrs-hak-ja-han-moon" + ? "mrs" + : categoryText.includes("rev sun myung moon") || /^\d{4}$/.test(collection) || /^\d{4}$/.test(speechYear) + ? "rev" + : "other"; + + return { + id: entry.id, + path: `content/${entry.id}.md`, + title: entry.data.title ?? entry.id, + publishedDate, + speechYear, + speaker, + source: entry.data.source ?? "", + categories, + tags, + body: entry.body ?? "", + }; +}); const adminConfig = { analyticsDashboardUrl, contactEndpointConfigured: Boolean(contactFormEndpoint), @@ -390,7 +416,7 @@ const adminConfig = { .admin-workspace { display: grid; - grid-template-columns: minmax(0, 1fr) 340px; + grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; } @@ -452,6 +478,42 @@ const adminConfig = { padding: 18px; } + .admin-speech-list { + display: grid; + gap: 8px; + max-height: 420px; + overflow: auto; + padding-right: 4px; + } + + .admin-speech-row { + display: grid; + grid-template-columns: minmax(0, 1fr) auto; + gap: 12px; + align-items: center; + padding: 12px; + border: 1px solid var(--admin-border); + border-radius: 7px; + background: var(--admin-panel-alt); + } + + .admin-speech-row-title { + display: block; + overflow: hidden; + font-weight: 800; + text-overflow: ellipsis; + white-space: nowrap; + } + + .admin-speech-row-meta { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-top: 3px; + color: var(--admin-muted); + font-size: 12px; + } + .admin-form { display: grid; gap: 14px; @@ -684,11 +746,6 @@ const adminConfig = {

FamilyFed.ie Admin

- @@ -741,54 +798,6 @@ const adminConfig = { -
-
-
-
- -

Content Tools

-
-
-
-
- - - View Public Speeches -
-
-
- -
-
-
- -

Operations

-
-
-
-
    -
  • - Contact form - - {contactFormEndpoint ? "Endpoint configured" : "Needs PUBLIC_CONTACT_FORM_ENDPOINT"} - -
  • -
  • - Visitor analytics - - {plausibleDomain ? `Tracking ${plausibleDomain}` : "Needs PUBLIC_PLAUSIBLE_DOMAIN"} - -
  • -
-
-
- -
- Static admin note -

The dashboard can generate clean content files, but it cannot write to the repository from the browser.

- -
-
- - + -