Revert PRs #646 and #647

This commit is contained in:
Slendy 2023-01-26 19:45:20 -06:00
commit e061987165
No known key found for this signature in database
GPG key ID: 7288D68361B91428
5 changed files with 63 additions and 95 deletions

View file

@ -1,5 +0,0 @@
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 requested page or resource could not be found.";
Model.Description = "The page was not found.";
}
<p>@Model.Description</p>
<p>You may need to sign in to view this page.</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>

View file

@ -1,4 +1,4 @@
@using System.Web
@using System.Web
@using System.IO
@using LBPUnion.ProjectLighthouse.Localization
@using LBPUnion.ProjectLighthouse.PlayerData.Profiles
@ -16,27 +16,19 @@
{
<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;
<p>There @(count == 1 ? "is" : "are") @count comment@(count == 1 ? "" : "s").</p>
}
@if (!Model.ProfileUser.IsBanned && Model.CommentsEnabled && Model.User != null)
@if (Model.CommentsEnabled && Model.User != null)
{
<div class="ui divider"></div>
<form class="ui reply form" action="@Url.RouteUrl(ViewContext.RouteData.Values)/postComment" method="post">
@ -51,8 +43,6 @@
}
}
@if (!Model.ProfileUser.IsBanned)
{
@for(int i = 0; i < Model.Comments.Count; i++)
{
Comment comment = Model.Comments[i];
@ -112,7 +102,6 @@
</div>
</div>
}
}
<script>
function deleteComment(commentId){
if (window.confirm("Are you sure you want to delete this?\nThis action cannot be undone.")){

View file

@ -23,21 +23,18 @@
@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><br>
<b>Case ID:</b>
<span>@Model.Case?.CaseId</span>
<span>"@Model.ProfileUser.BannedReason"</span>
<p>
<i>Only you and other moderators may view the ban reason.</i>
<i>Note: Only you and other moderators may view the ban reason.</i>
</p>
}
else
{
<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>
<p>For shame...</p>
}
</div>
}
@ -272,17 +269,7 @@
<div class="ui fitted hidden divider"></div>
}
@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)
@if (Model.ProfileUser.CommentsEnabled)
{
<div>
<a class="ui yellow button" href="/moderation/newCase?type=@((int)CaseType.UserDisableComments)&affectedId=@Model.ProfileUser.UserId">
@ -296,7 +283,7 @@
<div>
<a class="ui red button" href="/moderation/user/@Model.ProfileUser.UserId/wipePlanets">
<i class="trash alternate icon"></i>
<span>Wipe User Earth Decorations</span>
<span>Wipe user's earth decorations</span>
</a>
</div>
<div class="ui fitted hidden divider"></div>

View file

@ -4,7 +4,6 @@ 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;
@ -25,8 +24,6 @@ public class UserPage : BaseLayout
public List<Slot>? HeartedSlots;
public List<Slot>? QueuedSlots;
public ModerationCase? Case;
public User? ProfileUser;
public UserPage(Database database) : base(database)
{}