{% extends "base.html" %} {% block title %}Dashboard - DEICMS{% endblock %} {% block content %}
Dashboard Welcome back, {{ current_user.full_name }} {{ current_user.role }}
{% if not has_case_access %}
No cases have been shared with you yet.
A Lead Investigator or Admin can add you as a case member. Once that happens, this dashboard will show the cases and evidence you may access. Your own account activity is shown below.
{% endif %}
{{ total_cases }}
{{ scope_word }} Cases
{{ total_evidence }}
Evidence Items
{{ total_transfers }}
Custody Transfers
{{ total_audits }}
Audit Records
{% if panels.risk_chart or panels.lifecycle_chart %}
{% if panels.risk_chart %}
Evidence Risk Distribution
{% endif %} {% if panels.lifecycle_chart %}
Evidence Lifecycle States
{% endif %}
{% endif %} {% if panels.activity_chart or panels.audit_chart %}
{% if panels.activity_chart %}
{{ charts.activity_title }}
{% endif %} {% if panels.audit_chart %}
Audit Events by Type {% if not current_user.is_admin() %} (your cases) {% endif %}
{% endif %}
{% endif %} {% if panels.security_alerts and security_alerts %}
Security Alerts
{{ security_alerts.failed_24h }} failed login attempt(s) in the last 24 hours
{% if security_alerts.locked_accounts %}
{{ security_alerts.locked_accounts | length }} locked account(s):
    {% for inv in security_alerts.locked_accounts %}
  • {{ inv.full_name }} ({{ inv.email }}) - manage
  • {% endfor %}
{% else %} No locked accounts {% endif %}
{% endif %} {% if panels.pending_actions and pending_actions %}
Pending Actions in Your Cases
Flagged evidence ({{ pending_actions.flagged | length }})
{% if pending_actions.flagged %} {% else %}Nothing flagged.{% endif %}
Sitting in Transferred ({{ pending_actions.in_transfer | length }})
{% if pending_actions.in_transfer %} {% else %}No items in transfer.{% endif %}
{% endif %} {% if panels.workbench %}
My Workbench - evidence you currently hold
{% if workbench %} {% for ev in workbench %} {% endfor %}
EvidenceStateIntegrityActions
{{ ev.evidence_number }} - {{ ev.title }} {{ ev.lifecycle_state }} {{ (ev.integrity_status or 'NOT_CHECKED') | replace('_',' ') | title }} Verify Transfer State
{% else %}

You are not currently holding any evidence items.

{% endif %}
{% endif %} {% if panels.review_queue %}
Review Queue - recently updated evidence in your shared cases
{% if review_queue %} {% for ev in review_queue %} {% endfor %}
EvidenceCaseStateLast updated
{{ ev.evidence_number }} - {{ ev.title }} #{{ ev.case_id }} {{ ev.lifecycle_state }} {{ ev.updated_at.strftime('%Y-%m-%d %H:%M') }} Custody Log
{% else %}

No evidence to review yet.

{% endif %}
{% endif %} {% if panels.integrity %}
Evidence Integrity Overview
{% set total_ev = integrity_counts.VERIFIED + integrity_counts.NOT_CHECKED + integrity_counts.FAILED %} {% if total_ev == 0 %}

No evidence items yet.

{% else %}
{{ integrity_counts.VERIFIED }}
Verified
{{ integrity_counts.NOT_CHECKED }}
Not Checked
{{ integrity_counts.FAILED }}
Failed
{% set v_pct = ((integrity_counts.VERIFIED / total_ev) * 100) | int %} {% set nc_pct = ((integrity_counts.NOT_CHECKED / total_ev) * 100) | int %} {% set f_pct = ((integrity_counts.FAILED / total_ev) * 100) | int %}
{% if v_pct > 8 %}{{ v_pct }}%{% endif %}
{% if nc_pct > 8 %}{{ nc_pct }}%{% endif %}
{% if f_pct > 8 %}{{ f_pct }}%{% endif %}
{% endif %}
{% endif %}
{% if panels.top_risk %}
Top 5 Highest-Risk Evidence Full Risk Dashboard
{% if not top_risk_evidence %}

No evidence items found.

{% else %} {% for item in top_risk_evidence %} {% set ev = item.evidence %} {% set level = item.level %} {% set score = item.score %} {% set color_map = { 'LOW': 'success', 'MEDIUM': 'warning', 'HIGH': 'danger', 'CRITICAL': 'dark', 'UNKNOWN': 'secondary' } %} {% endfor %}
Evidence Case Risk Level Score
#{{ ev.id }} {{ ev.title }} #{{ ev.case_id }} {{ level }} {% set pct = (score * 100) | int %}
{{ '%.3f' | format(score) }}
Report
{% endif %}
{% endif %}
Recent Cases All Cases
    {% if not recent_cases %}
  • {% if has_case_access %}No cases yet.{% else %}No cases shared with you yet.{% endif %}
  • {% else %} {% for case in recent_cases %}
  • {{ case.title }}
    {{ case.created_at.strftime('%Y-%m-%d') }}  ·  {{ case.evidence_items.count() }} item(s)
    {% set st_color = { 'OPEN': 'success', 'CLOSED': 'secondary', 'PENDING':'warning' } %} {{ case.status }}
  • {% endfor %} {% endif %}
{% if panels.recent_audits %}
Recent Audit Activity {% if not current_user.is_admin() %}(your cases){% endif %} {% if current_user.is_admin() %} Full Trail {% endif %}
    {% if not recent_audits %}
  • No audit records yet.
  • {% else %} {% for rec in recent_audits %}
  • {{ rec.event_type }} {{ rec.timestamp.strftime('%Y-%m-%d %H:%M') }}
    {% if rec.description %} {{ rec.description[:80] }}{% if rec.description|length > 80 %}…{% endif %} {% endif %}
  • {% endfor %} {% endif %}
{% endif %}
Your Recent Activity
    {% if not my_activity %}
  • No activity recorded yet.
  • {% else %} {% for rec in my_activity %}
  • {{ rec.event_type }} {{ rec.timestamp.strftime('%Y-%m-%d %H:%M') }}
    {% if rec.description %} {{ rec.description[:80] }}{% if rec.description|length > 80 %}…{% endif %} {% endif %}
  • {% endfor %} {% endif %}
Quick Actions
{% if current_user.can_manage() %} New Case {% endif %} {% if current_user.can_analyse() %} Risk Dashboard {% endif %} {% if current_user.can_manage() %} Anomaly Detection {% endif %} AI Assistant {% if current_user.is_admin() %} Audit Trail {% endif %}
{% endblock %}