{% 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' }}

{% if doc.template_type %} {% endif %} ← Collections
Viewing:

Versions

Active: {{ active_version_id[:16] }}… {% if versions|length >= 2 %} {% endif %}
{% 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 %}
{% if doc.template_type %}
{% else %}
{% endif %}

Sections {% if doc.template_type %}{{ doc.template_type | replace('_', ' ') }}{% endif %}

{% 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 | markdown | safe }}{% 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 doc.template_type %} {% 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 %} {% if doc.template_type %} {% if config.EXCALIDRAW_HOST %} {% endif %} {% endif %}
{% else %}

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

{% endfor %}
{% if doc.template_type %}
{% endif %} {% if doc.template_type and config.EXCALIDRAW_HOST %}
✏ Excalidraw
{% endif %} {% if doc.template_type %}
⬑ Diagram Editor
Mermaid Syntax
Preview
{% endif %} {% if doc.template_type %} {% endif %} {% 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 %}