ProjectLighthouse/ProjectLighthouse.Servers.Website/Pages/Moderation/ModPanelPage.cshtml
Josh 64b95e807d
Refactor Database class (#616)
Refactor Database into DatabaseContext
Moved into separate folder so it actually has a namespace instead sitting in the root
2023-02-15 23:54:30 -06:00

53 lines
No EOL
1.5 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>