{% load i18n plmapp_tags %}
{% if not past %}
{% if not obj.is_cancel %}
{% if obj.is_part %}
{% 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 #}
{% trans "Attach a new document" %}
{% endif %}
{% if is_owner and obj.is_editable %}
{% trans "Add a new part" %}
{% endif %}
{% endif %}
{% if obj.is_document %}
{% if not obj.is_deprecated %}
{# action valid if the doc is not deprecated, since the user will own the part #}
{% trans "Attach a new part" %}
{% endif %}
{% endif %}
{% endif %}
{% endif %}