Implement basic upload tags change report

This commit is contained in:
Type-kun
2017-01-27 14:54:52 +05:00
parent 1d25d1315a
commit 1e8eceeba9
5 changed files with 126 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
module UploadTagsReportHelper
def diff_to_current(report)
html = []
report.added_tags_array.each do |tag|
html << '<ins>+' + link_to(wordbreakify(tag), posts_path(:tags => tag)) + '</ins>'
end
report.removed_tags_array.each do |tag|
html << '<del>-' + link_to(wordbreakify(tag), posts_path(:tags => tag)) + '</del>'
end
return html.join(" ").html_safe
end
end