module PostFlagsHelper
def post_flag_reasons(post)
html = []
html << '
'
post.flags.each do |flag|
html << '- '
html << format_text(flag.reason, inline: true)
if CurrentUser.can_view_flagger?(flag.creator_id)
html << " - #{link_to_user(flag.creator)}"
if CurrentUser.is_moderator?
html << " (#{link_to_ip(flag.creator_ip_addr)})"
end
end
html << ' - ' + time_ago_in_words_tagged(flag.created_at)
if flag.is_resolved?
html << ' RESOLVED'
end
html << '
'
end
html << '
'
html.join("\n").html_safe
end
end