Fix comments not being disabled if banned

This commit is contained in:
koko 2023-01-26 19:42:59 -05:00 committed by GitHub
commit d44fb89b03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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