Files
PowderCoatingLogix/src/PowderCoating.Web/Views/PowderInsights/_JobPowderSummary.cshtml
T
spouliot 64a9c1531b Fix — HTML entity rendering across 60 views
Razor's @() expression auto-encodes &, turning — into — which
rendered as literal text in the browser. Wrapped all such expressions in
@Html.Raw() so the em-dash entity is passed through unescaped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 09:27:45 -04:00

75 lines
3.3 KiB
Plaintext

@model PowderCoating.Application.DTOs.Powder.JobPowderSummaryDto
@if (!Model.Coats.Any())
{
<p class="text-muted small">No coats with powder estimates on this job.</p>
}
else
{
<div class="table-responsive">
<table class="table table-sm mb-0">
<thead>
<tr class="table-light">
<th>Item / Coat</th>
<th class="text-end">Est.</th>
<th class="text-end">Actual</th>
<th class="text-end">Var.</th>
</tr>
</thead>
<tbody>
@foreach (var coat in Model.Coats)
{
<tr>
<td class="small">
<span class="text-muted">@coat.ItemDescription</span>
<br />@coat.CoatName
@if (!string.IsNullOrEmpty(coat.ColorName))
{
<span class="text-muted"> · @coat.ColorName</span>
}
</td>
<td class="text-end small">@Html.Raw(coat.EstimatedLbs.HasValue ? $"{coat.EstimatedLbs:0.##}" : "&mdash;")</td>
<td class="text-end small">
@if (coat.IsRecorded)
{
<span class="text-success fw-semibold">@coat.ActualLbs!.Value.ToString("0.##")</span>
}
else
{
<span class="text-muted fst-italic">pending</span>
}
</td>
<td class="text-end small">
@if (coat.VarianceLbs.HasValue)
{
var cls = coat.VarianceLbs > 0 ? "text-danger" : "text-success";
var sign = coat.VarianceLbs > 0 ? "+" : "";
<span class="@cls">@sign@coat.VarianceLbs.Value.ToString("0.##")</span>
}
else
{
<span class="text-muted">&mdash;</span>
}
</td>
</tr>
}
</tbody>
@if (Model.Coats.Count > 1)
{
<tfoot>
<tr class="fw-semibold table-light">
<td>Total</td>
<td class="text-end">@Model.TotalEstimatedLbs.ToString("0.##") lbs</td>
<td class="text-end @(Model.TotalActualLbs > 0 ? "text-success" : "")">
@Html.Raw(Model.TotalActualLbs > 0 ? $"{Model.TotalActualLbs:0.##} lbs" : "&mdash;")
</td>
<td class="text-end @(Model.TotalVarianceLbs > 0 ? "text-danger" : Model.TotalVarianceLbs < 0 ? "text-success" : "")">
@Html.Raw(Model.TotalActualLbs > 0 ? $"{(Model.TotalVarianceLbs > 0 ? "+" : "")}{Model.TotalVarianceLbs:0.##} lbs" : "&mdash;")
</td>
</tr>
</tfoot>
}
</table>
</div>
}