ProjectLighthouse/ProjectLighthouse.Servers.Website/Pages/Moderation/ModPanelPage.cshtml
Josh b3a00da554
Refactor deserialization and authentication (#550)
* Refactor deserialization and more

* Refactor authentication flow

* Fix unit tests

* Make deserialization better
2022-11-10 21:14:16 -06:00

53 lines
No EOL
1.5 KiB
Text

@page "/moderation"
@using System.Diagnostics
@using LBPUnion.ProjectLighthouse.Administration
@using LBPUnion.ProjectLighthouse.Extensions
@using LBPUnion.ProjectLighthouse.Localization.StringLists
@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>