{% extends "sphene/sphwiki/base.html" %}

{% load i18n %}
{% load sph_extras %}
{% load sph_pagination %}

{% block content %}
<script language="JavaScript" type="text/javascript">
<!--
  function verifyDelete(filename) {
    return confirm("Do you really want to delete the Attachment: " + filename + " ?");
  }

//-->
</script>


  {% include "sphene/sphwiki/_snip_header.html" %}
  <a href="{{ snip.get_absolute_url }}">{% trans "Back to Snip" %}</a> - <a href="{{ snip.get_absolute_create_attachmenturl }}">{% trans "Create New Attachment" %}</a>
  <br/><br/>
  <table border="0" class="sphwiki attachments">
    <tr>
      <th>{% trans "Id" %}</th>
      <th>{% trans "Action" %}</th>
      <th>{% trans "Attachment" %}</th>
      <th>{% trans "Upload Date" %}</th>
      <th>{% trans "Uploader" %}</th>
    </tr>
    {% for attachment in object_list %}
      <tr>
        <td>{{ attachment.id }}</td>
        <td><a href="{{ attachment.get_absolute_editurl }}?delete=1" onClick="return verifyDelete('{{ attachment.fileupload.name|sph_basename }}')"><img src="{{ STATIC_URL}}sphene/sphwiki/icons/edit-delete.png" alt="{% trans 'Delete'%}" title="{% trans 'Delete' %}" border="0" /></a></td>
        <td><a href="{{ attachment.fileupload.url }}">{{ attachment.fileupload.name|sph_basename }}</a></td>
        <td>{{ attachment.uploaded|sph_date }}</td>
        <td>{% sph_html_user attachment.uploader %}</td>
      </tr>
    {% endfor %}
  </table>
  {% if is_paginated %}
    {% blocktrans with hits as attachment_count %}{{ attachment_count }} Attachments.{% endblocktrans %} {% sph_pagination pages page %}
  {% else %}
    {% blocktrans with object_list.count as attachment_count %}{{ attachment_count }} Attachments.{% endblocktrans %}
  {% endif %}

{% endblock %}
