Jul 9 - Update Dashboard separate open issue by Handler (more viewable)
This commit is contained in:
@@ -2,6 +2,24 @@
|
||||
{% block title %}Dashboard{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{# Handler ("Handled by") breakdown chips for an issue KPI card. `base` is a
|
||||
dict of extra issues.index query params identifying the card's scope. #}
|
||||
{% macro handler_chips(bd, base) %}
|
||||
<div class="mt-1 d-flex flex-wrap align-items-center gap-1" style="font-size:.7rem;">
|
||||
<span style="opacity:.75;">Handled by:</span>
|
||||
{% if bd.internal > 0 %}
|
||||
<a href="{{ url_for('issues.index', handler_type='internal', **base) }}"
|
||||
class="badge bg-primary text-decoration-none" title="Janitorial Staff — our crew">Janitorial {{ bd.internal }}</a>{% endif %}
|
||||
{% if bd.facility > 0 %}
|
||||
<a href="{{ url_for('issues.index', handler_type='facility', **base) }}"
|
||||
class="badge bg-info text-dark text-decoration-none" title="Facility Staff — the facility's own on-site staff">Facility {{ bd.facility }}</a>{% endif %}
|
||||
{% if bd.vendor > 0 %}
|
||||
<a href="{{ url_for('issues.index', handler_type='vendor', **base) }}"
|
||||
class="badge bg-light text-dark border text-decoration-none" title="External Vendor — an outside contractor">Vendor {{ bd.vendor }}</a>{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
<div class="row mb-3 align-items-center">
|
||||
<div class="col">
|
||||
<h2 class="mb-0">Welcome, {{ current_user.display_name }}!</h2>
|
||||
@@ -156,24 +174,7 @@
|
||||
{% if severity_breakdown.low > 0 %}<span class="badge bg-secondary">{{ severity_breakdown.low }}L</span>{% endif %}
|
||||
</div>
|
||||
{# ── Split by who handles it (click to drill in) ── #}
|
||||
<div class="mt-1 d-flex flex-wrap align-items-center gap-1" style="font-size:.7rem;">
|
||||
<span style="opacity:.75;">Handled by:</span>
|
||||
{% if handler_breakdown.internal > 0 %}
|
||||
<a href="{{ url_for('issues.index', status='open', handler_type='internal') }}"
|
||||
class="badge bg-primary text-decoration-none" title="Janitorial Staff">
|
||||
<i class="bi bi-people"></i> {{ handler_breakdown.internal }}
|
||||
</a>{% endif %}
|
||||
{% if handler_breakdown.facility > 0 %}
|
||||
<a href="{{ url_for('issues.index', status='open', handler_type='facility') }}"
|
||||
class="badge bg-info text-dark text-decoration-none" title="Facility Staff">
|
||||
<i class="bi bi-building"></i> {{ handler_breakdown.facility }}
|
||||
</a>{% endif %}
|
||||
{% if handler_breakdown.vendor > 0 %}
|
||||
<a href="{{ url_for('issues.index', status='open', handler_type='vendor') }}"
|
||||
class="badge bg-light text-dark border text-decoration-none" title="External Vendor">
|
||||
<i class="bi bi-person-gear"></i> {{ handler_breakdown.vendor }}
|
||||
</a>{% endif %}
|
||||
</div>
|
||||
{{ handler_chips(handler_breakdown, {'status': 'open'}) }}
|
||||
{% else %}
|
||||
<div class="mt-2" style="font-size:.72rem;opacity:.75;">Active issues not yet resolved</div>
|
||||
{% endif %}
|
||||
@@ -182,18 +183,22 @@
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-md">
|
||||
<a href="{{ url_for('issues.index', date_from=today_str, date_to=today_str) }}" class="text-decoration-none">
|
||||
<div class="card text-white h-100" style="background:#ea580c;">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-start mb-1">
|
||||
<span class="small fw-semibold" style="color:rgba(255,255,255,.6);">Issues Opened Today</span>
|
||||
<i class="bi bi-flag" style="font-size:1.4rem;opacity:.3;"></i>
|
||||
</div>
|
||||
<div class="fs-1 fw-bold lh-1">{{ issues_opened_today }}</div>
|
||||
<a href="{{ url_for('issues.index', date_from=today_str, date_to=today_str) }}" class="text-white text-decoration-none">
|
||||
<div class="fs-1 fw-bold lh-1">{{ issues_opened_today }}</div>
|
||||
</a>
|
||||
{% if issues_opened_today > 0 %}
|
||||
{{ handler_chips(opened_today_handler, {'date_from': today_str, 'date_to': today_str}) }}
|
||||
{% else %}
|
||||
<div class="mt-2" style="font-size:.72rem;opacity:.7;">New issues reported today</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-md">
|
||||
@@ -228,18 +233,22 @@
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-md">
|
||||
<a href="{{ url_for('issues.index', status='open') }}" class="text-decoration-none">
|
||||
<div class="card text-white h-100" style="background:#16a34a;">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-start mb-1">
|
||||
<span class="small fw-semibold" style="color:rgba(255,255,255,.6);">Unassigned Open</span>
|
||||
<i class="bi bi-person-dash" style="font-size:1.4rem;opacity:.3;"></i>
|
||||
</div>
|
||||
<div class="fs-1 fw-bold lh-1">{{ unassigned_open }}</div>
|
||||
<a href="{{ url_for('issues.index', status='open', unassigned='1') }}" class="text-white text-decoration-none">
|
||||
<div class="fs-1 fw-bold lh-1">{{ unassigned_open }}</div>
|
||||
</a>
|
||||
{% if unassigned_open > 0 %}
|
||||
{{ handler_chips(unassigned_handler, {'status': 'open', 'unassigned': '1'}) }}
|
||||
{% else %}
|
||||
<div class="mt-2" style="font-size:.72rem;opacity:.7;">Open issues with no one assigned</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user