summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-10 18:33:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-10 18:33:36 +0000
commit2734eaffd823986c0da99ee4162000054571f422 (patch)
treee6fcd3d31fa3851a1196945a9dd473d041487923 /app
parentf1a42f21a6e6f7931973df3344525e222c9c7cc9 (diff)
downloadredmine-2734eaffd823986c0da99ee4162000054571f422.tar.gz
redmine-2734eaffd823986c0da99ee4162000054571f422.zip
Adds a link to all projects in the jump drop down (#23310).
git-svn-id: http://svn.redmine.org/redmine/trunk@16172 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb5
-rw-r--r--app/helpers/application_helper.rb4
-rw-r--r--app/views/projects/index.js.erb2
3 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 9284b8d09..99a39af3b 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -36,6 +36,11 @@ class ProjectsController < ApplicationController
# Lists visible projects
def index
+ # try to redirect to the requested menu item
+ if params[:jump] && redirect_to_menu_item(params[:jump])
+ return
+ end
+
scope = Project.visible.sorted
respond_to do |format|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 13075126d..b319537ee 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -362,9 +362,11 @@ module ApplicationHelper
text = @project.try(:name) || l(:label_jump_to_a_project)
trigger = content_tag('span', text, :class => 'drdn-trigger')
q = text_field_tag('q', '', :id => 'projects-quick-search', :class => 'autocomplete', :data => {:automcomplete_url => projects_path(:format => 'js')})
+ all = link_to(l(:label_project_all), projects_path(:jump => current_menu_item), :class => (@project.nil? && controller.class.main_menu ? 'selected' : nil))
content = content_tag('div',
content_tag('div', q, :class => 'quick-search') +
- content_tag('div', render_projects_for_jump_box(projects, @project), :class => 'drdn-items selection'),
+ content_tag('div', render_projects_for_jump_box(projects, @project), :class => 'drdn-items projects selection') +
+ content_tag('div', all, :class => 'drdn-items all-projects selection'),
:class => 'drdn-content'
)
diff --git a/app/views/projects/index.js.erb b/app/views/projects/index.js.erb
index b4731fb09..de6c3f579 100644
--- a/app/views/projects/index.js.erb
+++ b/app/views/projects/index.js.erb
@@ -1,2 +1,2 @@
<% s = @projects.any? ? render_projects_for_jump_box(@projects) : content_tag('span', l(:label_no_data)) %>
-$('#project-jump .drdn-items').html('<%= escape_javascript s %>');
+$('#project-jump .drdn-items.projects').html('<%= escape_javascript s %>');