<div id="p-<%= listing_type(:pool_id) %>-listing">

    <%= table_for @pool_versions, class: "striped autofit", width: "100%" do |t| %>
      <% t.column column: "diff", width: "3%" do |pool_version| %>
        <%= link_to_if pool_version_show_diff(pool_version, params[:type]), "diff", diff_pool_version_path(pool_version.id) %>
      <% end %>
      <% t.column "Pool", td: {class: "diff-body"} do |pool_version| %>
        <%= link_to pool_version.pretty_name, pool_path(pool_version.pool_id), class: "pool-category-#{pool_version.pool.category}" %>
        <%= link_to "»", pool_versions_path(search: { pool_id: pool_version.pool_id }, anchor: "pool-version-#{pool_version.id}"), class: "pool-category-#{pool_version.pool.category}" %>
        <%= pool_version_name_diff(pool_version, params[:type]) %>
      <% end %>
      <% t.column "Post Changes", td: { class: "col-expand" } do |pool_version| %>
        <%= pool_version_post_diff(pool_version, params[:type]) %>
      <% end %>
      <% t.column "Post Count" do |pool_version| %>
        <%= link_to pool_version.post_ids.size, pool_versions_path(search: { pool_id: pool_version.pool_id }) %>
      <% end %>
      <% t.column "Changes", td: {class: "col-expand"} do |pool_version| %>
        <%= status_diff_html(pool_version, params[:type]) %>
      <% end %>
      <% t.column "Updated", width: "10%" do |pool_version| %>
        <div>
          <%= compact_time pool_version.updated_at %>
        </div>
        by
        <%= link_to_user pool_version.updater %>
        <%= link_to "»", pool_versions_path(search: params[:search].merge({ updater_id: pool_version.updater_id })) %>
      <% end %>
      <% if listing_type(:pool_id) == :revert %>
        <% t.column column: "control" do |pool_version| %>
          <%= link_to "Revert to", revert_pool_path(pool_version.pool_id, :version_id => pool_version.id), :method => :put, :remote => true %>
        <% end %>
      <% end %>
    <% end %>

</div>
