diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-03-21 04:11:59 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-03-21 04:11:59 +0000 |
commit | aa9b8ea187a0f1e0516f01d65be802be2e7c703f (patch) | |
tree | 0c08122e44b68b7ef7b71f41a6a3dc50c16d5ede | |
parent | 83ce5c168750c7e4843ac093db0af17b0f45ca80 (diff) | |
download | redmine-aa9b8ea187a0f1e0516f01d65be802be2e7c703f.tar.gz redmine-aa9b8ea187a0f1e0516f01d65be802be2e7c703f.zip |
Use named routes.
git-svn-id: http://svn.redmine.org/redmine/trunk@12998 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/helpers/projects_helper.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 06ec16c23..d9315b96d 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -20,7 +20,7 @@ module ProjectsHelper def link_to_version(version, options = {}) return '' unless version && version.is_a?(Version) - link_to_if version.visible?, format_version_name(version), { :controller => 'versions', :action => 'show', :id => version }, options + link_to_if version.visible?, format_version_name(version), version_path(version), options end def project_settings_tabs @@ -53,10 +53,16 @@ module ProjectsHelper def render_project_action_links links = [] - links << link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) - links << link_to(l(:label_issue_view_all), issues_path) if User.current.allowed_to?(:view_issues, nil, :global => true) - links << link_to(l(:label_overall_spent_time), time_entries_path) if User.current.allowed_to?(:view_time_entries, nil, :global => true) - links << link_to(l(:label_overall_activity), { :controller => 'activities', :action => 'index', :id => nil }) + if User.current.allowed_to?(:add_project, nil, :global => true) + links << link_to(l(:label_project_new), new_project_path, :class => 'icon icon-add') + end + if User.current.allowed_to?(:view_issues, nil, :global => true) + links << link_to(l(:label_issue_view_all), issues_path) + end + if User.current.allowed_to?(:view_time_entries, nil, :global => true) + links << link_to(l(:label_overall_spent_time), time_entries_path) + end + links << link_to(l(:label_overall_activity), activity_path) links.join(" | ").html_safe end |