| 74 |
74 |
# Renders the projects index
|
| 75 |
75 |
def render_project_hierarchy(projects)
|
| 76 |
76 |
bookmarked_project_ids = User.current.bookmarked_project_ids
|
|
77 |
|
| 77 |
78 |
render_project_nested_lists(projects) do |project|
|
| 78 |
79 |
classes = project.css_classes.split
|
| 79 |
80 |
classes += %w(icon icon-user my-project) if User.current.member_of?(project)
|
| 80 |
81 |
classes += %w(icon icon-bookmarked-project) if bookmarked_project_ids.include?(project.id)
|
|
82 |
|
|
83 |
s = (+'').html_safe
|
|
84 |
|
|
85 |
if project.parent.present?
|
|
86 |
parent_missing_from_tree = !projects.include?(project.parent)
|
|
87 |
if parent_missing_from_tree
|
|
88 |
ancestor_links = project.ancestors.visible.reorder(:lft).collect { |p| link_to_project(p) }
|
|
89 |
s << breadcrumb(ancestor_links) if ancestor_links.present?
|
|
90 |
end
|
|
91 |
end
|
| 81 |
92 |
|
| 82 |
|
s = link_to_project(project, {}, :class => classes.uniq.join(' '))
|
| 83 |
|
s << tag.span(sprite_icon('user', l(:label_my_projects), icon_only: true), class: 'icon-only icon-user my-project') if User.current.member_of?(project)
|
| 84 |
|
s << tag.span(sprite_icon('bookmarked', l(:label_my_bookmarks), icon_only: true), class: 'icon-only icon-bookmarked-project') if bookmarked_project_ids.include?(project.id)
|
|
93 |
s << link_to_project(project, {}, :class => classes.uniq.join(' '))
|
|
94 |
s << sprite_icon('user', l(:label_my_projects), icon_only: true) if User.current.member_of?(project)
|
|
95 |
s << sprite_icon('bookmarked', l(:label_my_bookmarks), icon_only: true) if bookmarked_project_ids.include?(project.id)
|
|
96 |
|
| 85 |
97 |
if project.description.present?
|
| 86 |
|
s << content_tag('div', textilizable(project, :short_description, :project => project), :class => 'wiki description')
|
|
98 |
s << content_tag('div', textilizable(project.short_description, :project => project), :class => 'wiki description')
|
| 87 |
99 |
end
|
|
100 |
|
| 88 |
101 |
s
|
| 89 |
102 |
end
|
| 90 |
103 |
end
|