{% include "partials/sidebar.html" %}
{% if error == "line_count_mismatch" %}
Could not save reviewed OCR because line count did not match OCR layout. Expected {{ error_expected }}, got {{ error_actual }}.
{% elif error == "save_ocr_corrected_failed" %}
Could not save OCR-corrected PDF. Check that reviewed OCR line count matches raw OCR line count.
{% elif error == "rerun_ocr_failed" %}
OCR rerun failed.
{% elif error == "save_field_enriched_failed" %}
Could not save field-enriched PDF.
{% endif %}

{{ document.document_id }}

{{ document.original_filename or document.canonical_filename or document.document_type }}

{{ document.review_status }} {{ document.document_type }} {{ document.mime_type }}
Uses the system path unless manually edited.
{% if prev_doc %} ← Previous {% endif %} {% if next_doc %} Next → {% endif %} {% if next_ocr_doc %} Next OCR review {% endif %} {% if next_fields_doc %} Next field extraction {% endif %}
{% if error == "storage_unavailable" %}
Storage mount unavailable. Please retry in a moment.
{% endif %}

Document preview

{% if not storage_available %}

Storage mount unavailable. Preview is temporarily unavailable.

{% elif file_url %} {% if document.mime_type == "application/pdf" %} {% elif document.mime_type in ["image/jpeg", "image/png"] %} Document image {% else %}

Open file

{% endif %} {% else %}

No preview available.

{% endif %}

Reviewed OCR

{% if reviewed_ocr %}

Current reviewed version saved at {{ reviewed_ocr.created_at }} — v{{ reviewed_ocr.version_number }}

{% else %}

No reviewed OCR saved yet.

{% endif %}

Expected OCR lines: {{ expected_line_count }}
Current editor lines: {{ actual_line_count }}
Line count mismatch may affect corrected PDF layout.

{% for n in line_numbers %}{{ n }}
{% endfor %}
{% for flag in quality_flag_options %} {% endfor %}

Extracted fields

{% if current_extracted %}

Current extracted fields last updated at {{ current_extracted.updated_at }}

{% else %}

No extracted fields saved yet.

{% endif %}

Additional fields

{% if current_additional %}

Current additional fields last updated at {{ current_additional.updated_at }}

{% else %}

No additional fields saved yet.

{% endif %} {% if presets %}
Manage presets
{% else %} {% endif %}

Document versions

{% if version_rows %}
{% for version, file_exists in version_rows %} {% endfor %}
Version Type Path Size Created Notes
v{{ version.version_number }} {{ version.version_type }} {{ version.file_path }}
{% if file_exists %} Available {% endif %}
{{ human_size(version.file_size_bytes) }} {{ version.created_at }} {{ version.notes or "" }}
{% else %}

No versions found.

{% endif %}

Raw OCR

{% if raw_ocr %}
Text versionv{{ raw_ocr.version_number }}
OCR engine{{ raw_ocr.ocr_engine or "unknown" }}
Engine version{{ raw_ocr.ocr_engine_version or "unknown" }}
Rerun source{{ raw_ocr.rerun_source or "unknown" }}
Quality score{{ raw_ocr.quality_score if raw_ocr.quality_score is not none else "not scored yet" }}
Quality note{{ raw_ocr.quality_note or "" }}

Quality flags: {{ raw_ocr.quality_flags if raw_ocr and raw_ocr.quality_flags else [] }}

{{ raw_ocr.text_content }}
{% else %}

No raw OCR text found.

{% endif %}

Metadata

Type{{ document.document_type }}
Review status{{ document.review_status }}
Source path{{ document.source_path }}
Current path{{ document.current_path }}
Original filename{{ document.original_filename }}
Canonical filename{{ document.canonical_filename }}
MIME type{{ document.mime_type }}
File size{{ document.file_size }}
Page count{{ document.page_count }}
Share path{{ document.share_path or "" }}
Created at{{ document.created_at }}
Updated at{{ document.updated_at }}