mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-30 16:58:38 +00:00
Rename /modPanel
to /moderation
This commit is contained in:
parent
f04a8000cf
commit
a6f077725a
11 changed files with 32 additions and 39 deletions
|
@ -4,6 +4,9 @@
|
|||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/ProjectLighthouse" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<envs>
|
||||
<env name="ASPNETCORE_ENVIRONMENT" value="Development" />
|
||||
</envs>
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Lighthouse" type="DotNetProject" factoryName=".NET Project">
|
||||
<option name="EXE_PATH" value="$PROJECT_DIR$/ProjectLighthouse/bin/Debug/net6.0/LBPUnion.ProjectLighthouse" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/ProjectLighthouse" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/ProjectLighthouse/ProjectLighthouse.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="Unloaded" />
|
||||
<option name="PROJECT_TFM" value="net6.0" />
|
||||
<method v="2">
|
||||
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Development Databases" run_configuration_type="docker-deploy" />
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
|
@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore;
|
|||
namespace LBPUnion.ProjectLighthouse.Servers.Website.Controllers.Admin;
|
||||
|
||||
[ApiController]
|
||||
[Route("/modPanel/report/{id:int}")]
|
||||
[Route("/moderation/report/{id:int}")]
|
||||
public class AdminReportController : ControllerBase
|
||||
{
|
||||
private readonly Database database;
|
||||
|
@ -48,7 +48,7 @@ public class AdminReportController : ControllerBase
|
|||
|
||||
await this.database.SaveChangesAsync();
|
||||
|
||||
return this.Redirect("~/modPanel/reports/0");
|
||||
return this.Redirect("~/moderation/reports/0");
|
||||
}
|
||||
|
||||
[HttpGet("dismiss")]
|
||||
|
@ -73,6 +73,6 @@ public class AdminReportController : ControllerBase
|
|||
|
||||
await this.database.SaveChangesAsync();
|
||||
|
||||
return this.Redirect("~/modPanel/reports/0");
|
||||
return this.Redirect("~/moderation/reports/0");
|
||||
}
|
||||
}
|
|
@ -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))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@page "/modPanel/cases/{pageNumber:int}"
|
||||
@page "/moderation/cases/{pageNumber:int}"
|
||||
@using LBPUnion.ProjectLighthouse.Administration
|
||||
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.CasePage
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
}
|
||||
else if(Model.User.IsModerator)
|
||||
{
|
||||
Model.NavigationItemsRight.Add(new PageNavigationItem("Mod Panel", "/modPanel", "user shield"));
|
||||
Model.NavigationItemsRight.Add(new PageNavigationItem("Mod Panel", "/moderation", "user shield"));
|
||||
}
|
||||
Model.NavigationItemsRight.Add(new PageNavigationItem("Log out", "/logout", "user alternate slash")); // should always be last
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue