commit
Move owner-only tiles to the owner dashboard; add relationship map to Public
The member, tag, pride and relationship managers now sit on the owner dashboard next to user management, and the admin dashboard keeps only the admin pages. The Public dashboard gains a tile for /relationships. Co-Authored-By: Sandrone <[email protected]>
diff --git a/src/routes/admin/dash/+page.svelte b/src/routes/admin/dash/+page.svelte
index 9fad0e0..5a36200 100644
--- a/src/routes/admin/dash/+page.svelte
+++ b/src/routes/admin/dash/+page.svelte
@@ -6,28 +6,16 @@
<script lang="ts">
import IcChat from "~icons/ic/outline-chat";
- import IcFavorite from "~icons/ic/outline-favorite";
- import IcFlag from "~icons/ic/outline-flag";
- import IcLabel from "~icons/ic/outline-label";
- import IcManageAccounts from "~icons/ic/outline-manage-accounts";
import IcMonitorHeart from "~icons/ic/outline-monitor-heart";
import IcRefresh from "~icons/ic/outline-refresh";
import IcSwapHoriz from "~icons/ic/outline-swap-horiz";
import { errorText, type Message as MessageType } from "#lib";
import { client } from "#lib/api.ts";
- import { auth } from "#lib/auth.svelte.ts";
import Protected from "#lib/components/Protected.svelte";
import PageHead from "#lib/components/PageHead.svelte";
import Message from "#lib/components/Message.svelte";
const PAGES = [
- {
- href: "/admin/members",
- owner: true,
- label: "Member manager",
- icon: IcManageAccounts,
- desc: "Create and edit members, import data",
- },
{
href: "/admin/switch",
label: "Switch manager",
@@ -46,32 +34,8 @@
icon: IcChat,
desc: "Set member statuses",
},
- {
- href: "/admin/tags",
- owner: true,
- label: "Tag manager",
- icon: IcLabel,
- desc: "Manage member tags",
- },
- {
- href: "/admin/pride",
- owner: true,
- label: "Pride manager",
- icon: IcFlag,
- desc: "Set member pride identities",
- },
- {
- href: "/admin/relationships",
- owner: true,
- label: "Relationships",
- icon: IcFavorite,
- desc: "Map who is dating who",
- },
];
- // Owner-only pages are hidden from admins
- const visiblePages = $derived(PAGES.filter((page) => !page.owner || auth.isOwner));
-
let refreshing = $state(false);
let message = $state<MessageType>(null);
@@ -130,7 +94,7 @@
</section>
<div class="tiles">
- {#each visiblePages as page (page.href)}
+ {#each PAGES as page (page.href)}
<a class="tile" href={page.href}>
<span class="tile-icon"><page.icon width="22" height="22" /></span>
<h3>{page.label}</h3>
diff --git a/src/routes/owner/dash/+page.svelte b/src/routes/owner/dash/+page.svelte
index a2735c6..169e370 100644
--- a/src/routes/owner/dash/+page.svelte
+++ b/src/routes/owner/dash/+page.svelte
@@ -5,9 +5,46 @@
-->
<script lang="ts">
+ import IcFavorite from "~icons/ic/outline-favorite";
+ import IcFlag from "~icons/ic/outline-flag";
+ import IcLabel from "~icons/ic/outline-label";
+ import IcManageAccounts from "~icons/ic/outline-manage-accounts";
import IcPeople from "~icons/ic/outline-people";
import Protected from "#lib/components/Protected.svelte";
import PageHead from "#lib/components/PageHead.svelte";
+
+ const PAGES = [
+ {
+ href: "/owner/users",
+ label: "User management",
+ icon: IcPeople,
+ desc: "Manage all users",
+ },
+ {
+ href: "/admin/members",
+ label: "Member manager",
+ icon: IcManageAccounts,
+ desc: "Create and edit members, import data",
+ },
+ {
+ href: "/admin/tags",
+ label: "Tag manager",
+ icon: IcLabel,
+ desc: "Manage member tags",
+ },
+ {
+ href: "/admin/pride",
+ label: "Pride manager",
+ icon: IcFlag,
+ desc: "Set member pride identities",
+ },
+ {
+ href: "/admin/relationships",
+ label: "Relationships",
+ icon: IcFavorite,
+ desc: "Map who is dating who",
+ },
+ ];
</script>
<svelte:head>
@@ -27,11 +64,13 @@
/>
<div class="tiles">
- <a class="tile" href="/owner/users">
- <span class="tile-icon"><IcPeople width="22" height="22" /></span>
- <h3>User management</h3>
- <p>Manage all users</p>
- </a>
+ {#each PAGES as page (page.href)}
+ <a class="tile" href={page.href}>
+ <span class="tile-icon"><page.icon width="22" height="22" /></span>
+ <h3>{page.label}</h3>
+ <p>{page.desc}</p>
+ </a>
+ {/each}
</div>
</div>
</Protected>
diff --git a/src/routes/user/dash/+page.svelte b/src/routes/user/dash/+page.svelte
index 17d1162..c033a82 100644
--- a/src/routes/user/dash/+page.svelte
+++ b/src/routes/user/dash/+page.svelte
@@ -7,6 +7,7 @@
<script lang="ts">
import IcApi from "~icons/ic/outline-api";
import IcBarChart from "~icons/ic/outline-bar-chart";
+ import IcFavorite from "~icons/ic/outline-favorite";
import Protected from "#lib/components/Protected.svelte";
import PageHead from "#lib/components/PageHead.svelte";
</script>
@@ -38,6 +39,11 @@
<h3>Metrics</h3>
<p>Fronting and switching statistics</p>
</a>
+ <a class="tile" href="/relationships">
+ <span class="tile-icon"><IcFavorite width="22" height="22" /></span>
+ <h3>Relationship map</h3>
+ <p>Who is dating who</p>
+ </a>
</div>
</div>
</Protected>