Add comment form max char limit validation (#722)

* Add comment form max char limit validation, minor visual nitpick

* Italicize banned/disabled/etc messages within comments
This commit is contained in:
koko 2023-03-30 02:03:12 -04:00 committed by GitHub
commit 89877d359f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -15,13 +15,11 @@
<div class="ui yellow segment" id="comments"> <div class="ui yellow segment" id="comments">
@if (Model.Comments.Count == 0 && Model.CommentsEnabled) @if (Model.Comments.Count == 0 && Model.CommentsEnabled)
{ {
<p>There are no comments.</p> <p><i>There are no comments.</i></p>
} }
else if (!Model.CommentsEnabled) else if (!Model.CommentsEnabled)
{ {
<b> <p><i>Comments are disabled.</i></p>
<i>Comments are disabled.</i>
</b>
} }
else else
{ {
@ -34,7 +32,7 @@
<div class="ui divider"></div> <div class="ui divider"></div>
<form class="ui reply form" action="@Url.RouteUrl(ViewContext.RouteData.Values)/postComment" method="post"> <form class="ui reply form" action="@Url.RouteUrl(ViewContext.RouteData.Values)/postComment" method="post">
<div class="field"> <div class="field">
<textarea style="min-height: 70px; height: 70px; max-height:120px" name="msg"></textarea> <textarea style="min-height: 70px; height: 70px; max-height:120px" maxlength="100" name="msg"></textarea>
</div> </div>
<input type="submit" class="ui blue button"> <input type="submit" class="ui blue button">
</form> </form>

View file

@ -181,7 +181,7 @@
@if (Model.ProfileUser.IsBanned) @if (Model.ProfileUser.IsBanned)
{ {
<div class="ui yellow segment" id="comments"> <div class="ui yellow segment" id="comments">
<p>Comments are disabled because the user is banned.</p> <p><i>Comments are disabled because the user is banned.</i></p>
</div> </div>
} }
else else