添加项目文件。
This commit is contained in:
57
TightWiki/Views/Admin/Roles.cshtml
Normal file
57
TightWiki/Views/Admin/Roles.cshtml
Normal file
@@ -0,0 +1,57 @@
|
||||
@model TightWiki.Models.ViewModels.Admin.RolesViewModel
|
||||
@using TightWiki.Library
|
||||
@using TightWiki.Models
|
||||
@{
|
||||
Layout = "/Views/Shared/_Layout.cshtml";
|
||||
var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null.");
|
||||
}
|
||||
|
||||
<h3>
|
||||
Roles
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
Global configuration for security roles and membership.<br /><br />
|
||||
</p>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
|
||||
{
|
||||
<div class="alert alert-danger">@Html.Raw(Model.ErrorMessage)</div>
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(Model.SuccessMessage))
|
||||
{
|
||||
<div class="alert alert-success">@Html.Raw(Model.SuccessMessage)</div>
|
||||
}
|
||||
|
||||
@using (Html.BeginForm(null, null, FormMethod.Post, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
@if (Model.Roles.Count > 0)
|
||||
{
|
||||
<table class="table fixedTable100 table-striped" border="0" width="100%" cellspacing="0" cellpadding="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "Name")">Name</a></strong></td>
|
||||
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "Description")">Description</a></strong></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@foreach (var role in Model.Roles)
|
||||
{
|
||||
<tr>
|
||||
<td><a href="@GlobalConfiguration.BasePath/Admin/Role/@role.Name">@role.Name</a></td>
|
||||
<td>@role.Description</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex small text-muted mb-0">
|
||||
<strong>
|
||||
There are no security roles configured.
|
||||
</strong>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user