mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-31 01:08:41 +00:00
Rename /modPanel
to /moderation
This commit is contained in:
parent
f04a8000cf
commit
a6f077725a
11 changed files with 32 additions and 39 deletions
|
@ -41,7 +41,7 @@ else
|
|||
}
|
||||
}
|
||||
|
||||
<a class="ui blue button" href="/modPanel">
|
||||
<a class="ui blue button" href="/moderation">
|
||||
<i class="user shield icon"></i>
|
||||
<span>View Mod Panel</span>
|
||||
</a>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
@page "/modPanel"
|
||||
@page "/moderation"
|
||||
@using System.Diagnostics
|
||||
@using LBPUnion.ProjectLighthouse.Administration
|
||||
@using LBPUnion.ProjectLighthouse.Extensions
|
||||
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Admin.ModPanelPage
|
||||
|
@ -6,8 +7,19 @@
|
|||
@{
|
||||
Layout = "Layouts/BaseLayout";
|
||||
Model.Title = "Moderation Panel";
|
||||
|
||||
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>Hello, <b>@Model.User.Username.</b></p>
|
||||
|
||||
@if (!this.Request.IsMobile())
|
||||
{
|
||||
<div class="ui grid">
|
||||
|
|
|
@ -19,8 +19,8 @@ public class ModPanelPage : BaseLayout
|
|||
if (user == null) return this.Redirect("~/login");
|
||||
if (!user.IsModerator) return this.NotFound();
|
||||
|
||||
this.Statistics.Add(new AdminPanelStatistic("Reports", await StatisticsHelper.ReportCount(), "/modPanel/reports/0"));
|
||||
this.Statistics.Add(new AdminPanelStatistic("Cases", await StatisticsHelper.CaseCount(), "/modPanel/cases/0"));
|
||||
this.Statistics.Add(new AdminPanelStatistic("Reports", await StatisticsHelper.ReportCount(), "/moderation/reports/0"));
|
||||
this.Statistics.Add(new AdminPanelStatistic("Cases", await StatisticsHelper.CaseCount(), "/moderation/cases/0"));
|
||||
|
||||
return this.Page();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@page "/modPanel/reports/{pageNumber:int}"
|
||||
@page "/moderation/reports/{pageNumber:int}"
|
||||
@using LBPUnion.ProjectLighthouse.Administration.Reports
|
||||
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Admin.ReportsPage
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
|||
|
||||
<p>There are @Model.ReportCount total reports.</p>
|
||||
|
||||
<form action="/modPanel/reports/0">
|
||||
<form action="/moderation/reports/0">
|
||||
<div class="ui icon input">
|
||||
<input type="text" name="name" placeholder="Search reports..." value="@Model.SearchValue">
|
||||
<i class="search icon"></i>
|
||||
|
@ -69,11 +69,11 @@
|
|||
</div>
|
||||
<br>
|
||||
|
||||
<a class="ui green small button" href="/modPanel/report/@report.ReportId/dismiss">
|
||||
<a class="ui green small button" href="/moderation/report/@report.ReportId/dismiss">
|
||||
<i class="checkmark icon"></i>
|
||||
<span>Dismiss</span>
|
||||
</a>
|
||||
<a class="ui red small button" href="/modPanel/report/@report.ReportId/remove">
|
||||
<a class="ui red small button" href="/moderation/report/@report.ReportId/remove">
|
||||
<i class="trash icon"></i>
|
||||
<span>Remove all related assets</span>
|
||||
</a>
|
||||
|
@ -239,10 +239,10 @@
|
|||
|
||||
@if (Model.PageNumber != 0)
|
||||
{
|
||||
<a href="/modPanel/reports/@(Model.PageNumber - 1)@(Model.SearchValue.Length == 0 ? "" : "?name=" + Model.SearchValue)">Previous Page</a>
|
||||
<a href="/moderation/reports/@(Model.PageNumber - 1)@(Model.SearchValue.Length == 0 ? "" : "?name=" + Model.SearchValue)">Previous Page</a>
|
||||
}
|
||||
@(Model.PageNumber + 1) / @(Model.PageAmount)
|
||||
@if (Model.PageNumber < Model.PageAmount - 1)
|
||||
{
|
||||
<a href="/modPanel/reports/@(Model.PageNumber + 1)@(Model.SearchValue.Length == 0 ? "" : "?name=" + Model.SearchValue)">Next Page</a>
|
||||
<a href="/moderation/reports/@(Model.PageNumber + 1)@(Model.SearchValue.Length == 0 ? "" : "?name=" + Model.SearchValue)">Next Page</a>
|
||||
}
|
|
@ -28,7 +28,7 @@ public class ReportsPage : BaseLayout
|
|||
{
|
||||
User? user = this.Database.UserFromWebRequest(this.Request);
|
||||
if (user == null) return this.Redirect("~/login");
|
||||
if (!user.IsAdmin) return this.NotFound();
|
||||
if (!user.IsModerator) return this.NotFound();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(name)) name = "";
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class ReportsPage : BaseLayout
|
|||
this.PageAmount = Math.Max(1, (int)Math.Ceiling((double)this.ReportCount / ServerStatics.PageSize));
|
||||
|
||||
if (this.PageNumber < 0 || this.PageNumber >= this.PageAmount)
|
||||
return this.Redirect($"/modPanel/reports/{Math.Clamp(this.PageNumber, 0, this.PageAmount - 1)}");
|
||||
return this.Redirect($"/moderation/reports/{Math.Clamp(this.PageNumber, 0, this.PageAmount - 1)}");
|
||||
|
||||
this.Reports = await this.Database.Reports.Include(r => r.ReportingPlayer)
|
||||
.Where(r => r.ReportingPlayer.Username.Contains(this.SearchValue))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue