summaryrefslogtreecommitdiffstats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ae6c48bec..493721cb3 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -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