redmine-graphs-plugin/lib/issues_sidebar_graph_hook.rb
Brad Beattie 94d281822a * Fixing whitespace
* Localizing graphs sidebar title
2009-04-01 10:33:41 -07:00

14 lines
887 B
Ruby
Executable File

# Provides a link to the issue age graph on the issue index page
class IssuesSidebarGraphHook < Redmine::Hook::ViewListener
def view_issues_sidebar_issues_bottom(context = { })
output = "<h3>#{l(:label_graphs)}</h3>"
output << link_to(l(:label_graphs_old_issues), {:controller => 'graphs', :action => 'old_issues'}) if context[:project].nil?
output << link_to(l(:label_graphs_old_issues), {:controller => 'graphs', :action => 'old_issues', :project_id => context[:project]}) unless context[:project].nil?
output << "<br/>"
output << link_to(l(:label_graphs_issue_growth), {:controller => 'graphs', :action => 'issue_growth'}) if context[:project].nil?
output << link_to(l(:label_graphs_issue_growth), {:controller => 'graphs', :action => 'issue_growth', :project_id => context[:project]}) unless context[:project].nil?
output << "<br/>"
return output
end
end