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:
@@ -2,11 +2,11 @@
|
||||
|
||||
<%= tag.ul class: [*ul_class] do %>
|
||||
<% diff.added.each do |item| %>
|
||||
<%= tag.li item, class: ["added", ("obsolete" if item.in?(diff.obsolete_added)), *li_class] %>
|
||||
<%= tag.li item, class: ["added", *li_class] %>
|
||||
<% end %>
|
||||
|
||||
<% diff.removed.each do |item| %>
|
||||
<%= tag.li item, class: ["removed", ("obsolete" if item.in?(diff.obsolete_removed)), *li_class] %>
|
||||
<%= tag.li item, class: ["removed", *li_class] %>
|
||||
<% end %>
|
||||
|
||||
<% diff.changed.each do |old, new| %>
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
<% if !commentary_version.unchanged_empty?(:original_title) %>
|
||||
<b>Title:</b>
|
||||
<div class="commentary-body-section">
|
||||
<%= diff_body_html(commentary_version, commentary_version.previous, :original_title) %>
|
||||
<%= commentary_version_field_diff(commentary_version, params[:type], :original_title) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if !commentary_version.unchanged_empty?(:original_description) %>
|
||||
<b>Description:</b>
|
||||
<div class="commentary-body-section">
|
||||
<%= diff_body_html(commentary_version, commentary_version.previous, :original_description) %>
|
||||
<%= commentary_version_field_diff(commentary_version, params[:type], :original_description) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -33,18 +33,18 @@
|
||||
<% if !commentary_version.unchanged_empty?(:translated_title) %>
|
||||
<b>Title:</b>
|
||||
<div class="commentary-body-section">
|
||||
<%= diff_body_html(commentary_version, commentary_version.previous, :translated_title) %>
|
||||
<%= commentary_version_field_diff(commentary_version, params[:type], :translated_title) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if !commentary_version.unchanged_empty?(:translated_description) %>
|
||||
<b>Description:</b>
|
||||
<div class="commentary-body-section">
|
||||
<%= diff_body_html(commentary_version, commentary_version.previous, :translated_description) %>
|
||||
<%= commentary_version_field_diff(commentary_version, params[:type], :translated_description) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% t.column "Changes", width: "3%" do |commentary_version| %>
|
||||
<%= status_diff_html(commentary_version) %>
|
||||
<%= status_diff_html(commentary_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Updated", width: "10%" do |commentary_version| %>
|
||||
<div>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<div id="a-index">
|
||||
<h1>Artist Commentary History</h1>
|
||||
|
||||
<%= render "versions/types" %>
|
||||
|
||||
<%= render "posts/partials/common/inline_blacklist" %>
|
||||
|
||||
<%= render "listing" %>
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
<% t.column "Name", td: {class: "diff-body"} do |artist_version| %>
|
||||
<%= link_to artist_version.name, artist_path(artist_version.artist_id) %>
|
||||
<%= link_to "»", artist_versions_path(search: {artist_id: artist_version.artist_id}, anchor: "artist-version-#{artist_version.id}") %>
|
||||
<%= artist_version_name_diff(artist_version) %>
|
||||
<%= artist_version_name_diff(artist_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Other Names", td: {class: "diff-body"} do |artist_version| %>
|
||||
<%= artist_version_group_name_diff(artist_version) %>
|
||||
<%= artist_version_other_names_diff(artist_version) %>
|
||||
<%= artist_version_group_name_diff(artist_version, params[:type]) %>
|
||||
<%= artist_version_other_names_diff(artist_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "URLs", td: {class: "col-expand"} do |artist_version| %>
|
||||
<%= artist_version_urls_diff(artist_version) %>
|
||||
<%= artist_version_urls_diff(artist_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Changes" do |artist_version| %>
|
||||
<%= status_diff_html(artist_version) %>
|
||||
<%= status_diff_html(artist_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Updated" do |artist_version| %>
|
||||
<%= link_to_user artist_version.updater %>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<div id="a-index">
|
||||
<h1>Artist History</h1>
|
||||
|
||||
<%= render "versions/types" %>
|
||||
|
||||
<%= render "listing" %>
|
||||
|
||||
<%= numbered_paginator(@artist_versions, :search_count => params[:search]) %>
|
||||
|
||||
@@ -14,16 +14,16 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% t.column "Body", td: {class: "col-expand diff-body"} do |note_version| %>
|
||||
<%= diff_body_html(note_version, note_version.previous, :body) %>
|
||||
<%= note_version_body_diff(note_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Position (X,Y)", width: "5%", column: "position" do |note_version| %>
|
||||
<%= note_version_position_diff(note_version) %>
|
||||
<%= note_version_position_diff(note_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Size (WxH)", width: "5%", column: "size" do |note_version| %>
|
||||
<%= note_version_size_diff(note_version) %>
|
||||
<%= note_version_size_diff(note_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Changes", width: "3%" do |note_version| %>
|
||||
<%= status_diff_html(note_version) %>
|
||||
<%= status_diff_html(note_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Updated", width: "10%" do |note_version| %>
|
||||
<div>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<div id="a-index">
|
||||
<h1>Note History</h1>
|
||||
|
||||
<%= render "versions/types" %>
|
||||
|
||||
<%= render "listing" %>
|
||||
|
||||
<%= numbered_paginator(@note_versions) %>
|
||||
|
||||
@@ -2,21 +2,21 @@
|
||||
|
||||
<%= 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), "diff", diff_pool_version_path(pool_version.id) %>
|
||||
<%= 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) %>
|
||||
<%= 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) %>
|
||||
<%= 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) %>
|
||||
<%= status_diff_html(pool_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Updated", width: "10%" do |pool_version| %>
|
||||
<div>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<div id="a-index">
|
||||
<h1>Pool History</h1>
|
||||
|
||||
<%= render "versions/types" %>
|
||||
|
||||
<%= render "listing" %>
|
||||
|
||||
<%= numbered_paginator(@pool_versions) %>
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
<%= link_to "#{post_version.post_id}.#{post_version.version}", post_versions_path(search: { post_id: post_version.post_id }, anchor: "post-version-#{post_version.id}") %>
|
||||
<% end %>
|
||||
<% t.column "Tags", td: {class: "col-expand"} do |post_version| %>
|
||||
<%= post_version_diff(post_version) %>
|
||||
<%= post_version_diff(post_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Changes" do |post_version| %>
|
||||
<%= status_diff_html(post_version) %>
|
||||
<%= status_diff_html(post_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Updated" do |post_version| %>
|
||||
<%= link_to_user post_version.updater %>
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
<h1>Post History</h1>
|
||||
<% end %>
|
||||
|
||||
<%= render "versions/types" %>
|
||||
|
||||
<%= search_form_for(post_versions_path, classes: "inline-form") do |f| %>
|
||||
<%= f.input :post_id, label: "Post", input_html: { value: params.dig(:search, :post_id) } %>
|
||||
<%= f.input :updater_name, label: "Updater", input_html: { "data-autocomplete": "user", value: params.dig(:search, :updater_name) } %>
|
||||
|
||||
6
app/views/versions/_types.html.erb
Normal file
6
app/views/versions/_types.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div id="version-comparisons">
|
||||
<span>Version comparison:</span>
|
||||
<ul id="version-comparisons-list">
|
||||
<%= version_type_links(params) %>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -2,7 +2,7 @@
|
||||
<%= form_tag(diff_wiki_page_versions_path, :method => :get) do %>
|
||||
<%= table_for @wiki_page_versions.includes(:updater, :tag), width: "100%" do |t| %>
|
||||
<% t.column column: "diff", width: "3%" do |wiki_page_version, i| %>
|
||||
<%= link_to_if wiki_version_show_diff(wiki_page_version), "diff", diff_wiki_page_versions_path(otherpage: wiki_page_version.previous.try(:id), thispage: wiki_page_version.id) %>
|
||||
<%= link_to_if wiki_version_show_diff(wiki_page_version, params[:type]), "diff", diff_wiki_page_versions_path(thispage: wiki_page_version.id, type: params[:type]) %>
|
||||
<% end %>
|
||||
|
||||
<% if listing_type(:wiki_page_id, member_check: false, types: [:page, :global]) == :page %>
|
||||
@@ -20,10 +20,10 @@
|
||||
<%= link_to wiki_page_version.title, wiki_page_version %>
|
||||
<%= link_to "»", wiki_page_versions_path(search: { wiki_page_id: wiki_page_version.wiki_page_id }) %>
|
||||
</span>
|
||||
<%= wiki_version_title_diff(wiki_page_version) %>
|
||||
<%= wiki_version_title_diff(wiki_page_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Changes", width: "5%" do |wiki_page_version| %>
|
||||
<%= status_diff_html(wiki_page_version) %>
|
||||
<%= status_diff_html(wiki_page_version, params[:type]) %>
|
||||
<% end %>
|
||||
<% t.column "Updated", width: "26%" do |wiki_page_version| %>
|
||||
<%= compact_time(wiki_page_version.updated_at) %>
|
||||
|
||||
@@ -4,21 +4,33 @@
|
||||
<%= render "wiki_pages/sidebar" %>
|
||||
|
||||
<% content_for(:content) do %>
|
||||
<h1>Wiki Page Version Comparison: <%= link_to @thispage.title, wiki_page_versions_path(search: { wiki_page_id: @thispage.wiki_page_id }, anchor: "wiki-page-version-#{@thispage.id}"), class: "tag-type-#{@thispage.wiki_page.category_name}" %></h1>
|
||||
<h1>Wiki Page Version Comparison: <%= link_to @thispage.title, wiki_page_versions_path(search: { wiki_page_id: @thispage.wiki_page_id }, type: params[:type], anchor: "wiki-page-version-#{@thispage.id}"), class: "tag-type-#{@thispage.wiki_page.category_name}" %></h1>
|
||||
|
||||
<p>Showing differences between <%= compact_time @thispage.updated_at %> (<%= link_to_user @thispage.updater %>) and <%= compact_time @otherpage.updated_at %> (<%= link_to_user @otherpage.updater %>)</p>
|
||||
|
||||
<% if wiki_version_show_other_names(@thispage, @otherpage) %>
|
||||
<p><%= wiki_version_other_names_diff(@thispage, @otherpage) %></p>
|
||||
<% else %>
|
||||
<p><em>No changes to other names.</em></p>
|
||||
<% if params[:type].present? %>
|
||||
<%= render "versions/types" %>
|
||||
<% end %>
|
||||
|
||||
<% if @thispage.body != @otherpage.body %>
|
||||
<div class="diff-body">
|
||||
<%= diff_body_html(@thispage, @otherpage, :body) %>
|
||||
</div>
|
||||
<% if @otherpage.present? %>
|
||||
<% if @thispage.id != @otherpage.id %>
|
||||
<p>Showing differences between <%= compact_time @thispage.updated_at %> (<%= link_to_user @thispage.updater %>) and <%= compact_time @otherpage.updated_at %> (<%= link_to_user @otherpage.updater %>)</p>
|
||||
|
||||
<% if wiki_version_show_other_names(@thispage, @otherpage) %>
|
||||
<p><%= wiki_version_other_names_diff(@thispage, @otherpage) %></p>
|
||||
<% else %>
|
||||
<p><em>No changes to other names.</em></p>
|
||||
<% end %>
|
||||
|
||||
<% if @thispage.body != @otherpage.body %>
|
||||
<div class="diff-body">
|
||||
<%= diff_body_html(@thispage, @otherpage, :body) %>
|
||||
</div>
|
||||
<% else %>
|
||||
<p><em>No changes to body.</em></p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p><em>Version is latest!</em></p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p><em>No changes to body.</em></p>
|
||||
<p><em>No versions to compare!</em></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
<% content_for(:content) do %>
|
||||
<h1>Wiki Page History</h1>
|
||||
|
||||
<%= render "versions/types" %>
|
||||
|
||||
<%= render "listing" %>
|
||||
|
||||
<%= numbered_paginator(@wiki_page_versions) %>
|
||||
|
||||
Reference in New Issue
Block a user