support pool version archive

This commit is contained in:
Albert Yi
2016-12-14 18:09:45 -08:00
parent 3c038f76f9
commit ee4ebce4d7
22 changed files with 300 additions and 64 deletions

View File

@@ -2,13 +2,13 @@ module PoolVersionsHelper
def pool_version_diff(pool_version)
html = ""
html << pool_version.changes[:added_posts].map do |post_id|
html << pool_version.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.changes[:removed_posts].map do |post_id|
html << pool_version.removed_post_ids.map do |post_id|
'<del><a href="/posts/' + post_id.to_s + '">' + post_id.to_s + '</a></del>'
end.join(" ")