Subprojects are now grouped by projects in the 'Projects' top navigation drop-down menu.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@703 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
17a3f9e44c
commit
a19a0d7b92
|
@ -116,6 +116,10 @@ class Project < ActiveRecord::Base
|
||||||
def all_custom_fields
|
def all_custom_fields
|
||||||
@all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq
|
@all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def <=>(project)
|
||||||
|
name <=> project.name
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
def validate
|
def validate
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<div id="menuAllProjects" class="menu" onmouseover="menuMouseover(event)">
|
||||||
|
<%= link_to l(:label_project_all), {:controller => 'projects' }, :class => "menuItem" %>
|
||||||
|
|
||||||
|
<% user_projects_by_root = User.current.projects.find(:all, :include => :parent, :limit => 20).group_by(&:root) %>
|
||||||
|
<% user_projects_by_root.keys.sort.each do |root| %>
|
||||||
|
<%= link_to root.name, {:controller => 'projects', :action => 'show', :id => root}, :class => "menuItem" %>
|
||||||
|
<% user_projects_by_root[root].sort.each do |project| %>
|
||||||
|
<% next if project == root %>
|
||||||
|
<%= link_to(('» ' + project.name), {:controller => 'projects', :action => 'show', :id => project}, :class => "menuItem") %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
|
@ -64,18 +64,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if User.current.admin? %>
|
<%= render(:partial => 'admin/menu') if User.current.admin? %>
|
||||||
<%= render :partial => 'admin/menu' %>
|
<%= render(:partial => 'layouts/projects_menu') if User.current.memberships.any? %>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if User.current.memberships.any? %>
|
|
||||||
<div id="menuAllProjects" class="menu" onmouseover="menuMouseover(event)">
|
|
||||||
<%= link_to l(:label_project_all), {:controller => 'projects' }, :class => "menuItem" %>
|
|
||||||
<% User.current.memberships.find(:all, :limit => 20).each do |membership| %>
|
|
||||||
<%= link_to membership.project.name, {:controller => 'projects',:action => 'show', :id => membership.project }, :class => "menuItem" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div id="subcontent">
|
<div id="subcontent">
|
||||||
<% if @project && !@project.new_record? %>
|
<% if @project && !@project.new_record? %>
|
||||||
|
|
Loading…
Reference in New Issue