<div id="c-pools">
  <div id="a-index">
    <h1>Pool History</h1>

    <table width="100%" class="striped">
      <thead>
        <tr>
          <th>Pool</th>
          <th>Post Count</th>
          <th>Changes</th>
          <th>Updater</th>
          <% if CurrentUser.is_janitor? %>
            <th>IP Address</th>
          <% end %>
          <th>Date</th>
          <% if CurrentUser.is_member? %>
            <th></th>
          <% end %>
        </tr>
      </thead>
      <tbody>
        <% @pool_versions.each do |pool_version| %>
          <tr>
            <td><%= link_to pool_version.pretty_name, pool_path(pool_version.pool_id), :class => "pool-category-#{pool_version.pool.category}" %></td>
            <td><%= link_to pool_version.post_id_array.size, pool_versions_path(:search => {:pool_id => pool_version.pool_id}) %></td>
            <td><%= pool_version_diff(pool_version) %></td>
            <td><%= link_to_user pool_version.updater%></td>
            <% if CurrentUser.is_janitor? %>
              <td>
                <%= pool_version.updater_ip_addr %>
              </td>
            <% end %>
            <td><%= compact_time pool_version.updated_at %></td>
            <% if CurrentUser.is_member? %>
              <td>
                <%= link_to "Revert to", revert_pool_path(pool_version.pool_id, :version_id => pool_version.id), :method => :put, :remote => true %>
              </td>
            <% end %>
          </tr>
        <% end %>
      </tbody>
    </table>

    <%= numbered_paginator(@pool_versions) %>
  </div>
</div>

<%= render "pools/secondary_links" %>

<% content_for(:page_title) do %>
  Pool Versions - <%= Danbooru.config.app_name %>
<% end %>
