- Added /admin redirect to login page in nginx config - Fixed backend server.js route ordering for proper admin handling - Updated authentication middleware and routes - Added user management routes - Configured PostgreSQL integration - Updated environment configuration
249 lines
8.1 KiB
Plaintext
249 lines
8.1 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>@ViewData["Title"] - Admin Panel</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
|
|
<style>
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
margin: 0;
|
|
padding: 0;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
.sidebar {
|
|
height: 100vh;
|
|
background: #2c3e50;
|
|
color: white;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 250px;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
.sidebar::-webkit-scrollbar {
|
|
width: 8px;
|
|
}
|
|
|
|
.sidebar::-webkit-scrollbar-track {
|
|
background: #2c3e50;
|
|
}
|
|
|
|
.sidebar::-webkit-scrollbar-thumb {
|
|
background: #34495e;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.sidebar::-webkit-scrollbar-thumb:hover {
|
|
background: #3498db;
|
|
}
|
|
|
|
.sidebar .brand {
|
|
padding: 20px;
|
|
font-size: 1.5rem;
|
|
font-weight: bold;
|
|
border-bottom: 1px solid #34495e;
|
|
position: sticky;
|
|
top: 0;
|
|
background: #2c3e50;
|
|
z-index: 10;
|
|
}
|
|
|
|
.sidebar nav {
|
|
padding-bottom: 30px;
|
|
}
|
|
|
|
.sidebar .nav-link {
|
|
color: #ecf0f1;
|
|
padding: 12px 20px;
|
|
display: flex;
|
|
align-items: center;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.sidebar .nav-link:hover {
|
|
background: #34495e;
|
|
color: white;
|
|
}
|
|
|
|
.sidebar .nav-link.active {
|
|
background: #3498db;
|
|
color: white;
|
|
}
|
|
|
|
.sidebar .nav-link i {
|
|
margin-right: 10px;
|
|
width: 20px;
|
|
}
|
|
|
|
.main-content {
|
|
margin-left: 250px;
|
|
padding: 20px;
|
|
background: #f8f9fa;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.top-bar {
|
|
background: white;
|
|
padding: 15px 30px;
|
|
margin: -20px -20px 20px -20px;
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.card {
|
|
border: none;
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.dashboard-stat-card {
|
|
transition: all 0.3s ease;
|
|
cursor: pointer;
|
|
border-left: 4px solid transparent;
|
|
}
|
|
|
|
.dashboard-stat-card:hover {
|
|
transform: translateY(-5px);
|
|
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
|
|
border-left-color: #3498db;
|
|
}
|
|
|
|
.dashboard-stat-card h6 {
|
|
font-size: 0.875rem;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.dashboard-stat-card h2 {
|
|
color: #2c3e50;
|
|
font-weight: 700;
|
|
font-size: 2.5rem;
|
|
margin: 10px 0;
|
|
}
|
|
|
|
.stat-link {
|
|
color: #3498db;
|
|
font-size: 0.875rem;
|
|
font-weight: 600;
|
|
display: inline-block;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.dashboard-stat-card:hover .stat-link {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.system-info-card {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
border: none;
|
|
}
|
|
|
|
.system-info-card .card-header {
|
|
background: transparent;
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
|
color: white;
|
|
}
|
|
|
|
.system-info-card .card-body p {
|
|
color: rgba(255, 255, 255, 0.95);
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.btn-group-sm .btn {
|
|
padding: 0.25rem 0.5rem;
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.alert {
|
|
border-radius: 8px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="sidebar" style="height: 100vh; overflow-y: auto; overflow-x: hidden;">
|
|
<div class="brand">
|
|
<i class="bi bi-shop"></i> Sky Art Shop
|
|
</div>
|
|
<nav class="nav flex-column mt-4">
|
|
<a class="nav-link @(ViewContext.RouteData.Values["Action"]?.ToString() == "Dashboard" ? "active" : "")"
|
|
href="/admin/dashboard">
|
|
<i class="bi bi-speedometer2"></i> Dashboard
|
|
</a>
|
|
<hr style="border-color: #34495e; margin: 10px 0;">
|
|
<div class="px-3 text-muted small mb-2">CONTENT</div>
|
|
<a class="nav-link @(ViewContext.RouteData.Values["Controller"]?.ToString() == "AdminPages" ? "active" : "")"
|
|
href="/admin/pages">
|
|
<i class="bi bi-file-earmark-text"></i> Pages
|
|
</a>
|
|
<a class="nav-link @(ViewContext.RouteData.Values["Controller"]?.ToString() == "AdminBlog" ? "active" : "")"
|
|
href="/admin/blog">
|
|
<i class="bi bi-journal-text"></i> Blog
|
|
</a>
|
|
<a class="nav-link @(ViewContext.RouteData.Values["Controller"]?.ToString() == "AdminPortfolio" ? "active" : "")"
|
|
href="/admin/portfolio/categories">
|
|
<i class="bi bi-images"></i> Portfolio
|
|
</a>
|
|
<a class="nav-link @(ViewContext.RouteData.Values["Controller"]?.ToString() == "AdminProducts" ? "active" : "")"
|
|
href="/admin/products">
|
|
<i class="bi bi-cart"></i> Products
|
|
</a>
|
|
<hr style="border-color: #34495e; margin: 10px 0;">
|
|
<div class="px-3 text-muted small mb-2">SETTINGS</div>
|
|
<a class="nav-link @(ViewContext.RouteData.Values["Controller"]?.ToString() == "AdminHomepage" ? "active" : "")"
|
|
href="/admin/homepage">
|
|
<i class="bi bi-house-fill"></i> Homepage Editor
|
|
</a>
|
|
<a class="nav-link @(ViewContext.RouteData.Values["Controller"]?.ToString() == "AdminMenu" ? "active" : "")"
|
|
href="/admin/menu">
|
|
<i class="bi bi-list"></i> Navigation Menu
|
|
</a>
|
|
<a class="nav-link @(ViewContext.RouteData.Values["Controller"]?.ToString() == "AdminSettings" ? "active" : "")"
|
|
href="/admin/settings">
|
|
<i class="bi bi-gear"></i> Site Settings
|
|
</a>
|
|
<a class="nav-link @(ViewContext.RouteData.Values["Controller"]?.ToString() == "AdminUpload" ? "active" : "")"
|
|
href="/admin/upload">
|
|
<i class="bi bi-cloud-upload"></i> Media Upload
|
|
</a>
|
|
<hr style="border-color: #34495e; margin: 10px 0;">
|
|
<a class="nav-link" href="/" target="_blank">
|
|
<i class="bi bi-box-arrow-up-right"></i> View Site
|
|
</a>
|
|
<a class="nav-link" href="/admin/logout">
|
|
<i class="bi bi-box-arrow-right"></i> Logout
|
|
</a>
|
|
</nav>
|
|
</div>
|
|
|
|
<div class="main-content">
|
|
<div class="top-bar">
|
|
<h4 class="mb-0">@ViewData["Title"]</h4>
|
|
<div>
|
|
<span class="text-muted">Welcome, Admin</span>
|
|
</div>
|
|
</div>
|
|
|
|
<partial name="_AdminAlerts" />
|
|
|
|
@RenderBody()
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="https://cdn.ckeditor.com/ckeditor5/40.1.0/classic/ckeditor.js"></script>
|
|
<script src="~/assets/js/admin.js"></script>
|
|
@await RenderSectionAsync("Scripts", required: false)
|
|
</body>
|
|
|
|
</html> |