Dough Git

clove/pkviewer

web/src/routes/admin/+page.svelte

back to web/src/routes/admin

<!-- web/src/routes/admin/+page.svelte -->
<script lang="ts">
  import Icon from "$lib/components/Icon.svelte";
  import PageHeader from "$lib/components/manage/PageHeader.svelte";
  import Section from "$lib/components/manage/Section.svelte";

  let { data } = $props();
</script>

<svelte:head>
  <title>Admin · pkviewer</title>
</svelte:head>

<div class="mg-shell">
  <PageHeader
    title="Administration"
    description="Recognition and the credits page. Nothing here reaches anyone's system settings."
  />

  {#if data.counts.pending > 0}
    <p class="mg-note">
      {data.counts.pending} badge {data.counts.pending === 1 ? "offer is" : "offers are"} waiting
      on a reply. A badge shows publicly only once its system accepts it.
    </p>
  {/if}

  <Section title="Badges" description="Grant, revoke, and edit the catalogue.">
    <ul class="mg-stats">
      <li><strong>{data.counts.accepted}</strong> showing</li>
      <li><strong>{data.counts.pending}</strong> pending</li>
      <li><strong>{data.counts.hidden}</strong> hidden by owner</li>
      <li><strong>{data.counts.declined}</strong> declined</li>
      <li><strong>{data.counts.revoked}</strong> revoked</li>
    </ul>
    <div class="mg-actions">
      <a class="btn primary" href="/admin/badges">
        <Icon name="award" /> Manage badges
      </a>
    </div>
  </Section>

  <Section
    title="Credits"
    description="Anyone can be credited — no pkviewer account or PluralKit system needed."
  >
    <p class="muted">
      {data.credits
        ? `${data.credits.entries} entries across ${data.credits.sections} sections.`
        : "Could not load the credits."}
    </p>
    <div class="mg-actions">
      <a class="btn primary" href="/admin/credits">
        <Icon name="people" /> Manage credits
      </a>
      <a class="btn" href="/admin/audit">
        <Icon name="journal-text" /> History
      </a>
    </div>
  </Section>
</div>