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
This commit is contained in:
@@ -3,18 +3,26 @@
|
||||
|
||||
<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 }, anchor: "pool-version-#{@pool_version.id}"), class: "pool-category-#{@pool_version.pool.category}" %></h1>
|
||||
<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? %>
|
||||
<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.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>
|
||||
<% 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>No changes to description.</em></p>
|
||||
<p><em>Version is latest!</em></p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p><em>No versions to compare!</em></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user