@page @using Models; @using System.Globalization @using System.Security.Claims; @model WebApp.Pages.ComplaintModel @{ Complaint complaint = (Complaint)ViewData["complaint"]; ViewData["Title"] = $"{complaint.Title}"; }

@complaint.Title

Filed @complaint.PublishDate.ToString("g") by @complaint.Author.Name

@complaint.Status - @complaint.Severity


@Html.Raw(complaint.Description.Replace(Environment.NewLine, "
"))


Comments

@if (complaint.Responses.Count() == 0) {

No comments found

} else { foreach (Comment comment in complaint.Responses) { DisplayComment(comment, 0); } } Add reply @{ void DisplayComment(Comment comment, int level) {
@for (int i = 0; i < level; i++) { }
@comment.Author.Name @Html.Raw((comment.Author.Role == UserRole.ADMIN || comment.Author.Role == UserRole.MANAGER) ? $"({CultureInfo.CurrentCulture.TextInfo.ToTitleCase(comment.Author.Role.ToString().ToLower())})" : "")
@comment.PublishDate.ToString("g")

@Html.Raw(comment.Description.Replace(Environment.NewLine, "
"))

@if (comment.Responses.Count != 0) { foreach (var response in comment.Responses) { DisplayComment(response, level + 1); } }
} }