{% extends "base.html" %} {% from "_page_header.html" import page_header %} {% from "_components.html" import badge, identifier, pagination, empty_state, toolbar, operations_journey %} {% block content %} {{ page_header("Documents", "Every document in the workspace with the real state of its newest version. Searchable means published and indexed; Failed carries the reason the worker recorded.") }} {{ operations_journey(source_url="/admin/sources" if can_open_sources else None, job_url="/admin/jobs" if can_open_jobs else None, current="document") }}
{% call toolbar("/admin/documents", label="Filter documents") %}
{% if filters.source_id %}{% endif %} {% endcall %} {% if filters.source_id %}

{% if selected_source %}Filtered to {{ selected_source.name }}.{% else %}Filtered to an unavailable source.{% endif %} Show all documents

{% endif %} {% if not page.items %}
{% if query or page.offset %} {{ empty_state("No documents match these filters", "No document matches the applied filters on this page. Adjust the filters or return to an earlier page.", "/admin/documents?" ~ query ~ ("&" if query else "") ~ "offset=" ~ ([page.offset - page.limit, 0] | max) ~ "&limit=" ~ page.limit if page.offset else "/admin/documents", "Previous page" if page.offset else "Clear filters", icon="filter_alt_off") }} {% else %} {{ empty_state("No documents match", "Nothing has been ingested that matches these filters. Upload a document into a knowledge space or sync a source to begin.", "/admin/sources" if can_open_sources else None, "Go to sources", icon="description") }} {% endif %}
{% else %}
{% for item in page.items %} {% set document = item.document %} {% endfor %}
Documents in the current workspace
Name Source Space Parser State Updated
{{ document.title }}

{{ document.external_id }}

{% set source = sources.get(document.source_id) %} {% if source %}{{ source.name }}{% else %}{{ identifier(document.source_id) }}{% endif %} {{ spaces.get(document.space_id, "—") }} {{ item.parser_version or "—" }} {% if document.source_deleted %}{{ badge("Retired", "neutral") }} {% elif item.searchable %}{{ badge("Searchable", "ok") }} {% elif item.failed %}{{ badge("Failed", "error") }}{% if item.failure_code %}

{{ item.failure_code }}

{% endif %} {% elif item.latest_state %}{{ badge("Processing", "info") }} {% else %}{{ badge("No version", "neutral") }}{% endif %}
{{ item.updated_at.strftime("%Y-%m-%d %H:%M") if item.updated_at else "—" }}
{{ pagination(page.total, page.limit, page.offset, "/admin/documents", query) }} {% endif %}
{% endblock %}