Files
systemrevivalserver/Services/Admin/Pages/Shared/_Layout.cshtml
T
2025-12-26 10:00:34 -05:00

164 lines
10 KiB
Plaintext

@using Microsoft.AspNetCore.Http
<!DOCTYPE html>
<html lang="en" class="h-full bg-gray-900">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - Dungeon Divers Admin</title>
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
primary: '#6366f1',
secondary: '#8b5cf6',
}
}
}
}
</script>
<style>
.sidebar-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; color: #d1d5db; border-radius: 0.5rem; transition: all 0.15s; }
.sidebar-link:hover { background-color: #1f2937; color: white; }
.sidebar-link.active { background-color: #4f46e5; color: white; }
.btn { padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: 500; transition: all 0.15s; outline: none; }
.btn:focus { box-shadow: 0 0 0 2px #111827, 0 0 0 4px #6366f1; }
.btn-primary { background-color: #4f46e5; color: white; }
.btn-primary:hover { background-color: #4338ca; }
.btn-secondary { background-color: #374151; color: #e5e7eb; }
.btn-secondary:hover { background-color: #4b5563; }
.btn-danger { background-color: #dc2626; color: white; }
.btn-danger:hover { background-color: #b91c1c; }
.btn-success { background-color: #16a34a; color: white; }
.btn-success:hover { background-color: #15803d; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.input { width: 100%; padding: 0.5rem 0.75rem; background-color: #1f2937; border: 1px solid #374151; border-radius: 0.5rem; color: #e5e7eb; }
.input::placeholder { color: #6b7280; }
.input:focus { outline: none; box-shadow: 0 0 0 2px #6366f1; border-color: transparent; }
.label { display: block; font-size: 0.875rem; font-weight: 500; color: #d1d5db; margin-bottom: 0.25rem; }
.card { background-color: #1f2937; border-radius: 0.75rem; border: 1px solid #374151; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.table-header { padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 500; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }
.table-cell { padding: 0.75rem 1rem; font-size: 0.875rem; color: #d1d5db; }
.badge { display: inline-flex; align-items: center; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.badge-common { background-color: #4b5563; color: #e5e7eb; }
.badge-uncommon { background-color: #16a34a; color: white; }
.badge-rare { background-color: #2563eb; color: white; }
.badge-epic { background-color: #9333ea; color: white; }
.badge-legendary { background-color: #f97316; color: white; }
</style>
</head>
<body class="h-full">
<div class="flex h-full">
<!-- Sidebar -->
<aside class="w-64 bg-gray-800 border-r border-gray-700 flex flex-col">
<!-- Logo -->
<div class="p-4 border-b border-gray-700">
<h1 class="text-xl font-bold text-white flex items-center gap-2">
<svg class="w-8 h-8 text-indigo-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/>
</svg>
Dungeon Divers
</h1>
<p class="text-xs text-gray-500 mt-1">Admin Panel</p>
</div>
<!-- Navigation -->
<nav class="flex-1 p-4 space-y-1">
<a href="/admin" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString() == "/Index" ? "active" : "")">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/>
</svg>
Dashboard
</a>
<div class="pt-4">
<p class="px-4 text-xs font-semibold text-gray-500 uppercase tracking-wider">Content</p>
</div>
<a href="/admin/items" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Items") == true ? "active" : "")">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"/>
</svg>
Items
</a>
<a href="/admin/recipes" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Recipes") == true ? "active" : "")">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"/>
</svg>
Recipes
</a>
<a href="/admin/mobs" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Mobs") == true ? "active" : "")">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
</svg>
Mobs
</a>
<a href="/admin/assets" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Assets") == true ? "active" : "")">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
CDN Assets
</a>
<a href="/admin/loottables" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/LootTables") == true ? "active" : "")">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
Loot Tables
</a>
<div class="pt-4">
<p class="px-4 text-xs font-semibold text-gray-500 uppercase tracking-wider">Management</p>
</div>
<a href="/admin/players" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Players") == true ? "active" : "")">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/>
</svg>
Players
</a>
<a href="/admin/broadcast" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Broadcast") == true ? "active" : "")">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z"/>
</svg>
Broadcast
</a>
</nav>
<!-- User info -->
<div class="p-4 border-t border-gray-700">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-full bg-indigo-600 flex items-center justify-center text-white font-bold">
@(ViewData["AdminUsername"]?.ToString()?.Substring(0, 1).ToUpper() ?? "A")
</div>
<div class="flex-1 min-w-0">
<p class="text-sm font-medium text-white truncate">@ViewData["AdminUsername"]</p>
<p class="text-xs text-gray-400">@ViewData["AdminRole"]</p>
</div>
<a href="/admin/logout" class="text-gray-400 hover:text-white">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"/>
</svg>
</a>
</div>
</div>
</aside>
<!-- Main content -->
<main class="flex-1 overflow-auto">
<div class="p-8">
@RenderBody()
</div>
</main>
</div>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>