{% extends "base.html" %} {% load i18n plmapp_tags %} {% block scripts %} {% endblock %} {% block content %}
{% csrf_token %} {% if is_contributor and not obj.is_cancelled %} {{ parts_formset.management_form }}
{% trans "Attach a part" %} {% if not obj.is_deprecated %} {% endif %}
{% if as_table and parts_formset.forms %} {% endif %} {% include "snippets/astable.html" %}
{% endif %} {% if as_table %} {% for link in parts %} {% with link.part as part %} {% 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 }} - {{ part.type }} {{ part.reference }} {{ part.revision }} {{ part.name }}
{% trans "There are no parts attached to this document" %}
{% endif %}
{% if not as_table %}
{% for link in parts %} {% if is_contributor and link.id in forms %} {% include "parts/identity_card.html" with object=link.part detach_objects=True%} {% else %} {% include "parts/identity_card.html" with object=link.part %} {% endif %} {% empty %} {% trans "No attached parts." %} {% endfor %}
{% endif %} {% endblock %}