{% extends "base.html" %} {% block title %}Review Queue — NFR{% endblock %} {% block content %} {# ── Reason filter ────────────────────────────────────────────────────────── #}
{% if reason_filter %}
Clear filter
{% endif %}
{% if items %}
{% for item in items %} {% set rec = ingest_map.get(item.ingest_record_id) %} {# ID #} {# Filename #} {# Source #} {# Reason #} {# Proposed project #} {# Proposed destination #} {# Confidence #} {# Age #} {# Action buttons #} {% endfor %}
# Filename Source Reason Project Proposed Destination Confidence Age Actions
{{ item.id }} {{ rec.original_filename if rec else "—" }} {{ rec.ingest_source if rec else "—" }} {% if item.review_reason == "LOW_CONFIDENCE_MATCH" %} Low confidence match {% elif item.review_reason == "NO_PROJECT_MATCH" %} No project match {% elif item.review_reason == "LOW_CONFIDENCE_ROUTE" %} Low confidence route {% elif item.review_reason == "SECURITY_VIOLATION_BLOCKED" %} Security violation {% else %} {{ item.review_reason }} {% endif %} {% if item.reason_detail %}
{{ item.reason_detail[:80] }}
{% endif %}
{% set proj = project_map.get(item.proposed_project_id) if item.proposed_project_id else None %} {% if proj %} {{ proj.project_number }}
{{ proj.project_name[:40] }}{% if proj.project_name|length > 40 %}…{% endif %}
{% else %} {% endif %}
{% if item.proposed_destination %} {{ item.proposed_destination }} {% else %} {% endif %} {% if item.proposed_confidence %} {% set pct = (item.proposed_confidence * 100) | int %} {% if pct >= 80 %} {{ pct }}% {% elif pct >= 60 %} {{ pct }}% {% else %} {{ pct }}% {% endif %} {% else %} {% endif %} {{ item.created_at.strftime("%Y-%m-%d %H:%M") if item.created_at else "—" }}
Details {% if item.proposed_destination and item.proposed_project_id %} {# Quick-accept form — only shown when a valid proposed routing exists #}
{% endif %}
{# Pagination #} {% if total_pages > 1 %} {% endif %} {% else %}
{% if reason_filter %} No items match the selected reason filter. Clear filter {% else %} The review queue is empty. No files are awaiting human review. {% endif %}
{% endif %} {% endblock %}