{% load i18n static corpus_extras %} {% if edit_mode %} {{ annotation_config|json_script:"annotation-config" }} {% elif perms.corpus.change_document %} {% for ed in document.digital_editions.all %} {# TODO: Make machine learning model editions editable once line-level editing implemented #} {% if not 'model' in ed.source.source_type.type %} Edit {% for auth in ed.source.authorship_set.all %}{% include "snippets/comma.html" %}{{ auth.creator.last_name }}{% empty %}[unknown]{% endfor %}'s edition {% else %} Edit machine-generated transcription ({{ ed.source.title }}) {% endif %} {% endfor %} {% for tr in document.digital_translations.all %} Edit {% for auth in tr.source.authorship_set.all %}{% include "snippets/comma.html" %}{{ auth.creator.last_name }}{% empty %}[unknown]{% endfor %}'s translation {% endfor %} {% if document.id %} Add a new transcription Add a new translation {% endif %} {% endif %} {# only enable ITT panel if images/transcription/translation are present, or we are in edit mode #} {% if document.has_digital_content or edit_mode %}
{# images displayed by default; disable if no images are available #} {# translators: label for checkbox toggle to show the images panel for a document #} {# translators: label for checkbox toggle to show the transcription panel for a document #} {# translation displayed by default; disable if no content is available #} {# translators: label for checkbox toggle to show the translation panel for a document #}
{% comment %} TODO: Edit both transcription and translation at once. - Add an "edit" button by the dropdown for the non-active panel in edit_mode (i.e. translation if you are already editing a transcription, and vice versa) - This button will instantiate a second tahqiq for each canvas, populated by annotations linked to the selected footnote {% endcomment %} {# header row #}
{# translators: label for header above Image panel in viewer #} {% translate "Image" %}
{# translators: label for header above Transcription panel in viewer #} {% translate "Transcription" %}
{# translators: label for header above Translation panel in viewer #} {% translate "Translation" %}
{# label row #}
{# unused (no image label, needed for column alignment) #}
{% if edit_mode == "transcribing" %} {# show disabled details with source label in editor mode #} {% elif document.digital_editions.count %} {# dropdown is disabled by default; enable if javascript is active #} {% endif %}
{% if edit_mode == "translating" %} {# show disabled details with source label in editor mode #} {% elif document.digital_translations.count %} {# dropdown is disabled by default; enable if javascript is active #} {% endif %}
{# loop based on canvases (for canvas with no image, image_info is a placeholder) #} {% for canvas_uri, image_info in images.items %} {# only images that are part of the current document are zoomable #}

{{ image_info.shelfmark }} {{ image_info.label }}

{% if not image_info.excluded %} {% if edit_mode %}
{# popout and close button #} {# tahqiq toolbar for switching annotation tools #}
{% endif %} {# tablet 3-up: zoom slider toggle button #} {# tablet 3-up: rotation slider toggle button #}
{# tablet/desktop: zoom slider #}
{# tablet/desktop: rotation slider #} °
{# mobile: zoom/rotate toggle #}
{% if not edit_mode %} {# enlarge button #} {% endif %} {% endif %}
{% with deg=image_info.rotation|stringformat:"i" %} {% with rotation="rotation:degrees="|add:deg %} {{ image_info.label }} {% endwith %}
{% endwith %}
{% if image_info.excluded %} {# if this image isn't actually in this document, link to related documents #} {% spaceless %} {% endspaceless %} {% endif %}
{% if edit_mode == "transcribing" %}
{% if forloop.first and not annotation_config.line_mode %} {% include "corpus/snippets/transcription_instructions.html" %} {% endif %}
{% else %} {% if forloop.first %} {{ document.digital_editions.0.display|safe }} {% endif %} {% if not image_info.excluded %}
{# display transcription in chunks by index #} {% for edition in document.digital_editions.all %}
{% for html_section in edition.content_html|dict_item:canvas_uri %} {{ html_section|safe }} {% endfor %}
{% endfor %}
{% endif %} {% endif %}
{% if edit_mode == "translating" %}
{% if forloop.first %} {% include "corpus/snippets/transcription_instructions.html" %} {% endif %}
{% else %} {% if forloop.first %} {{ document.default_translation.display|safe }} {% endif %} {% if not image_info.excluded %}
{# display translation in chunks by index #} {% for translation in document.digital_translations.all %}
{% for html_section in translation.content_html|dict_item:canvas_uri %} {{ html_section|safe }} {% endfor %}
{% endfor %}
{% endif %} {% endif %}
{% endfor %} {% if document.has_image %} {% include "corpus/snippets/document_image_rights.html" %} {# empty divs for grid completion #}
{% endif %}
{% endif %}