diff --git a/.claude/settings.json b/.claude/settings.json index d85f32e..f20ea4d 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -20,7 +20,8 @@ "Bash(python -c \"import ast;ast.parse\\(open\\('app/enrollment/routes.py',encoding='utf-8'\\).read\\(\\)\\);print\\('parses OK'\\)\")", "Bash(python -c \"import ast;[ast.parse\\(open\\(f,encoding='utf-8'\\).read\\(\\)\\) for f in ['app/enrollment/mailer.py','app/enrollment/schema.py']];print\\('parses OK'\\)\")", "Bash(python -c \"import ast;ast.parse\\(open\\('app/enrollment/mailer.py',encoding='utf-8'\\).read\\(\\)\\);print\\('parses OK'\\)\")", - "Bash(grep -n \"\\\\\\\\\\\\\\\\n\" app/enrollment/mailer.py)" + "Bash(grep -n \"\\\\\\\\\\\\\\\\n\" app/enrollment/mailer.py)", + "Bash(git stash *)" ] } } diff --git a/app/routes/dashboard.py b/app/routes/dashboard.py index fa0a2ce..9b5cebb 100644 --- a/app/routes/dashboard.py +++ b/app/routes/dashboard.py @@ -331,38 +331,6 @@ def index(): unassigned_open = len(unassigned_all) unassigned_handler = _handler_split(unassigned_all) - # ── Inspector activity today (admin / director / PM / auditor only) ─────── - inspector_activity = [] - if is_privileged or is_project_manager or is_auditor: - active_inspectors = ( - User.query - .filter(User.role.in_(User.INSPECTOR_ROLES), User.active == True) - .order_by(User.full_name, User.username) - .all() - ) - today_counts = dict( - db.session.query( - Inspection.inspector_id, - func.count(Inspection.id), - ) - .filter( - Inspection.status == 'completed', - Inspection.inspection_date >= today_start, - Inspection.inspection_date < today_end, - ) - .group_by(Inspection.inspector_id) - .all() - ) - inspector_activity = sorted( - [{'name': u.display_name, - 'count': today_counts.get(u.id, 0), - # phase49 — flags customer / third-party inspectors so the table - # can badge them; internal and external are listed together. - 'external': u.is_external_inspector} - for u in active_inspectors], - key=lambda x: (-x['count'], x['name']), - ) - # ── My open issues (inspector dashboard widget) ─────────────────────────── # Issues assigned to the current inspector that are not yet resolved, # ordered by SLA urgency (breached first, then at-risk, then ok). @@ -422,7 +390,6 @@ def index(): stale_in_progress = stale_in_progress, unassigned_open = unassigned_open, unassigned_handler = unassigned_handler, - inspector_activity = inspector_activity, recent_inspections = recent_inspections, total_facilities = total_facilities, total_templates = total_templates, diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index f56d259..15c1a02 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -294,53 +294,6 @@ -{# ── Inspector activity today (admin / director / PM) ───────────────────── #} -{% if inspector_activity %} -
| Inspector | -Submitted Today | -- |
|---|---|---|
| {{ row.name }} - {% if row.external %} - External - {% endif %} - | -- {% if row.count > 0 %} - {{ row.count }} - {% else %} - — - {% endif %} - | -
-
- {% set max_count = inspector_activity | map(attribute='count') | max %}
- {% set pct = (row.count / max_count * 100) | int if max_count > 0 else 0 %}
-
-
- |
-
| Inspector | -Submitted Today | -- |
|---|---|---|
| {{ row.name }} - {% if row.external %} - External - {% endif %} - | -- {% if row.count > 0 %} - {{ row.count }} - {% else %} - — - {% endif %} - | -
-
- {% set max_count = inspector_activity | map(attribute='count') | max %}
- {% set pct = (row.count / max_count * 100) | int if max_count > 0 else 0 %}
-
-
- |
-