Add hover tooltips on job list rows showing description and PO number
Adds CustomerPO to JobListDto (maps by convention), then builds a Bootstrap tooltip per row with description · PO: xxx, skipping blank fields. Rows with neither get no tooltip. Helps identify jobs at a glance without opening the details page. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -191,7 +191,14 @@
|
||||
var isHot = job.DueDate.HasValue && job.DueDate.Value < DateTime.Now
|
||||
&& job.StatusCode != "COMPLETED" && job.StatusCode != "READYFORPICKUP"
|
||||
&& job.StatusCode != "DELIVERED" && job.StatusCode != "CANCELLED";
|
||||
<tr class="job-row" data-job-id="@job.Id" style="cursor: pointer;">
|
||||
var tipParts = new List<string>();
|
||||
if (!string.IsNullOrWhiteSpace(job.Description)) tipParts.Add(job.Description);
|
||||
if (!string.IsNullOrWhiteSpace(job.CustomerPO)) tipParts.Add("PO: " + job.CustomerPO);
|
||||
var tipText = string.Join(" · ", tipParts);
|
||||
<tr class="job-row" data-job-id="@job.Id" style="cursor: pointer;"
|
||||
@if (!string.IsNullOrEmpty(tipText)) {
|
||||
<text>data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="@Html.Encode(tipText)"</text>
|
||||
}>
|
||||
<td class="ps-4 @(isHot ? "job-hot-cell" : "")">
|
||||
<div>
|
||||
<div class="mono fw-500">
|
||||
@@ -629,6 +636,10 @@
|
||||
loadJobStatuses();
|
||||
loadJobPriorities();
|
||||
|
||||
// Row tooltips (description + PO)
|
||||
document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el =>
|
||||
new bootstrap.Tooltip(el, { trigger: 'hover' }));
|
||||
|
||||
// / key focuses search input
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === '/' && document.activeElement.tagName !== 'INPUT' && document.activeElement.tagName !== 'TEXTAREA') {
|
||||
|
||||
Reference in New Issue
Block a user