Patch #19370 » project_jump_dropdown.patch
| app/helpers/application_helper.rb (working copy) | ||
|---|---|---|
|
# 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 =
|
||
|
("<option value=''>#{ l(:label_jump_to_a_project) }</option>" +
|
||
|
'<option value="" disabled="disabled">---</option>').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; }')
|
||
- « Previous
- 1
- 2
- Next »