<h2>Pages</h2>

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

<table class="list pages" summary="List of all pages">
  <%= render_template('../util/table_sortheader') %>
  <tfoot></tfoot>
  <tbody>
    <% row = 'even' %>
    <% @pages.all do |page| %>
      <tr class="<%= row == 'even' ? row = 'odd' : row = 'even' %>">
        <td class="name"><%== page.name %></td>
        <td class="title">
          <a href="<%== page.url %>"><%== page.title %></a>
        </td>
        <td class="created">
          <%= page.created_at(Thoth::Config.timestamp.short) %>
        </td>
        <td class="updated">
          <%= page.updated_at(Thoth::Config.timestamp.short) %>
        </td>
      </tr>
    <% end %>

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

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