diaspora/app/helpers/report_helper.rb
Lukas Matt 95072d6010 Add get_reported_guid spec for report helper
* two new methods in report model reported_author and item
* merge deletion methods in report model

Signed-off-by: Lukas Matt <lukas@zauberstuhl.de>
2015-10-03 17:17:06 +02:00

19 lines
561 B
Ruby

# Copyright (c) 2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
module ReportHelper
def report_content(report)
case (item = report.item)
when Post
raw t("report.post_label", title: link_to(post_page_title(item), post_path(item.id)))
when Comment
raw t("report.comment_label", data: link_to(
h(comment_message(item)),
post_path(item.post.id, anchor: item.guid)
))
else
raw t("report.not_found")
end
end
end