@@ -0,0 +1,12 | |||||
|
1 | <div id="menuAllProjects" class="menu" onmouseover="menuMouseover(event)"> | |||
|
2 | <%= link_to l(:label_project_all), {:controller => 'projects' }, :class => "menuItem" %> | |||
|
3 | ||||
|
4 | <% user_projects_by_root = User.current.projects.find(:all, :include => :parent, :limit => 20).group_by(&:root) %> | |||
|
5 | <% user_projects_by_root.keys.sort.each do |root| %> | |||
|
6 | <%= link_to root.name, {:controller => 'projects', :action => 'show', :id => root}, :class => "menuItem" %> | |||
|
7 | <% user_projects_by_root[root].sort.each do |project| %> | |||
|
8 | <% next if project == root %> | |||
|
9 | <%= link_to(('» ' + project.name), {:controller => 'projects', :action => 'show', :id => project}, :class => "menuItem") %> | |||
|
10 | <% end %> | |||
|
11 | <% end %> | |||
|
12 | </div> |
@@ -116,6 +116,10 class Project < ActiveRecord::Base | |||||
116 | def all_custom_fields |
|
116 | def all_custom_fields | |
117 | @all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq |
|
117 | @all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq | |
118 | end |
|
118 | end | |
|
119 | ||||
|
120 | def <=>(project) | |||
|
121 | name <=> project.name | |||
|
122 | end | |||
119 |
|
123 | |||
120 | protected |
|
124 | protected | |
121 | def validate |
|
125 | def validate |
@@ -64,18 +64,8 | |||||
64 | </ul> |
|
64 | </ul> | |
65 | </div> |
|
65 | </div> | |
66 |
|
66 | |||
67 | <% if User.current.admin? %> |
|
67 | <%= render(:partial => 'admin/menu') if User.current.admin? %> | |
68 | <%= render :partial => 'admin/menu' %> |
|
68 | <%= render(:partial => 'layouts/projects_menu') if User.current.memberships.any? %> | |
69 | <% end %> |
|
|||
70 |
|
||||
71 | <% if User.current.memberships.any? %> |
|
|||
72 | <div id="menuAllProjects" class="menu" onmouseover="menuMouseover(event)"> |
|
|||
73 | <%= link_to l(:label_project_all), {:controller => 'projects' }, :class => "menuItem" %> |
|
|||
74 | <% User.current.memberships.find(:all, :limit => 20).each do |membership| %> |
|
|||
75 | <%= link_to membership.project.name, {:controller => 'projects',:action => 'show', :id => membership.project }, :class => "menuItem" %> |
|
|||
76 | <% end %> |
|
|||
77 | </div> |
|
|||
78 | <% end %> |
|
|||
79 |
|
69 | |||
80 | <div id="subcontent"> |
|
70 | <div id="subcontent"> | |
81 | <% if @project && !@project.new_record? %> |
|
71 | <% if @project && !@project.new_record? %> |
General Comments 0
You need to be logged in to leave comments.
Login now