{% load attachments_tags %}
{% load i18n %}

<table class="list" cellspacing="0" cellspan="0" width="100%">
	<thead>
		<tr>
                    <th align="left">{% trans "File name" %}</th>
                    <th align="left" width="20%">{% trans "Submitter" %}</th>
                    <th align="left" width="20%">{% trans "Create date" %}</th>
                    <th align="left" width="10%">{% trans "Action" %}</th>
		</tr>
	</thead>
	<tbody>
                {% get_attachments_for object as attachments_list %}
		{% for attachment in attachments_list %}
		<tr class="{% cycle 'odd' 'even' %}">
                        <td><a href="{{ attachment.attachment_file.url }}">{{ attachment.filename }}</a></td>
			<td>{{ attachment.creator }}</td>
			<td>{{ attachment.created }}</td>
                        <td>{% attachment_delete_link attachment %}</td>
		</tr>
		{% empty %}
                <tr><td colspan="4" align="center"><span class="grey">{% trans "No attachments" %}</span></td></tr>
		{% endfor %}

                <tr>
                    <td colspan="4">
                        {% if perms.attachments.add_attachment %}
                            {% attachment_form object %}
                        {% endif %}
                    </td>
                </tr>
	</tbody>
</table>
