Show comments section on userpage even if there are no comments

This commit is contained in:
jvyden 2021-12-10 14:31:46 -05:00
commit 90f70238d1
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -81,21 +81,24 @@
</div>
}
@if (Model.ProfileUser.Comments > 0)
{
<div class="ui yellow segment">
<h1>Comments</h1>
@foreach (Comment comment in Model.Comments!)
{
DateTimeOffset timestamp = DateTimeOffset.FromUnixTimeSeconds(comment.Timestamp / 1000);
<div>
<b><a href="/user/@comment.PosterUserId">@comment.Poster.Username</a>: </b>
<span>@comment.Message</span>
<p>
<i>@timestamp.ToString("MM/dd/yyyy @ h:mm tt") UTC</i>
</p>
<div class="ui divider"></div>
</div>
}
</div>
}
<div class="ui yellow segment">
<h1>Comments</h1>
@if (Model.ProfileUser.Comments == 0)
{
<p>There are no comments.</p>
}
@foreach (Comment comment in Model.Comments!)
{
DateTimeOffset timestamp = DateTimeOffset.FromUnixTimeSeconds(comment.Timestamp / 1000);
<div>
<b><a href="/user/@comment.PosterUserId">@comment.Poster.Username</a>: </b>
<span>@comment.Message</span>
<p>
<i>@timestamp.ToString("MM/dd/yyyy @ h:mm tt") UTC</i>
</p>
<div class="ui divider"></div>
</div>
}
</div>