Website QOL Changes (#646)

so Mike stops complaining about the neglected mod menu - sudokoko

Co-authored-by: Dagg <daggintosh@outlook.com>
This commit is contained in:
koko 2023-01-26 18:29:54 -05:00 committed by GitHub
commit 141d955f52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 8 deletions

5
.gitpod.yml Normal file
View file

@ -0,0 +1,5 @@
image: gitpod/workspace-dotnet
vscode:
extensions:
- muhammad-sammy.csharp

View file

@ -4,8 +4,8 @@
@{
Layout = "Layouts/BaseLayout";
Model.Title = "Not Found";
Model.Description = "The page was not found.";
Model.Description = "The requested page or resource could not be found.";
}
<p>@Model.Description</p>
<p>This may be due to a lack of permission such as not being signed in, or maybe the page just isn't there.</p>
<p>You may need to sign in to view this page.</p>

View file

@ -16,12 +16,20 @@
{
<p>There are no comments.</p>
}
else if (Model.ProfileUser.IsBanned)
{
<p>Comments are disabled because the user is banned.</p>
}
else if (!Model.CommentsEnabled)
{
<b>
<i>Comments are disabled.</i>
</b>
}
else if (Model.Comments.Count > 50)
{
<p>There are more than 50 comments. Displaying the newest ones.</p>
}
else
{
int count = Model.Comments.Count;

View file

@ -23,18 +23,21 @@
@if (Model.ProfileUser.IsBanned)
{
<div class="ui inverted red segment">
<h2>User is currently banned!</h2>
@if (Model.User != null && Model.User.IsModerator)
{
<h3 style="margin-bottom:3px;"><i class="ban icon"></i> There is an active moderation case on this account.</h3>
<b>Reason:</b>
<span>"@Model.ProfileUser.BannedReason"</span>
<span>"@Model.ProfileUser.BannedReason"</span><br>
<b>Case ID:</b>
<span>@Model.Case?.CaseId</span>
<p>
<i>Note: Only you and other moderators may view the ban reason.</i>
<i>Only you and other moderators may view the ban reason.</i>
</p>
}
else
{
<p>For shame...</p>
<h3 style="margin-bottom:3px;"><i class="ban icon"></i> This user is currently banned.</h3>
<p>Users who violate our Community Guidelines will be moderated. Be sure to follow the rules!</p>
}
</div>
}
@ -269,7 +272,17 @@
<div class="ui fitted hidden divider"></div>
}
@if (Model.ProfileUser.CommentsEnabled)
@if (Model.ProfileUser.IsBanned && Model.Case != null)
{
<div>
<a class="ui red button" href="moderation/case/@Model.Case.CaseId/dismiss">
<i class="unlock icon"></i>
<span>Unban User</span>
</a>
</div>
}
@if (Model.ProfileUser.CommentsEnabled && !Model.ProfileUser.IsBanned)
{
<div>
<a class="ui yellow button" href="/moderation/newCase?type=@((int)CaseType.UserDisableComments)&affectedId=@Model.ProfileUser.UserId">
@ -283,7 +296,7 @@
<div>
<a class="ui red button" href="/moderation/user/@Model.ProfileUser.UserId/wipePlanets">
<i class="trash alternate icon"></i>
<span>Wipe user's earth decorations</span>
<span>Wipe User Earth Decorations</span>
</a>
</div>
<div class="ui fitted hidden divider"></div>

View file

@ -4,6 +4,7 @@ using LBPUnion.ProjectLighthouse.Levels;
using LBPUnion.ProjectLighthouse.PlayerData;
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
using LBPUnion.ProjectLighthouse.Administration;
using LBPUnion.ProjectLighthouse.Types;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
@ -24,6 +25,8 @@ public class UserPage : BaseLayout
public List<Slot>? HeartedSlots;
public List<Slot>? QueuedSlots;
public ModerationCase? Case;
public User? ProfileUser;
public UserPage(Database database) : base(database)
{}