/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.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
require 'dtext'
|
||||
|
||||
module ApplicationHelper
|
||||
def diff_list_html(new, old, latest)
|
||||
def diff_list_html(new, old, latest, ul_class: ["diff-list"], li_class: [])
|
||||
diff = SetDiff.new(new, old, latest)
|
||||
render "diff_list", diff: diff
|
||||
render "diff_list", diff: diff, ul_class: ul_class, li_class: li_class
|
||||
end
|
||||
|
||||
def wordbreakify(string)
|
||||
|
||||
@@ -12,9 +12,12 @@ module WikiPageVersionsHelper
|
||||
status.join(" ")
|
||||
end
|
||||
|
||||
def wiki_other_names_diff(thispage, otherpage)
|
||||
pattern = Regexp.new('\S+|\s+')
|
||||
DiffBuilder.new("#{thispage.other_names}\n\n", "#{otherpage.other_names}\n\n", pattern).build
|
||||
def wiki_other_names_diff(new_version, old_version)
|
||||
new_names = new_version.other_names
|
||||
old_names = old_version.other_names
|
||||
latest_names = new_version.wiki_page.other_names
|
||||
|
||||
diff_list_html(new_names, old_names, latest_names, ul_class: ["wiki-other-names-diff-list list-inline"], li_class: ["wiki-other-name"])
|
||||
end
|
||||
|
||||
def wiki_body_diff(thispage, otherpage)
|
||||
|
||||
Reference in New Issue
Block a user