Files
danbooru/app/views/application/_diff_list.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

22 lines
602 B
Plaintext

<%# diff, ul_class, li_class %>
<%= tag.ul class: [*ul_class] do %>
<% diff.added.each do |item| %>
<%= tag.li item, class: ["added", *li_class] %>
<% end %>
<% diff.removed.each do |item| %>
<%= tag.li item, class: ["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 %>