mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-09 20:02:26 +00:00
Add moderation cases log page
This commit is contained in:
parent
b51561e943
commit
6c6a7f01f9
14 changed files with 181 additions and 10 deletions
36
ProjectLighthouse.Servers.Website/Pages/CasePage.cshtml.cs
Normal file
36
ProjectLighthouse.Servers.Website/Pages/CasePage.cshtml.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using LBPUnion.ProjectLighthouse.Administration;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||
using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Servers.Website.Pages;
|
||||
|
||||
public class CasePage : BaseLayout
|
||||
{
|
||||
public CasePage(Database database) : base(database)
|
||||
{}
|
||||
|
||||
public List<ModerationCase> Cases = new();
|
||||
|
||||
public async Task<IActionResult> OnGet(int pageNumber)
|
||||
{
|
||||
User? user = this.Database.UserFromWebRequest(this.Request);
|
||||
if (user == null) return this.NotFound();
|
||||
if (!user.IsModerator) return this.NotFound();
|
||||
|
||||
this.Cases.Add(new ModerationCase
|
||||
{
|
||||
CaseId = 1,
|
||||
CaseCreated = DateTime.Now,
|
||||
CaseExpires = new DateTime(2023, 11, 17),
|
||||
CaseCreatorId = user.UserId,
|
||||
CaseCreator = user,
|
||||
CaseDescription = "Being a dumbass",
|
||||
CaseType = CaseType.UserBan,
|
||||
AffectedId = user.UserId,
|
||||
});
|
||||
|
||||
return this.Page();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue