summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-14 19:16:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-14 19:16:29 +0000
commit1da158edcffbb3db0ae88e781bcd4a412124f478 (patch)
tree59b41fc2d9eb63359d4734fd4b1bb76543215ef4 /app
parent9a80e118b96e3537392f1aad42505c4c1843519c (diff)
downloadredmine-1da158edcffbb3db0ae88e781bcd4a412124f478.tar.gz
redmine-1da158edcffbb3db0ae88e781bcd4a412124f478.zip
Use route helper in #link_to_project.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11184 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb20
-rw-r--r--app/views/admin/projects.html.erb2
2 files changed, 18 insertions, 4 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
diff --git a/app/views/admin/projects.html.erb b/app/views/admin/projects.html.erb
index c2da70cbe..00c13d581 100644
--- a/app/views/admin/projects.html.erb
+++ b/app/views/admin/projects.html.erb
@@ -27,7 +27,7 @@
<tbody>
<% project_tree(@projects) do |project, level| %>
<tr class="<%= cycle("odd", "even") %> <%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
- <td class="name"><span><%= link_to_project(project, {:action => (project.active? ? 'settings' : 'show')}, :title => project.short_description) %></span></td>
+ <td class="name"><span><%= link_to_project_settings(project, {}, :title => project.short_description) %></span></td>
<td align="center"><%= checked_image project.is_public? %></td>
<td align="center"><%= format_date(project.created_on) %></td>
<td class="buttons">