3 def reportable_url(reportable)
4 class_name = reportable.class.name
7 link_to reportable.title, :controller => reportable.class.name.underscore,
9 :display_name => reportable.user.display_name,
12 link_to reportable.display_name.to_s, :controller => reportable.class.name.underscore,
14 :display_name => reportable.display_name
16 link_to "#{reportable.diary_entry.title}, Comment id ##{reportable.id}", :controller => reportable.diary_entry.class.name.underscore,
18 :display_name => reportable.diary_entry.user.display_name,
19 :id => reportable.diary_entry.id,
20 :comment_id => reportable.id
22 link_to "Changeset ##{reportable.id}", :controller => :browse,
23 :action => :changeset,
26 link_to "Note ##{reportable.id}", :controller => :browse,
34 def reports_url(issue)
35 class_name = issue.reportable.class.name
38 link_to issue.reportable.title, issue
40 link_to issue.reportable.display_name.to_s, issue
42 link_to "#{issue.reportable.diary_entry.title}, Comment id ##{issue.reportable.id}", issue
44 link_to "Changeset ##{issue.reportable.id}",issue
46 link_to "Note ##{issue.reportable.id}", issue
52 def instance_url(reportable)
53 class_name = reportable.class.name
56 link_to "Show Instance", :controller => reportable.class.name.underscore,
58 :display_name => reportable.user.display_name,
61 link_to "Show Instance", :controller => reportable.class.name.underscore,
63 :display_name => reportable.display_name
65 link_to "Show Instance", :controller => reportable.diary_entry.class.name.underscore,
67 :display_name => reportable.diary_entry.user.display_name,
68 :id => reportable.diary_entry.id,
69 :comment_id => reportable.id
71 link_to "Show Instance", :controller => :browse,
72 :action => :changeset,
75 link_to "Show Instance", :controller => :browse,
83 def sortable(column,title=nil)
84 title ||= column.titleize
85 direction = column == sort_column && sort_direction == "asc" ? "desc" : "asc"
86 if column == sort_column
87 arrow = direction == "desc" ? ["25B2".hex].pack("U") : ["25BC".hex].pack("U")
90 link_to title, params.merge(:sort => column, :direction => direction)