Module: ReportHelper

Defined in:
app/helpers/report_helper.rb

Overview

Copyright © 2012, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Instance Method Summary collapse

Instance Method Details

#report_content(report) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/report_helper.rb', line 8

def report_content(report)
  case (item = report.item)
  when Post
    raw t("report.post_label", content: link_to(post_message(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
    t("report.not_found")
  end
end

#unreviewed_reports_countObject


22
23
24
# File 'app/helpers/report_helper.rb', line 22

def unreviewed_reports_count
  @unreviewed_reports_count ||= Report.where(reviewed: false).size
end