81 lines
4.0 KiB
Plaintext
81 lines
4.0 KiB
Plaintext
@using MemberCenter.Application.Constants
|
|
@using MemberCenter.Application.Abstractions
|
|
@inject IAdminPermissionChecker AdminPermissionChecker
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Member Center</title>
|
|
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
|
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
|
</head>
|
|
<body>
|
|
<header class="border-bottom mb-4">
|
|
<div class="container py-3 d-flex flex-column gap-3">
|
|
<div class="d-flex justify-content-between align-items-center gap-3 flex-wrap">
|
|
<div>
|
|
<div class="fw-bold">Member Center</div>
|
|
<div class="text-muted small">Client-first member portal</div>
|
|
</div>
|
|
<div class="d-flex gap-2 align-items-center">
|
|
@if (User.Identity?.IsAuthenticated ?? false)
|
|
{
|
|
<span class="text-muted small">@User.Identity!.Name</span>
|
|
<form method="post" asp-area="" asp-controller="Account" asp-action="Logout" class="m-0">
|
|
<button type="submit" class="btn btn-outline-secondary btn-sm">Logout</button>
|
|
</form>
|
|
}
|
|
else
|
|
{
|
|
<a asp-area="" asp-controller="Account" asp-action="Login" class="btn btn-outline-primary btn-sm">Login</a>
|
|
<a asp-area="" asp-controller="Account" asp-action="Register" class="btn btn-primary btn-sm">Register</a>
|
|
}
|
|
</div>
|
|
</div>
|
|
<nav class="d-flex flex-wrap gap-3 align-items-start">
|
|
<div class="d-flex flex-column">
|
|
<span class="text-muted small text-uppercase">Member</span>
|
|
<div class="d-flex gap-3 flex-wrap">
|
|
<a asp-area="" asp-controller="Home" asp-action="Index">Home</a>
|
|
<a asp-area="" asp-controller="Profile" asp-action="Index">Profile</a>
|
|
<a asp-area="" asp-controller="Profile" asp-action="Addresses">Addresses</a>
|
|
<a asp-area="" asp-controller="Profile" asp-action="Subscriptions">Subscriptions</a>
|
|
</div>
|
|
</div>
|
|
@if (User.IsInRole(AdminPermissions.AdminRole) || User.IsInRole(AdminPermissions.SuperuserRole))
|
|
{
|
|
<div class="d-flex flex-column">
|
|
<span class="text-muted small text-uppercase">Admin</span>
|
|
<div class="d-flex gap-3 flex-wrap">
|
|
@foreach (var item in new[]
|
|
{
|
|
new { Permission = AdminPermissions.Home, Controller = "Home", Label = "Overview" },
|
|
new { Permission = AdminPermissions.AccountsIndex, Controller = "Accounts", Label = "Accounts" },
|
|
new { Permission = AdminPermissions.TenantsIndex, Controller = "Tenants", Label = "Tenants" },
|
|
new { Permission = AdminPermissions.NewsletterListsIndex, Controller = "NewsletterLists", Label = "Newsletter Lists" },
|
|
new { Permission = AdminPermissions.SubscriptionsIndex, Controller = "Subscriptions", Label = "Subscriptions" },
|
|
new { Permission = AdminPermissions.OAuthClientsIndex, Controller = "OAuthClients", Label = "OAuth Clients" },
|
|
new { Permission = AdminPermissions.AuditLogsIndex, Controller = "AuditLogs", Label = "Audit Logs" },
|
|
new { Permission = AdminPermissions.SecurityIndex, Controller = "Security", Label = "Security" },
|
|
new { Permission = AdminPermissions.BlacklistIndex, Controller = "Blacklist", Label = "Blacklist" }
|
|
})
|
|
{
|
|
if (await AdminPermissionChecker.HasPermissionAsync(User, item.Permission))
|
|
{
|
|
<a asp-area="Admin" asp-controller="@item.Controller" asp-action="Index">@item.Label</a>
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
</nav>
|
|
</div>
|
|
</header>
|
|
<main class="container">
|
|
@RenderBody()
|
|
</main>
|
|
<script src="~/js/site.js" asp-append-version="true"></script>
|
|
</body>
|
|
</html>
|