admin: remove NavBar Admin Panel link, make users list-only

- Remove redundant Admin Panel link from top navigation bar. The
  sidebar already has the full admin model tree and the Dashboard
  shows a Proclamations card for Staff+ users.
- Add listOnly: true to users admin config. Users are created via
  registration, not the admin panel. RUD operations still work.
This commit is contained in:
NeilClack
2026-07-07 13:07:34 -05:00
parent 27aae18b3a
commit faacbab1de
2 changed files with 82 additions and 17 deletions
+63 -9
View File
@@ -7,6 +7,7 @@ const models: AdminModelConfig[] = [
modelName: 'User', modelName: 'User',
displayName: 'Users', displayName: 'Users',
displayNameSingular: 'User', displayNameSingular: 'User',
listOnly: true,
idType: 'String', idType: 'String',
include: { role: true, profile: true, licenseKeys: true }, include: { role: true, profile: true, licenseKeys: true },
listFields: ['name', 'email', 'emailVerified', 'role.name', 'createdAt'], listFields: ['name', 'email', 'emailVerified', 'role.name', 'createdAt'],
@@ -96,17 +97,36 @@ const models: AdminModelConfig[] = [
displayName: 'Proclamations', displayName: 'Proclamations',
displayNameSingular: 'Proclamation', displayNameSingular: 'Proclamation',
idType: 'String', idType: 'String',
include: { solfeggioFrequency: true, category: { include: { parent: true } } }, include: {
listFields: ['name', 'category.displayName', 'solfeggioFrequency.name', 'price'], solfeggioFrequency: true,
category: { include: { parent: true } },
subscriptionLevel: true
},
listFields: [
'name',
'category.name',
'solfeggioFrequency.name',
'subscriptionLevel.name'
],
searchFields: ['name', 'content'], searchFields: ['name', 'content'],
formFields: ['name', 'solfeggioFrequencyId', 'categoryId', 'price', 'content'], formFields: [
'name',
'solfeggioFrequencyId',
'parentCategoryId',
'categoryId',
'subscriptionLevelId',
'content'
],
readonlyFields: ['id'], readonlyFields: ['id'],
dataOnlyFields: ['parentCategoryId'],
cascadeFields: { categoryId: { parentField: 'parentCategoryId' } },
fieldTypes: { fieldTypes: {
name: 'String', name: 'String',
content: 'Tiptap', content: 'Tiptap',
solfeggioFrequencyId: 'Int', solfeggioFrequencyId: 'Int',
parentCategoryId: 'Int',
categoryId: 'Int', categoryId: 'Int',
price: 'Float' subscriptionLevelId: 'Int'
}, },
relationOptions: { relationOptions: {
solfeggioFrequencyId: { solfeggioFrequencyId: {
@@ -114,10 +134,20 @@ const models: AdminModelConfig[] = [
labelField: 'name', labelField: 'name',
valueField: 'id' valueField: 'id'
}, },
parentCategoryId: {
model: 'ProclamationCategory',
labelField: 'name',
valueField: 'id'
},
categoryId: { categoryId: {
model: 'ProclamationCategory', model: 'ProclamationCategory',
labelField: 'name', labelField: 'name',
valueField: 'id' valueField: 'id'
},
subscriptionLevelId: {
model: 'SubscriptionLevel',
labelField: 'name',
valueField: 'id'
} }
} }
}, },
@@ -134,14 +164,39 @@ const models: AdminModelConfig[] = [
readonlyFields: ['id'], readonlyFields: ['id'],
fieldTypes: { fieldTypes: {
name: 'String', name: 'String',
value: 'Float' value: 'Int'
}, },
relatedRecords: [ relatedRecords: [
{ {
relationKey: 'proclamations', relationKey: 'proclamations',
label: 'Proclamations', label: 'Proclamations',
type: 'has-many', type: 'has-many',
displayFields: ['name', 'price'], displayFields: ['name'],
editSlug: 'proclamations'
}
]
},
{
slug: 'subscription-levels',
modelName: 'SubscriptionLevel',
displayName: 'Subscription Levels',
displayNameSingular: 'Subscription Level',
idType: 'Int',
include: { proclamations: true },
listFields: ['id', 'name', 'description'],
searchFields: ['name', 'description'],
formFields: ['name', 'description'],
readonlyFields: ['id'],
fieldTypes: {
name: 'String',
description: 'String'
},
relatedRecords: [
{
relationKey: 'proclamations',
label: 'Proclamations',
type: 'has-many',
displayFields: ['name'],
editSlug: 'proclamations' editSlug: 'proclamations'
} }
] ]
@@ -153,7 +208,7 @@ const models: AdminModelConfig[] = [
displayNameSingular: 'Proclamation Category', displayNameSingular: 'Proclamation Category',
idType: 'Int', idType: 'Int',
include: { proclamations: true, children: true, parent: true }, include: { proclamations: true, children: true, parent: true },
listFields: ['displayName', 'parent.name'], listFields: ['name', 'parent.name'],
searchFields: ['name'], searchFields: ['name'],
formFields: ['name', 'parentId'], formFields: ['name', 'parentId'],
readonlyFields: ['id'], readonlyFields: ['id'],
@@ -169,7 +224,7 @@ const models: AdminModelConfig[] = [
relationKey: 'proclamations', relationKey: 'proclamations',
label: 'Proclamations', label: 'Proclamations',
type: 'has-many', type: 'has-many',
displayFields: ['name', 'price'], displayFields: ['name'],
editSlug: 'proclamations' editSlug: 'proclamations'
}, },
{ {
@@ -188,7 +243,6 @@ const models: AdminModelConfig[] = [
displayNameSingular: 'License Key', displayNameSingular: 'License Key',
idType: 'String', idType: 'String',
include: { user: true }, include: { user: true },
listOnly: true,
listFields: ['key', 'active', 'level', 'user.name'], listFields: ['key', 'active', 'level', 'user.name'],
searchFields: ['key', 'level'], searchFields: ['key', 'level'],
formFields: ['active', 'level', 'userId'], formFields: ['active', 'level', 'userId'],
+19 -8
View File
@@ -31,25 +31,33 @@
<svelte:head> <svelte:head>
<link rel="icon" href={favicon} /> <link rel="icon" href={favicon} />
<title>Rhema Wave Technologies</title> <title>Rhema Wave Technologies</title>
<meta name="description" content="Rhema Wave Technologies User Portal — manage proclamations, audio content, and solfeggio frequencies." /> <meta
name="description"
content="Rhema Wave Technologies User Portal — manage proclamations, audio content, and solfeggio frequencies."
/>
<meta name="theme-color" content="#6b7280" /> <meta name="theme-color" content="#6b7280" />
<meta property="og:title" content="Rhema Wave Technologies" /> <meta property="og:title" content="Rhema Wave Technologies" />
<meta property="og:description" content="Manage proclamations, audio content, and solfeggio frequencies." /> <meta
property="og:description"
content="Manage proclamations, audio content, and solfeggio frequencies."
/>
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:site_name" content="Rhema Wave Technologies" /> <meta property="og:site_name" content="Rhema Wave Technologies" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
</svelte:head> </svelte:head>
<nav class="flex w-full items-center justify-between border-b border-gray-200 px-8 py-6 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-100"> <nav
class="flex w-full items-center justify-between border-b border-gray-200 px-8 py-6 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-100"
>
<span><a href="/" class="dark:text-gray-100">Rhema Wave Technologies</a></span> <span><a href="/" class="dark:text-gray-100">Rhema Wave Technologies</a></span>
<div class="flex items-center gap-4"> <div class="flex items-center gap-4">
<button onclick={toggleTheme} class="border border-gray-300 px-3 py-1 text-sm dark:border-gray-600 dark:text-gray-300"> <button
onclick={toggleTheme}
class="border border-gray-300 px-3 py-1 text-sm dark:border-gray-600 dark:text-gray-300"
>
{dark ? 'Light' : 'Dark'} {dark ? 'Light' : 'Dark'}
</button> </button>
{#if $session.data} {#if $session.data}
{#if isAdmin}
<a href="/admin" class="dark:text-gray-300 dark:hover:text-gray-100">Admin Panel</a>
{/if}
<a href="/dashboard" class="dark:text-gray-300 dark:hover:text-gray-100">Dashboard</a> <a href="/dashboard" class="dark:text-gray-300 dark:hover:text-gray-100">Dashboard</a>
<button <button
class="dark:text-gray-300 dark:hover:text-gray-100" class="dark:text-gray-300 dark:hover:text-gray-100"
@@ -59,7 +67,10 @@
}}>Log Out</button }}>Log Out</button
> >
{:else} {:else}
<span class="dark:text-gray-300"><a href="/login" class="dark:text-gray-300 dark:hover:text-gray-100">Log In</a> | <a href="/register" class="dark:text-gray-300 dark:hover:text-gray-100">Register</a></span> <span class="dark:text-gray-300"
><a href="/login" class="dark:text-gray-300 dark:hover:text-gray-100">Log In</a> |
<a href="/register" class="dark:text-gray-300 dark:hover:text-gray-100">Register</a></span
>
{/if} {/if}
</div> </div>
</nav> </nav>