ProjectLighthouse/ProjectLighthouse.Servers.Website/Pages/Moderation/ModPanelPage.cshtml

64 lines
No EOL
1.9 KiB
Text

@page "/moderation"
@using System.Diagnostics
@using LBPUnion.ProjectLighthouse.Extensions
@using LBPUnion.ProjectLighthouse.Localization.StringLists
@using LBPUnion.ProjectLighthouse.Servers.Website.Types
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Moderation.ModPanelPage
@{
Layout = "Layouts/BaseLayout";
Model.Title = Model.Translate(ModPanelStrings.ModPanelTitle);
if (Model.User == null) throw new ArgumentNullException($"{nameof(Model)}.{nameof(User)}");
// Technically, this should never happen but I'm going to handle it anyways.
if (!Model.User.IsModerator)
{
if (Debugger.IsAttached) Debugger.Break();
throw new Exception("Tried to render mod panel with user whose not mod somehow???");
}
}
<p>@Model.Translate(ModPanelStrings.Greeting, Model.User.Username)</p>
@if (!this.Request.IsMobile())
{
<div class="ui grid">
@foreach (AdminPanelStatistic statistic in Model.Statistics)
{
@await Html.PartialAsync("Partials/AdminPanelStatisticPartial", statistic)
}
</div>
<br>
}
else
{
@foreach (AdminPanelStatistic statistic in Model.Statistics)
{
@await Html.PartialAsync("Partials/AdminPanelStatisticPartial", statistic)
<br>
}
}
<h2>Actions</h2>
<a href="/moderation/bannedUsers/0" class="ui red button">
<i class="users icon"></i>
<span>View banned users</span>
</a><br/><br/>
<a href="/moderation/hiddenLevels/0" class="ui yellow button">
<i class="globe americas icon"></i>
<span>View hidden levels</span>
</a>
<div class="ui divider"></div>
<form method="post" action="/moderation/findStoryLevel">
@Html.AntiForgeryToken()
<div class="ui left action input">
<button type="submit" class="ui blue button">
<span>Find Story Level</span>
</button>
<input type="text" name="placeholderSlotId" placeholder="Level ID" minlength="1" pattern="^\d*$" required>
</div>
</form>