Fix admin route access and backend configuration
- 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
This commit is contained in:
43
Sky_Art_shop/Views/AdminBlog/Index.cshtml
Normal file
43
Sky_Art_shop/Views/AdminBlog/Index.cshtml
Normal file
@@ -0,0 +1,43 @@
|
||||
@model List<SkyArtShop.Models.BlogPost>
|
||||
@{
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
ViewData["Title"] = "Blog Posts";
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">Blog Posts</h5>
|
||||
<a class="btn btn-primary" href="/admin/blog/create">Create Post</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Slug</th>
|
||||
<th>Published</th>
|
||||
<th>Created</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var post in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@post.Title</td>
|
||||
<td>@post.Slug</td>
|
||||
<td>@(post.IsPublished ? "Yes" : "No")</td>
|
||||
<td>@post.CreatedAt.ToString("MMM dd, yyyy")</td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-secondary" href="/admin/blog/edit/@post.Id">Edit</a>
|
||||
<form method="post" action="/admin/blog/delete/@post.Id" class="d-inline" onsubmit="return confirm('Delete this post?');">
|
||||
<button class="btn btn-sm btn-danger" type="submit">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user