From 5ab816a1584f48a71bc6e42e35b37304e6b691b2 Mon Sep 17 00:00:00 2001 From: NguyenND Date: Thu, 9 Jul 2026 13:05:07 -0400 Subject: [PATCH] Jul 9 - Update Dashboard separate open issue by Handler (add new cards) --- CLAUDE.md | 8 +++--- app/templates/dashboard.html | 56 ++++++++++++++++++++++++------------ 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 96ec372..3ea8d30 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1029,13 +1029,13 @@ The dashboard cards are organised into two labelled sections separated by a divi 4. Pending Follow-ups — inspections with `follow_up_required=True`; links to `inspections.index?status=follow_up` **Issues section** (customers see first 3; staff see all 5): -1. Open Issues — `status=open` with severity breakdown badges (C/H/M/L) **and** a "Handled by" split (Janitorial Staff / Facility Staff / External Vendor) from `handler_breakdown`. -2. Issues Opened Today — `date_from=today&date_to=today`, with a "Handled by" split from `opened_today_handler`. +1. Open Issues — **split into THREE cards** (all roles), one per handler from `handler_breakdown`: **Open · Janitorial** (`handler_type=internal`, bg-primary), **Open · Facility Staff** (`handler_type=facility`, bg-info), **Open · Vendor** (`handler_type=vendor`, bg-warning). Each is a full clickable card linking to `issues.index?status=open&handler_type=...`. (The single total Open-Issues card with severity C/H/M/L badges was replaced by these three; `severity_breakdown` is still passed but no longer rendered on the dashboard.) +2. Issues Opened Today — `date_from=today&date_to=today`, with a compact "Handled by" chip split from `opened_today_handler`. 3. Resolved Today — `status=resolved` + today's date range 4. Pending Verification — `status=pending_verification` -5. Unassigned Open — `status=open&unassigned=1`, with a "Handled by" split from `unassigned_handler`. +5. Unassigned Open — `status=open&unassigned=1`, with a compact "Handled by" chip split from `unassigned_handler`. -**"Handled by" splits (phase35+):** cards 1, 2, and 5 render a handler breakdown via the `handler_chips(bd, base)` **Jinja macro** at the top of `dashboard.html` — full-text labels ("Janitorial N / Facility N / Vendor N") that each link to `issues.index` with the card's own filter (`base`) plus `handler_type=`. Breakdowns come from `_handler_split(list)` over the already-loaded issue lists (`open_issues_all`, `opened_today_all`, `unassigned_all`) — **no extra queries**. These three cards are no longer a single wrapping anchor — the count and each chip are separate links (nested `` is invalid). `issues.index` gained an **`unassigned=1`** filter (`Issue.assigned_to.is_(None)`) so the Unassigned card and its chips link precisely; it is threaded through the list pagination links. +**"Handled by" splits (phase35+):** the three Open-Issue cards are dedicated cards; cards 2 and 5 use the compact `handler_chips(bd, base)` **Jinja macro** at the top of `dashboard.html` — full-text chips ("Janitorial N / Facility N / Vendor N") linking to `issues.index` with the card's own filter (`base`) plus `handler_type=`. All breakdowns come from `_handler_split(list)` over already-loaded issue lists (`open_issues_all`, `opened_today_all`, `unassigned_all`) — **no extra queries**. Cards with inner links are not wrapped in an outer anchor (nested `` is invalid). `issues.index` gained an **`unassigned=1`** filter (`Issue.assigned_to.is_(None)`), threaded through the list pagination links, so the Unassigned card and its chips link precisely. Each card has a subtitle line (or the handler split) explaining what it counts. Section dividers use `d-flex align-items-center gap-2` with a `
` rule. diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index 54059c7..f8c6601 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -156,30 +156,50 @@
+ {# Open issues split into three cards by who handles them. #}
-
+ +
- Open Issues - + Open · Janitorial +
-
-
{{ open_issues }}
-
- {% if open_issues > 0 %} -
- {% if severity_breakdown.critical > 0 %}{{ severity_breakdown.critical }}C {% endif %} - {% if severity_breakdown.high > 0 %}{{ severity_breakdown.high }}H {% endif %} - {% if severity_breakdown.medium > 0 %}{{ severity_breakdown.medium }}M {% endif %} - {% if severity_breakdown.low > 0 %}{{ severity_breakdown.low }}L{% endif %} -
- {# ── Split by who handles it (click to drill in) ── #} - {{ handler_chips(handler_breakdown, {'status': 'open'}) }} - {% else %} -
Active issues not yet resolved
- {% endif %} +
{{ handler_breakdown.internal }}
+
Open issues handled by our crew
+ +
+ + + +