<h2>Media</h2>

<%= render_template('../util/pager') %>

<table class="list media" summary="List of all media">
  <%= render_template('../util/table_sortheader') %>
  <tfoot></tfoot>
  <tbody>
    <% row = 'even' %>
    <% @files.all do |file| %>
      <tr class="<%= row == 'even' ? row = 'odd' : row = 'even' %>">
        <td class="filename">
          <a href="<%= Rs(:edit, file.id) %>"><%== file.filename %></a>
        </td>
        <td class="size"><%== file.size.filesize_format %></td>
        <td class="created">
          <%= file.created_at(Thoth::Config.timestamp.short) %>
        </td>
        <td class="updated">
          <%= file.updated_at(Thoth::Config.timestamp.short) %>
        </td>
      </tr>
    <% end %>

    <% if @pager.record_count == 0 %>
      <tr class="empty">
        <td colspan="4">
          No files to display.
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= render_template('../util/pager') %>
