reverted post version tag change for danbooru2
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user