Files
danbooru/app/views/pool_versions/diff.html.erb
BrokenEagle e23ee170f5 Add alternate comparison types to versions
- The types are:
-- Previous: The default and the previously used type
-- Subsequent: Compares against the next version
-- Current: Compares against the current version
- Allow switching between comparison types in index and diff views
-- Have links vary depending upon current comparison type
2020-03-17 18:31:20 +00:00

29 lines
1.2 KiB
Plaintext

<% 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>