{% extends "base.html" %} {% load i18n plmapp_tags %} {% block scripts %} {% endblock %} {% block content %}
{% csrf_token %}
{% if is_contributor %} {{ docs_formset.management_form }}
{% if not obj.is_cancelled %} {% trans "Attach another document" %} {% endif %} {% if obj.is_draft or obj.is_official %} {# action valid if the part is a draft or official, since the user will own the document #} {% endif %}
{% if forms and as_table %} {% endif %} {% endif %}
{% endif %}
{% include "snippets/astable.html" %}
{% if as_table %} {% for link in documents %} {% with link.document as document %} {% if is_contributor and link.id in forms %} {% with forms|key:link.id as form %} {{ form.id }} {{ form.document }} {{ form.part }} {% endwith %} {% else %} {% endif %} {% endwith %} {% empty %} {% endfor %}
{{ form.delete }} - {{ document.type }} {{ document.reference }} {{ document.revision }} {{ document.name }} {% blocktrans count num_files|key:document.id as file_count %} {{file_count}} file {% plural %} {{file_count}} files {% endblocktrans %}
{% trans "There are no documents attached to this part." %}
{% endif %}
{% if not as_table %}
{% for link in documents %} {% if is_contributor and link.id in forms %} {% include "documents/identity_card.html" with object=link.document detach_objects=True%} {% else %} {% include "documents/identity_card.html" with object=link.document %} {% endif %} {% empty %} {% trans "No attached documents." %} {% endfor %}
{% endif %} {% endblock %}