@using TightWiki.Models @model TightWiki.Models.ViewModels.Page.PageCommentsViewModel @{ Layout = "/Views/Shared/_Layout.cshtml"; var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null."); }

Comments for @sessionState.Page.Name.

All comment made on the given page.

@if (!string.IsNullOrEmpty(Model.ErrorMessage)) {
@Html.Raw(Model.ErrorMessage)
} @if (!string.IsNullOrEmpty(Model.SuccessMessage)) {
@Html.Raw(Model.SuccessMessage)
} @using (Html.BeginForm(null, null, FormMethod.Post, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}" })) { if (sessionState.IsAuthenticated == true) {
} else { @:Login to leave a comment. } if (Model.Comments.Count > 0) {
@foreach (var h in Model.Comments) {

@Html.Raw(h.Body)

Avatar @if (TightWiki.Models.GlobalConfiguration.EnablePublicProfiles) { @Html.DisplayTextFor(x => h.UserName) } else { @Html.DisplayTextFor(x => h.UserName) }   

@Html.DisplayTextFor(x => h.CreatedDate)

@if (sessionState.CanModerate == true || h.UserId == sessionState.Profile?.UserId) { Delete }
}
} else {
The page does not have any comments, why don't you add one?
} @Html.Raw(TightWiki.Library.PageSelectorGenerator.Generate(Context.Request.QueryString, Model.PaginationPageCount)) }