添加项目文件。
This commit is contained in:
57
TightWiki/Views/Admin/Namespaces.cshtml
Normal file
57
TightWiki/Views/Admin/Namespaces.cshtml
Normal file
@@ -0,0 +1,57 @@
|
||||
@model TightWiki.Models.ViewModels.Admin.NamespacesViewModel
|
||||
@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>
|
||||
Namespaces
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
All namespaces contained in the wiki.<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.Get, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}" }))
|
||||
{
|
||||
@if (Model.Namespaces.Count > 0)
|
||||
{
|
||||
<table class="table fixedTable100 table-striped" border="0" 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, "Pages")">Pages</a></strong></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@foreach (var p in Model.Namespaces)
|
||||
{
|
||||
<tr>
|
||||
<td><a href="@GlobalConfiguration.BasePath/Admin/Namespace/@(p.Namespace?? string.Empty)">@(string.IsNullOrEmpty(p.Namespace) ? "(Default)" : p.Namespace)</a></td>
|
||||
<td>@p.CountOfPages.ToString("N0")</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
|
||||
@Html.Raw(TightWiki.Library.PageSelectorGenerator.Generate(Context.Request.QueryString, Model.PaginationPageCount))
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex small text-muted mb-0">
|
||||
<strong>
|
||||
There are currently no pages which exist within namespaces.
|
||||
</strong>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user