Fixed problem with URL linking outside Request-cycle

This seems to happen on some versions of Rails and/or some configuration
combinations on the server. It is a simple fix to make all links relative
instead of absolute in all cases.
This commit is contained in:
Magnus Bergmark 2009-05-08 11:50:01 +02:00
parent fb3064462c
commit 603ca8d986

View File

@ -2,11 +2,11 @@
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 << link_to(l(:label_graphs_old_issues), {:controller => 'graphs', :action => 'old_issues', :only_path => true}) if context[:project].nil?
output << link_to(l(:label_graphs_old_issues), {:controller => 'graphs', :action => 'old_issues', :project_id => context[:project], :only_path => true}) 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 << link_to(l(:label_graphs_issue_growth), {:controller => 'graphs', :action => 'issue_growth', :only_path => true}) if context[:project].nil?
output << link_to(l(:label_graphs_issue_growth), {:controller => 'graphs', :action => 'issue_growth', :project_id => context[:project], :only_path => true}) unless context[:project].nil?
output << "<br/>"
return output
end