{% extends "base.html" %} {# server/templates/review/documents.html — documents of a state: list on the left, preview on the right (images, PDFs, Markdown, text) (E56) #} {% load static forge %} {% block title %}Documents · {% if project.name %}{{ project.name }}{% else %}Project{% endif %} · Forge{% endblock %} {% block content %}

← Project

{% if project.name %}{{ project.name }}{% else %}Project{% endif %} {{ project_id|short_id }}

{% include "review/_tabs.html" %} {% if not snapshots %}

No saved state in storage yet.

{% else %}
Registered in forge.toml under [docs] · forge docs add <Path>
{% if error %}
{{ error }}
{% endif %}
{% for name, items in groups %}

{{ name }} {{ items|length }}

{% empty %}

No documents. Register one in forge.toml: forge docs add docs/architektur.svg.

{% endfor %}
{% if chosen and preview %}
{{ chosen.title }} {{ chosen.path }} {{ stand_label }} {% if preview.raw %}Download{% endif %}
{% if preview.kind == "image" %}
{{ chosen.title }}
{% elif preview.kind == "pdf" %} {% elif preview.kind == "markdown" %}
{% for block in preview.blocks %} {% if block.kind == "h" %}

{% include "review/_spans.html" with spans=block.spans %}

{% elif block.kind == "p" %}

{% include "review/_spans.html" with spans=block.spans %}

{% elif block.kind == "ul" %}
    {% for item in block.items %}
  • {% include "review/_spans.html" with spans=item %}
  • {% endfor %}
{% elif block.kind == "ol" %}
    {% for item in block.items %}
  1. {% include "review/_spans.html" with spans=item %}
  2. {% endfor %}
{% elif block.kind == "quote" %}
{% include "review/_spans.html" with spans=block.spans %}
{% elif block.kind == "code" %}
{{ block.text }}
{% elif block.kind == "hr" %}
{% elif block.kind == "table" %}
{% for cell in block.head %}{% endfor %}{% for row in block.rows %}{% for cell in row %}{% endfor %}{% endfor %}
{% include "review/_spans.html" with spans=cell %}
{% include "review/_spans.html" with spans=cell %}
{% endif %} {% endfor %}
{% elif preview.kind == "text" %}
{% for line in preview.lines %}{% endfor %}
{{ forloop.counter }}{% for css, text in line %}{% if css %}{{ text }}{% else %}{{ text }}{% endif %}{% endfor %}
{% elif preview.kind == "missing" %}

Not present in this state: {{ preview.error }}

{% else %}

No preview for this kind of file — download it and open it in a suitable program (or run forge docs get {{ chosen.path }}).

{% endif %}
{% endif %}
{% endif %} {% endblock %} {% block scripts %} {% endblock %}