{% load i18n attachments_tags thumbnail static %}

<div class="file-attachment file-attachment-detail">
    <h3>{% trans "Attached files" %}</h3>

    {% if perms|read_attachment %}

        {% get_attachments_for object as "attachments_list" %}
        {% if attachments_list %}
            {% include "paperclip/_attachment_table.html" %}
        {% else %}
            {% trans "No file attached" %}
        {% endif %}

    {% else %}
        {% trans "You are not allowed to see attachments." %}
    {% endif %}
</div>

{% if perms|add_attachment %}
<div class="file-attachment-form">
    <div class="create">
    {% attachment_form object %}
    </div>
    <div class="update"></div>
</div>
{% endif %}

<div class="confirm-modal"
     data-confirm-delete-heading="{% trans "Confirm file deletion" %}"
     data-confirm-delete-msg="{% trans "Are you sure to delete this file {file} ?" %}"
     data-confirm-delete-close-button="{% trans "Cancel" %}"
     data-confirm-delete-confirm-button="{% trans "Delete" %}"></div>
<script type="text/javascript" src="{% static "paperclip/paperclip.js" %}"></script>
