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| %>
|
2007-12-03 13:28:08 +03:00
|
|
|
<%= content_tag('option', h(root.name), :value => url_for(:controller => 'projects', :action => 'show', :id => root)) %>
|
2007-09-22 17:17:49 +04:00
|
|
|
<% user_projects_by_root[root].sort.each do |project| %>
|
|
|
|
<% next if project == root %>
|
2007-12-03 13:28:08 +03:00
|
|
|
<%= content_tag('option', ('» ' + h(project.name)), :value => url_for(:controller => 'projects', :action => 'show', :id => project)) %>
|
2007-09-22 17:17:49 +04:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</select>
|