Index: app/helpers/application_helper.rb
===================================================================
--- app/helpers/application_helper.rb (revision 14155)
+++ app/helpers/application_helper.rb (working copy)
@@ -327,14 +327,17 @@
# Renders the project quick-jump box
def render_project_jump_box
return unless User.current.logged?
- projects = User.current.projects.active.select(:id, :name, :identifier, :lft, :rgt).to_a
+ projects = []
+ user_projects = User.current.projects.active.to_a
+ user_projects.each { |p| projects.concat(p.self_and_ancestors.select(:id, :name, :identifier, :lft, :rgt).visible.to_a) }
+ projects.uniq!
if projects.any?
options =
("" +
'').html_safe
options << project_tree_options_for_select(projects, :selected => @project) do |p|
- { :value => project_path(:id => p, :jump => current_menu_item) }
+ { :value => project_path(:id => p, :jump => current_menu_item), :disabled => user_projects.include?(p) ? nil : 'disabled' }
end
select_tag('project_quick_jump_box', options, :onchange => 'if (this.value != \'\') { window.location = this.value; }')