@model List @using PowderCoating.Core.Enums @{ ViewData["Title"] = "Bug Reports"; ViewData["PageIcon"] = "bi-bug"; var sortCol = ViewBag.SortColumn as string ?? "CreatedAt"; var sortDir = ViewBag.SortDirection as string ?? "desc"; int totalCount = ViewBag.TotalCount ?? 0; int pageNumber = ViewBag.PageNumber ?? 1; int pageSize = ViewBag.PageSize ?? 25; int totalPages = ViewBag.TotalPages ?? 1; string NextDir(string col) => sortCol == col && sortDir == "asc" ? "desc" : "asc"; string SortIcon(string col) => sortCol == col ? (sortDir == "asc" ? "bi-sort-up" : "bi-sort-down") : "bi-arrow-down-up text-muted"; } @section Styles { }
@if (TempData["SuccessMessage"] != null) { } @if (TempData["ErrorMessage"] != null) { }
@if (!Model.Any()) {

No bug reports found.

} else {
@foreach (var report in Model) { }
Title Priority Status Submitted By Company Submitted
@report.Title
@report.Description
@{ var priClass = report.Priority switch { BugReportPriority.Critical => "bg-danger", BugReportPriority.High => "bg-warning text-dark", BugReportPriority.Normal => "bg-primary", _ => "bg-secondary" }; } @report.Priority @{ var statusClass = report.Status switch { BugReportStatus.New => "bg-info text-dark", BugReportStatus.InProgress => "bg-warning text-dark", BugReportStatus.Completed => "bg-success", BugReportStatus.Cancelled => "bg-secondary", _ => "bg-secondary" }; var statusLabel = report.Status switch { BugReportStatus.InProgress => "In Progress", _ => report.Status.ToString() }; } @statusLabel @report.SubmittedByUserName @report.CompanyId @report.CreatedAt.Tz(ViewBag.CompanyTimeZone as string).ToString("MM/dd/yyyy h:mm tt") Edit
@foreach (var report in Model) { var mPriClass = report.Priority switch { BugReportPriority.Critical => "bg-danger", BugReportPriority.High => "bg-warning text-dark", BugReportPriority.Normal => "bg-primary", _ => "bg-secondary" }; var mStatusClass = report.Status switch { BugReportStatus.New => "bg-info text-dark", BugReportStatus.InProgress => "bg-warning text-dark", BugReportStatus.Completed => "bg-success", BugReportStatus.Cancelled => "bg-secondary", _ => "bg-secondary" }; var mStatusLabel = report.Status switch { BugReportStatus.InProgress => "In Progress", _ => report.Status.ToString() };
@report.Title
@report.CreatedAt.Tz(ViewBag.CompanyTimeZone as string).ToString("MM/dd/yyyy h:mm tt")
Status @mStatusLabel
Priority @report.Priority
Reporter @report.SubmittedByUserName
@if (report.CompanyId > 0) {
Company ID @report.CompanyId
}
}
@if (totalPages > 1) {
Showing @((pageNumber - 1) * pageSize + 1)–@(Math.Min(pageNumber * pageSize, totalCount)) of @totalCount
} }