2007-09-22 17:17:49 +04:00
|
|
|
<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %>
|
|
|
|
<select onchange="if (this.value != '') { window.location = this.value; }">
|
2007-12-21 21:01:02 +03:00
|
|
|
<option selected="selected"><%= l(:label_jump_to_a_project) %></option>
|
|
|
|
<option disabled="disabled">---</option>
|
2007-09-22 17:17:49 +04:00
|
|
|
<% user_projects_by_root.keys.sort.each do |root| %>
|
2008-12-30 17:24:51 +03:00
|
|
|
<%= content_tag('option', h(root.name), :value => url_for(:controller => 'projects', :action => 'show', :id => root, :jump => current_menu_item)) %>
|
2007-09-22 17:17:49 +04:00
|
|
|
<% user_projects_by_root[root].sort.each do |project| %>
|
|
|
|
<% next if project == root %>
|
2008-12-30 17:24:51 +03:00
|
|
|
<%= content_tag('option', ('» ' + h(project.name)), :value => url_for(:controller => 'projects', :action => 'show', :id => project, :jump => current_menu_item)) %>
|
2007-09-22 17:17:49 +04:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</select>
|