{% extends "dashboard_app/_content.html" %}
{% load i18n %}


{% block content %}
<table id="attachments" class="demo_jui display">
  <thead>
    <tr>
      <th>Name</th>
      <th>Size</th>
      <th>MIME type</th>
      <th>Public URL</th>
    </tr>
  </thead>
  <tbody>
    {% for attachment in attachment_list %}
    <tr>
      <td><a href="{{ attachment.get_absolute_url }}"
          ><code>{{ attachment.content_filename }}</code></a></td>
      <td>
        {% if attachment.content %}
        {{ attachment.content.size|filesizeformat }}
        {% else %}
        Not available
        {% endif %}
      </td>
      <td><code>{{ attachment.mime_type }}</code></td>
      <td>
        {% if attachment.public_url %}
        <a href="{{ attachment.public_url }}">public URL</a>
        {% endif %}
      </td>
    </tr>
    {% endfor %}
  </body>
</table>
<script type="text/javascript" charset="utf-8"> 
  $(document).ready(function() {
    $('#attachments').dataTable({
      bJQueryUI: true,
      bPaginate: false,
      aaSorting: [[1, "desc"]],
    });
  });
</script>
{% endblock %}
