- def instance_url(reportable)
- class_name = reportable.class.name
- case class_name
- when "DiaryEntry"
- link_to "Show Instance", :controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.user.display_name, :id => reportable.id
- when "User"
- link_to "Show Instance", :controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.display_name
- when "DiaryComment"
- link_to "Show Instance", :controller => reportable.diary_entry.class.name.underscore, :action => :view, :display_name => reportable.diary_entry.user.display_name, :id => reportable.diary_entry.id, :comment_id => reportable.id
- when "Changeset"
- link_to "Show Instance", :controller => :browse, :action => :changeset, :id => reportable.id
- when "Note"
- link_to "Show Instance", :controller => :browse, :action => :note, :id => reportable.id
+ def reportable_heading(reportable)
+ heading_params = { :title => link_to(reportable_title(reportable), reportable_url(reportable)) }
+ heading_params[:datetime_created] = reportable_heading_time(reportable.created_at)
+ heading_params[:datetime_updated] = reportable_heading_time(reportable.updated_at) unless reportable.is_a? User
+
+ case reportable
+ when DiaryComment
+ t "issues.helper.reportable_heading.diary_comment_html", **heading_params
+ when DiaryEntry
+ t "issues.helper.reportable_heading.diary_entry_html", **heading_params
+ when Note
+ t "issues.helper.reportable_heading.note_html", **heading_params
+ when User
+ t "issues.helper.reportable_heading.user_html", **heading_params