{% extends "base.html" %} {% block title %}Document — Document Intelligence — ICDEV™{% endblock %} {% block content %}
CUI // SP-CTI

📄 {{ doc.title or 'Untitled Document' }}

{{ doc.filename or '—' }} · {{ doc.collection_id }} · {{ doc.classification or 'CUI' }}

← Collections

Versions

Active: {{ active_version_id[:16] }}…
{% for v in versions %}
v{{ v.version_no }} {{ v.origin }} {% if v.status == 'approved' %}✓{% elif v.status == 'pending_review' %}⏳{% elif v.status == 'rejected' %}✕{% elif v.status == 'needs_revision' %}✏️{% else %}—{% endif %} {{ v.status }} {% if v.assigned_to %}→ {{ v.assigned_to }}{% endif %}
{% else %} No versions yet. {% endfor %}

Sections

{% for s in sections %}
{{ s.heading }} {{ s.status or 'draft' }} {{ s.origin or 'human' }} {% if s.assigned_to %}→ {{ s.assigned_to }}{% endif %}
{% if s.origin == 'ai_generated' or s.origin == 'ai_assisted' %} AI-generated · pending review {% endif %}
{% if s.content %} {{ s.content[:1000] | replace('\n', '
') }}{% if s.content|length > 1000 %}…{% endif %} {% else %} Empty — use AI Assist or edit manually. {% endif %}
{% if s.citations %}
{% for c in s.citations %} 📄 {{ c.doc_title or c.doc_id }} · p.{{ c.page or '?' }} · {{ c.chunk_id[:16] }}… {% endfor %}
{% endif %}
{% if role_levels.get(user_role, 0) >= 1 %} {% endif %} {% if role_levels.get(user_role, 0) >= 1 %} {% endif %} {% if role_levels.get(user_role, 0) >= 2 %} {% endif %}
{% else %}

No sections yet. Generate a draft or instantiate a template.

{% endfor %}
{% set iqe_canvas = "dic" %} {% set iqe_api_route = "/document-intelligence/api/iqe-query" %} {% set iqe_title = "IQE Query — Document" %} {% set iqe_examples = [ {"label": "Versions", "query": "foreach v in dic.versions where v.doc_id == \"{{ doc.doc_id }}\" select v.version_no, v.status, v.origin"} ] %} {% include "includes/iqe_query_widget.html" %} {% endblock %}