add role check for displaying ip address

This commit is contained in:
Albert Yi
2017-03-20 13:45:56 -07:00
committed by GitHub
parent 85d1f18ba5
commit cae86d8290

View File

@@ -6,10 +6,14 @@ module PostAppealsHelper
post.appeals.each do |appeal|
reason = DText.parse_inline(appeal.reason).html_safe
user = link_to_user(appeal.creator)
ip = link_to_ip(appeal.creator_ip_addr)
if CurrentUser.is_moderator?
ip = "(#{link_to_ip(appeal.creator_ip_addr)})"
else
ip = ""
end
time = time_ago_in_words_tagged(appeal.created_at)
html << "<li>#{reason} - #{user} (#{ip}) #{time}</li>"
html << "<li>#{reason} - #{user} #{ip} #{time}</li>"
end
html << '</ul>'