diff --git a/ProjectLighthouse.Servers.Website/Pages/CasePage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/CasePage.cshtml.cs index e5457a3e..64889ea5 100644 --- a/ProjectLighthouse.Servers.Website/Pages/CasePage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/CasePage.cshtml.cs @@ -23,13 +23,25 @@ public class CasePage : BaseLayout { CaseId = 1, CaseCreated = DateTime.Now, - CaseExpires = new DateTime(2023, 11, 17), + CaseExpires = new DateTime(2011, 11, 17), CaseCreatorId = user.UserId, CaseCreator = user, CaseDescription = "Being a dumbass", CaseType = CaseType.UserBan, AffectedId = user.UserId, }); + + this.Cases.Add(new ModerationCase + { + CaseId = 2, + CaseCreated = DateTime.Now, + CaseExpires = new DateTime(2023, 11, 17), + CaseCreatorId = user.UserId, + CaseCreator = user, + CaseDescription = "Being too cool", + CaseType = CaseType.UserSilence, + AffectedId = user.UserId, + }); return this.Page(); } diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/ModerationCasePartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/ModerationCasePartial.cshtml index 9915aa06..ef10e9d7 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Partials/ModerationCasePartial.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/ModerationCasePartial.cshtml @@ -7,18 +7,33 @@ @{ Database database = new(); + string color = Model.Expired ? "red" : "yellow"; } -
Created by @Model.CaseCreator?.Username
-Description: @Model.CaseDescription
+ @if (Model.Expired) + { +Affected level: @slot.Name
} - @if (Model.CaseType.AffectsUser()) + else if (Model.CaseType.AffectsUser()) { User user = await Model.GetUserAsync(database);Affected user: @user.Username
diff --git a/ProjectLighthouse/Administration/ModerationCase.cs b/ProjectLighthouse/Administration/ModerationCase.cs index 6d4b6760..45deac03 100644 --- a/ProjectLighthouse/Administration/ModerationCase.cs +++ b/ProjectLighthouse/Administration/ModerationCase.cs @@ -22,6 +22,7 @@ public class ModerationCase public DateTime CaseCreated { get; set; } public DateTime? CaseExpires { get; set; } + public bool Expired => this.CaseExpires != null && this.CaseExpires < DateTime.Now; public int CaseCreatorId { get; set; }