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