@model List @{ Layout = null; var workers = (ViewBag.Workers as IEnumerable) ?? Array.Empty(); var currentWorkerId = ViewBag.CurrentWorkerId as string; var allStatuses = ViewBag.AllStatuses as List ?? new(); var activeCount = Model.Count; } Shop Floor

Shop Floor

@activeCount active
@if (workers.Any()) {
All @foreach (var w in workers) { @w.Name }
} @{ var grouped = Model.GroupBy(j => new { j.StatusDisplayOrder, j.StatusDisplayName, j.StatusColorClass }) .OrderBy(g => g.Key.StatusDisplayOrder); } @if (!Model.Any()) {
All clear!

No active jobs@(currentWorkerId != null ? " assigned to this worker" : "").

} else { @foreach (var group in grouped) {
  @group.Key.StatusDisplayName (@group.Count())
@foreach (var job in group.OrderBy(j => j.DueDate).ThenBy(j => j.JobNumber)) { var priorityColors = new Dictionary { ["success"] = "#198754", ["info"] = "#0dcaf0", ["warning"] = "#ffc107", ["danger"] = "#dc3545", ["dark"] = "#212529", ["secondary"] = "#6c757d", ["primary"] = "#0d6efd", }; var stripColor = priorityColors.GetValueOrDefault(job.PriorityColorClass, "#6c757d"); var isOverdue = job.DueDate.HasValue && job.DueDate.Value < DateTime.Now;
@job.JobNumber
@if (job.IntakeCompleted) { } else { } @if (isOverdue) { Overdue }
@job.CustomerName
@job.TotalPieces pc@(job.TotalPieces != 1 ? "s" : "") @if (!string.IsNullOrEmpty(job.AssignedWorkerName)) { @job.AssignedWorkerName } @if (job.HasSandblasting) { Blast } @if (job.HasMasking) { Mask } @if (job.DueDate.HasValue) { @job.DueDate.Value.ToString("MMM d") }
@if (job.Items.Any()) {
@foreach (var item in job.Items.Take(3)) {
×@((int)item.Quantity) @item.Description
} @if (job.Items.Count > 3) {
+ @(job.Items.Count - 3) more item@(job.Items.Count - 3 != 1 ? "s" : "")
}
} @if (job.Colors.Any()) {
@foreach (var color in job.Colors) { @color }
} @if (!string.IsNullOrEmpty(job.SpecialInstructions)) {
@job.SpecialInstructions
}
@if (job.NextStatusId.HasValue) { } else {
Final Stage
}
} } }