diff --git a/app/models/project.rb b/app/models/project.rb index 83ab2bdfba..3c7ed72836 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -644,11 +644,15 @@ class Project < ActiveRecord::Base description.gsub(/\A(.{#{length}}[^\n\r]*).*\z/m, '\1...').strip end - def css_classes + def css_classes(options = {}) s = 'project' - s << ' root' if root? - s << ' child' if child? - s << (leaf? ? ' leaf' : ' parent') + if options[:ignore_hierarchy] + s << ' root leaf' + else + s << ' root' if root? + s << ' child' if child? + s << (leaf? ? ' leaf' : ' parent') + end s end diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 966fc02693..2a23707d77 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -96,9 +96,9 @@ See doc/COPYRIGHT.rdoc for more details.
<% project_tree_when_sorted(@projects) do |project, level| %> - <% show_hierarchy = sort_clause =~ /^lft / + <% show_hierarchy = sort_clause =~ /^lft/ ? true : false efective_level = show_hierarchy ? level : 0 %> -