Refactor admin panel into categorized navigation

This commit is contained in:
AzuTear
2026-06-17 12:37:17 +02:00
parent 92dd6f7432
commit 953257bcef
11 changed files with 901 additions and 660 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ const navItems = [
]
const currentLabel = computed(
() => navItems.find((item) => item.to === route.path)?.label ?? 'Awards',
() => navItems.find((item) => route.path === item.to || route.path.startsWith(`${item.to}/`))?.label ?? 'Awards',
)
const visibleNavItems = computed(() =>
@@ -103,7 +103,7 @@ async function login(role: 'viewer' | 'admin') {
:key="item.to"
:to="item.to"
class="rounded-full px-4 py-2 transition hover:bg-violet-50 hover:text-violet-700"
:class="route.path === item.to ? 'bg-violet-100 text-violet-800' : ''"
:class="route.path === item.to || route.path.startsWith(`${item.to}/`) ? 'bg-violet-100 text-violet-800' : ''"
>
{{ item.label }}
</RouterLink>
@@ -0,0 +1,44 @@
<script setup lang="ts">
import { computed } from 'vue'
import Select from 'primevue/select'
import { useAwardsStore } from '../../stores/awards'
const store = useAwardsStore()
const seasons = computed(() => store.adminSeasons)
const selectedSeasonId = computed({
get: () => store.adminSelectedSeasonId,
set: async (value) => {
if (!value) return
await store.loadAdminSeasonDetail(value)
},
})
const seasonOptions = computed(() =>
seasons.value.map((season) => ({
label: `${season.year} · ${season.name}`,
value: season.id,
})),
)
</script>
<template>
<div class="flex flex-col gap-4 rounded-[26px] border border-violet-100 bg-white/80 px-5 py-5 md:flex-row md:items-center md:justify-between">
<div>
<p class="text-xs font-semibold uppercase tracking-[0.28em] text-violet-500">Arbeitskontext</p>
<p class="mt-2 text-sm text-slate-500">Die gewaehlte Season steuert Kategorien, Kandidaten und Review-Queues im gesamten Admin-Bereich.</p>
</div>
<div class="grid gap-3 md:min-w-[330px]">
<label class="text-sm font-semibold text-slate-600">Season</label>
<Select
v-model="selectedSeasonId"
:options="seasonOptions"
option-label="label"
option-value="value"
class="w-full"
/>
</div>
</div>
</template>