Jul 9 - Update Dashboard separate open issue by Handler (add new cards)
This commit is contained in:
@@ -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 `<a>` 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 `<a>` 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 `<div style="flex:1;height:1px;background:#e2e8f0;">` rule.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user