<% page_title "Pool Comparison: #{@pool_version.pretty_name}" %>
<%= render "secondary_links" %>

<div id="c-pool-versions">
  <div id="a-diff">
    <h1>Pool Version Comparison: <%= link_to @pool_version.pretty_name, pool_versions_path(search: { pool_id: @pool_version.pool_id }, type: params[:type], anchor: "pool-version-#{@pool_version.id}"), class: "pool-category-#{@pool_version.pool.category}" %></h1>

    <%= render "versions/types" %>

    <% if @other_version.present? %>
      <% if @pool_version.id != @other_version.id %>
        <p>Showing differences between <%= compact_time @pool_version.updated_at %> (<%= link_to_user @pool_version.updater %>) and <%= compact_time @other_version.updated_at %> (<%= link_to_user @other_version.updater %>)</p>

        <% if @pool_version.description != @other_version.description %>
          <div class="diff-body">
              <%= diff_body_html(@pool_version, @other_version, :description) %>
          </div>
        <% else %>
          <p><em>No changes to description.</em></p>
        <% end %>
      <% else %>
        <p><em>Version is latest!</em></p>
      <% end %>
    <% else %>
      <p><em>No versions to compare!</em></p>
    <% end %>
  </div>
</div>
