summaryrefslogtreecommitdiffstats
path: root/app/views/layouts/_project_selector.rhtml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/layouts/_project_selector.rhtml')
-rw-r--r--app/views/layouts/_project_selector.rhtml12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/views/layouts/_project_selector.rhtml b/app/views/layouts/_project_selector.rhtml
new file mode 100644
index 000000000..499879c8c
--- /dev/null
+++ b/app/views/layouts/_project_selector.rhtml
@@ -0,0 +1,12 @@
+<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %>
+<select onchange="if (this.value != '') { window.location = this.value; }">
+<option selected><%= l(:label_jump_to_a_project) %></option>
+<option disabled>---</option>
+<% user_projects_by_root.keys.sort.each do |root| %>
+ <%= content_tag('option', root.name, :value => url_for(:controller => 'projects', :action => 'show', :id => root)) %>
+ <% user_projects_by_root[root].sort.each do |project| %>
+ <% next if project == root %>
+ <%= content_tag('option', ('&#187; ' + project.name), :value => url_for(:controller => 'projects', :action => 'show', :id => project)) %>
+ <% end %>
+<% end %>
+</select>