better formatting for appeal/flag info

This commit is contained in:
albert
2011-12-13 17:20:50 -05:00
parent d247aff48c
commit 1ad033f08b
2 changed files with 18 additions and 10 deletions

View File

@@ -1,9 +1,13 @@
module PostAppealsHelper
def post_appeal_reasons(post)
post.appeals.map do |appeal|
content_tag("span", :class => "flag-and-reason-count") do
(appeal.reason + " (" + link_to(appeal.creator.name, user_path(appeal.creator_id)) + ")").html_safe
end
end.join("; ").html_safe
html = []
html << '<ul>'
post.appeals.each do |appeal|
html << '<li>' + appeal.reason + ' - ' + link_to(appeal.creator.name, user_path(appeal.creator)) + ' ' + time_ago_in_words(appeal.created_at) + ' ago</li>'
end
html << '</ul>'
html.join("\n").html_safe
end
end