Merge pull request #4003 from evazion/fix-3946

Artist versions: improve diffing of urls and other names (#3946)
This commit is contained in:
Albert Yi
2018-12-08 20:43:27 -08:00
committed by GitHub
6 changed files with 73 additions and 71 deletions

View File

@@ -0,0 +1,21 @@
<%# diff %>
<ul class="diff-list">
<% diff.added.each do |item| %>
<%= tag.li item, class: (item.in?(diff.obsolete_added) ? "obsolete added" : "added") %>
<% end %>
<% diff.removed.each do |item| %>
<%= tag.li item, class: (item.in?(diff.obsolete_removed) ? "obsolete removed" : "removed") %>
<% end %>
<% diff.changed.each do |old, new| %>
<%= tag.li class: "changed" do %>
<%= tag.span old, class: "removed" %>→ <%= tag.span new, class: "added" %>
<% end %>
<% end %>
<% diff.unchanged.each do |item| %>
<%= tag.li item, class: "unchanged" %>
<% end %>
</ul>