From: Jean-Philippe Lang Date: Sat, 29 Mar 2014 14:39:24 +0000 (+0000) Subject: Merged r12986 (#16381). X-Git-Tag: 2.5.1~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=23ae3d1fa66a55c662afd1584f03ed4325858c0e;p=redmine.git Merged r12986 (#16381). git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13025 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index afd5ca083..06ec16c23 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -51,6 +51,15 @@ module ProjectsHelper content_tag('select', options.html_safe, :name => 'project[parent_id]', :id => 'project_parent_id') end + 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 }) + links.join(" | ").html_safe + end + # Renders the projects index def render_project_hierarchy(projects) render_project_nested_lists(projects) do |project| diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 504ac0266..a223bde74 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -3,12 +3,7 @@ <% end %>
- <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %> - <%= link_to(l(:label_issue_view_all), issues_path) + ' |' if User.current.allowed_to?(:view_issues, nil, :global => true) %> - <%= link_to(l(:label_overall_spent_time), time_entries_path) + ' |' if User.current.allowed_to?(:view_time_entries, nil, :global => true) %> - <%= link_to l(:label_overall_activity), - { :controller => 'activities', :action => 'index', - :id => nil } %> + <%= render_project_action_links %>

<%= l(:label_project_plural) %>