Add moderation cases log page

This commit is contained in:
jvyden 2022-06-10 21:21:27 -04:00
parent b51561e943
commit 6c6a7f01f9
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
14 changed files with 181 additions and 10 deletions

View 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();
}
}