if projects.any?
ancestors = []
original_project = @project
- projects.each do |project|
+ projects.sort_by(&:lft).each do |project|
# set the project environment to please macros.
@project = project
if (ancestors.empty? || project.is_descendant_of?(ancestors.last))
Project.project_tree(projects, &block)
end
- def project_nested_ul(projects, &block)
- s = ''
- if projects.any?
- ancestors = []
- projects.sort_by(&:lft).each do |project|
- if (ancestors.empty? || project.is_descendant_of?(ancestors.last))
- s << "<ul>\n"
- else
- ancestors.pop
- s << "</li>"
- while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
- ancestors.pop
- s << "</ul></li>\n"
- end
- end
- s << "<li>"
- s << yield(project).to_s
- ancestors << project
- end
- s << ("</li></ul>\n" * ancestors.size)
- end
- s.html_safe
- end
-
def principals_check_box_tags(name, principals)
s = ''
principals.sort.each do |principal|
<div class="splitcontentright">
<% if @projects.any? %>
<fieldset class="box" id="tracker_project_ids"><legend><%= l(:label_project_plural) %></legend>
-<%= project_nested_ul(@projects) do |p|
+<%= render_project_nested_lists(@projects) do |p|
content_tag('label', check_box_tag('tracker[project_ids][]', p.id, @tracker.projects.include?(p), :id => nil) + ' ' + h(p))
end %>
<%= hidden_field_tag('tracker[project_ids][]', '', :id => nil) %>
select#issue_done_ratio { width: 95px; }
ul.projects {margin:0; padding-left:1em;}
+ul.projects ul {padding-left:1.6em;}
ul.projects.root {margin:0; padding:0;}
ul.projects li {list-style-type:none;}
-#projects-index ul.projects ul.projects { border-left: 3px solid #e0e0e0; }
+#projects-index ul.projects ul.projects { border-left: 3px solid #e0e0e0; padding-left:1em;}
#projects-index ul.projects li.root {margin-bottom: 1em;}
#projects-index ul.projects li.child {margin-top: 1em;}
#projects-index ul.projects div.root a.project { font-family: "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 16px; margin: 0 0 10px 0; }
-#notified-projects ul.projects ul {padding-left:1.6em;}
.my-project { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; }
-#tracker_project_ids ul { margin: 0; padding-left: 1em; }
-#tracker_project_ids li { list-style-type:none; }
-
#related-issues li img {vertical-align:middle;}
ul.properties {padding:0; font-size: 0.9em; color: #777;}