2 def reportable_url(reportable)
3 class_name = reportable.class.name
6 link_to reportable.title, :controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.user.display_name, :id => reportable.id
8 link_to reportable.display_name.to_s, :controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.display_name
10 link_to "#{reportable.diary_entry.title}, Comment id ##{reportable.id}", :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
12 link_to "Changeset ##{reportable.id}", :controller => :browse, :action => :changeset, :id => reportable.id
14 link_to "Note ##{reportable.id}", :controller => :browse, :action => :note, :id => reportable.id
18 def reports_url(issue)
19 class_name = issue.reportable.class.name
22 link_to issue.reportable.title, issue
24 link_to issue.reportable.display_name.to_s, issue
26 link_to "#{issue.reportable.diary_entry.title}, Comment id ##{issue.reportable.id}", issue
28 link_to "Changeset ##{issue.reportable.id}", issue
30 link_to "Note ##{issue.reportable.id}", issue
34 def instance_url(reportable)
35 class_name = reportable.class.name
38 link_to "Show Instance", :controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.user.display_name, :id => reportable.id
40 link_to "Show Instance", :controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.display_name
42 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
44 link_to "Show Instance", :controller => :browse, :action => :changeset, :id => reportable.id
46 link_to "Show Instance", :controller => :browse, :action => :note, :id => reportable.id
50 def report_type(report_class)
53 t("activerecord.models.diary_entry")
55 t("activerecord.models.user")
57 t("activerecord.models.diary_comment")
59 t("activerecord.models.changeset")
61 t("activerecord.models.note")