fixes #2869: Add way to differentiate Pool Descriptions from Pool History
This commit is contained in:
@@ -1,22 +1,19 @@
|
||||
module PoolVersionsHelper
|
||||
def pool_version_diff(pool_version)
|
||||
def pool_version_diff(pool_version, previous = nil, options = {})
|
||||
html = ""
|
||||
|
||||
html << pool_version.added_post_ids.map do |post_id|
|
||||
diff = pool_version.build_diff(previous)
|
||||
|
||||
html << diff[:added_post_ids].map do |post_id|
|
||||
'<ins><a href="/posts/' + post_id.to_s + '">' + post_id.to_s + '</a></ins>'
|
||||
end.join(" ")
|
||||
|
||||
html << " "
|
||||
|
||||
html << pool_version.removed_post_ids.map do |post_id|
|
||||
html << diff[:removed_post_ids].map do |post_id|
|
||||
'<del><a href="/posts/' + post_id.to_s + '">' + post_id.to_s + '</a></del>'
|
||||
end.join(" ")
|
||||
|
||||
if pool_version.description_changed?
|
||||
html << '<ins>desc:' + h(pool_version.description) + '</ins> '
|
||||
html << '<del>desc:' + h(pool_version.previous.description) + '</del> '
|
||||
end
|
||||
|
||||
return html.html_safe
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user