reverted post version tag change for danbooru2

This commit is contained in:
albert
2011-10-22 21:34:32 -04:00
parent 0de90d487b
commit 69044f3389
13 changed files with 100 additions and 61 deletions

View File

@@ -27,7 +27,7 @@ module ApplicationHelper
zone = time.strftime("%z")
datetime = time.strftime("%Y-%m-%dT%H:%M" + zone[0, 3] + ":" + zone[3, 2])
content_tag(:time, content || datetime, :datetime => datetime)
content_tag(:time, content || datetime, :datetime => datetime, :title => time.to_formatted_s)
end
def compact_time(time)

View File

@@ -1,2 +1,16 @@
module PostVersionsHelper
def post_version_diff(post_version)
diff = post_version.diff(post_version.previous)
html = []
diff[:added_tags].each do |tag|
html << '<ins>' + tag + '</ins>'
end
diff[:removed_tags].each do |tag|
html << '<del>' + tag + '</del>'
end
diff[:unchanged_tags].each do |tag|
html << '<span>' + tag + '</span>' unless tag =~ /^(?:rating|source):/
end
return html.join(" ").html_safe
end
end