1 # frozen_string_literal: true
 
   4   def reportable_url(reportable)
 
   7       diary_entry_url(reportable.user, reportable)
 
  11       diary_entry_url(reportable.diary_entry.user, reportable.diary_entry, :anchor => "comment#{reportable.id}")
 
  17   def reportable_title(reportable)
 
  22       reportable.display_name
 
  24       I18n.t("issues.helper.reportable_title.diary_comment", :entry_title => reportable.diary_entry.title, :comment_id => reportable.id)
 
  26       I18n.t("issues.helper.reportable_title.note", :note_id => reportable.id)
 
  30   def reportable_heading(reportable)
 
  31     heading_params = { :title => link_to(reportable_title(reportable), reportable_url(reportable)) }
 
  32     heading_params[:datetime_created] = reportable_heading_time(reportable.created_at)
 
  33     heading_params[:datetime_updated] = reportable_heading_time(reportable.updated_at) unless reportable.is_a? User
 
  37       t "issues.helper.reportable_heading.diary_comment_html", **heading_params
 
  39       t "issues.helper.reportable_heading.diary_entry_html", **heading_params
 
  41       t "issues.helper.reportable_heading.note_html", **heading_params
 
  43       t "issues.helper.reportable_heading.user_html", **heading_params
 
  48     count = Issue.visible_to(current_user).open.limit(Settings.max_issues_count).size
 
  49     if count >= Settings.max_issues_count
 
  50       tag.span(I18n.t("count.at_least_pattern", :count => Settings.max_issues_count), :class => "badge count-number")
 
  52       tag.span(count, :class => "badge count-number")
 
  58   def reportable_heading_time(datetime)
 
  59     tag.time l(datetime.to_datetime, :format => :friendly), :datetime => datetime.xmlschema