Use route helper in #link_to_project.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11184 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2013-01-14 19:16:29 +00:00
parent 9a80e118b9
commit 1da158edcf
3 changed files with 29 additions and 4 deletions
+17 -3
View File
@@ -141,10 +141,24 @@ module ApplicationHelper
#
def link_to_project(project, options={}, html_options = nil)
if project.archived?
h(project)
else
h(project.name)
elsif options.key?(:action)
ActiveSupport::Deprecation.warn "#link_to_project with :action option is deprecated and will be removed in Redmine 3.0."
url = {:controller => 'projects', :action => 'show', :id => project}.merge(options)
link_to(h(project), url, html_options)
link_to project.name, url, html_options
else
link_to project.name, project_path(project, options), html_options
end
end
# Generates a link to a project settings if active
def link_to_project_settings(project, options={}, html_options=nil)
if project.active?
link_to project.name, settings_project_path(project, options), html_options
elsif project.archived?
h(project.name)
else
link_to project.name, project_path(project, options), html_options
end
end