diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-03-21 00:27:42 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-03-21 00:27:42 +0000 |
commit | f4e5025aed8028f8604629ede459a2a317dee676 (patch) | |
tree | f5f876577ffef831b8f5cfc99c9bade5d21e2d1b /app/helpers | |
parent | b29c48717d8da9a8f72b92e7c7c0eef9d00951d9 (diff) | |
download | redmine-f4e5025aed8028f8604629ede459a2a317dee676.tar.gz redmine-f4e5025aed8028f8604629ede459a2a317dee676.zip |
Extract code to render project context links to helper (#16381).
Patch by Michael Esemplare.
git-svn-id: http://svn.redmine.org/redmine/trunk@12986 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/projects_helper.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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| |