diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 983f3fd8b..c25bff049 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -195,6 +195,39 @@ module ApplicationHelper end end + # Renders a tree of projects as a nested set of unordered lists + # The given collection may be a subset of the whole project tree + # (eg. some intermediate nodes are private and can not be seen) + def render_project_nested_lists(projects) + s = '' + if projects.any? + ancestors = [] + original_project = @project + projects.each do |project| + # set the project environment to please macros. + @project = project + if (ancestors.empty? || project.is_descendant_of?(ancestors.last)) + s << "