Files
danbooru/app/views/application/_diff_list.html.erb
evazion 90b94adee8 /wiki_page_versions/diff: use SetDiff to diff other_names.
Use SetDiff instead of DiffBuilder to generate diffs for wiki page other
names. SetDiff is what we use for artist other names.
2020-01-12 16:31:23 -06:00

22 lines
698 B
Plaintext

<%# diff, ul_class, li_class %>
<%= 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] %>
<% end %>
<% diff.removed.each do |item| %>
<%= tag.li item, class: ["removed", ("obsolete" if item.in?(diff.obsolete_removed)), *li_class] %>
<% end %>
<% diff.changed.each do |old, new| %>
<%= tag.li class: "changed" do %>
<%= tag.span old, class: ["removed", *li_class] %>→ <%= tag.span new, class: ["added", *li_class] %>
<% end %>
<% end %>
<% diff.unchanged.each do |item| %>
<%= tag.li item, class: ["unchanged", *li_class] %>
<% end %>
<% end %>