- 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
59 lines
2.4 KiB
Plaintext
59 lines
2.4 KiB
Plaintext
@model List<SkyArtShop.Models.PortfolioProject>
|
|
@{
|
|
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
|
ViewData["Title"] = "Portfolio Projects";
|
|
var categories = ViewBag.Categories as List<SkyArtShop.Models.PortfolioCategory> ?? new();
|
|
var selected = ViewBag.SelectedCategory as string;
|
|
}
|
|
<div class="card mb-3">
|
|
<div class="card-body d-flex justify-content-between align-items-center">
|
|
<h5 class="mb-0">Projects</h5>
|
|
<a class="btn btn-primary" href="/admin/portfolio/project/create">Create Project</a>
|
|
</div>
|
|
</div>
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<form method="get" class="row g-2 mb-3">
|
|
<div class="col-auto">
|
|
<select name="categoryId" class="form-select" onchange="this.form.submit()">
|
|
<option value="">All Categories</option>
|
|
@foreach (var c in categories)
|
|
{
|
|
<option value="@c.Id" selected="@(selected == c.Id ? "selected" : null)">@c.Name</option>
|
|
}
|
|
</select>
|
|
</div>
|
|
<div class="col-auto">
|
|
<a class="btn btn-secondary" href="/admin/portfolio/projects">Reset</a>
|
|
</div>
|
|
</form>
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Title</th>
|
|
<th>Category</th>
|
|
<th>Order</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var p in Model)
|
|
{
|
|
var catName = categories.FirstOrDefault(c => c.Id == p.CategoryId)?.Name ?? "-";
|
|
<tr>
|
|
<td>@p.Title</td>
|
|
<td>@catName</td>
|
|
<td>@p.DisplayOrder</td>
|
|
<td>
|
|
<a class="btn btn-sm btn-secondary" href="/admin/portfolio/project/edit/@p.Id">Edit</a>
|
|
<form method="post" action="/admin/portfolio/project/delete/@p.Id" class="d-inline" onsubmit="return confirm('Delete this project?');">
|
|
<button class="btn btn-sm btn-danger" type="submit">Delete</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|