- 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
87 lines
3.3 KiB
Plaintext
87 lines
3.3 KiB
Plaintext
@model List<SkyArtShop.Models.MenuItem>
|
|
@{
|
|
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
|
ViewData["Title"] = "Manage Menu";
|
|
}
|
|
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h2>Menu Items</h2>
|
|
<div>
|
|
<form method="post" action="/admin/menu/reseed" style="display:inline;" onsubmit="return confirm('This will delete all existing menu items and create new ones. Continue?')">
|
|
<button type="submit" class="btn btn-warning">Reseed Menu</button>
|
|
</form>
|
|
<a href="/admin/menu/create" class="btn btn-primary">Add Menu Item</a>
|
|
</div>
|
|
</div>
|
|
|
|
@if (TempData["SuccessMessage"] != null)
|
|
{
|
|
<div class="alert alert-success">@TempData["SuccessMessage"]</div>
|
|
}
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Order</th>
|
|
<th>Label</th>
|
|
<th>URL</th>
|
|
<th>Status</th>
|
|
<th>Navbar</th>
|
|
<th>Dropdown</th>
|
|
<th>New Tab</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in Model)
|
|
{
|
|
<tr>
|
|
<td>@item.DisplayOrder</td>
|
|
<td>@item.Label</td>
|
|
<td>@item.Url</td>
|
|
<td>
|
|
@if (item.IsActive)
|
|
{
|
|
<span class="badge bg-success">Active</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="badge bg-secondary">Inactive</span>
|
|
}
|
|
</td>
|
|
<td>
|
|
@if (item.ShowInNavbar)
|
|
{
|
|
<span class="badge bg-primary">Yes</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="badge bg-light text-dark">No</span>
|
|
}
|
|
</td>
|
|
<td>
|
|
@if (item.ShowInDropdown)
|
|
{
|
|
<span class="badge bg-info">Yes</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="badge bg-light text-dark">No</span>
|
|
}
|
|
</td>
|
|
<td>@(item.OpenInNewTab ? "Yes" : "No")</td>
|
|
<td>
|
|
<a href="/admin/menu/edit/@item.Id" class="btn btn-sm btn-warning">Edit</a>
|
|
<form method="post" action="/admin/menu/delete/@item.Id" style="display:inline;" onsubmit="return confirm('Delete this menu item?')">
|
|
<button type="submit" class="btn btn-sm btn-danger">Delete</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|