Feature #44284 » add_project_path.patch
| app/helpers/projects_helper.rb | ||
|---|---|---|
|
# Renders the projects index
|
||
|
def render_project_hierarchy(projects)
|
||
|
bookmarked_project_ids = User.current.bookmarked_project_ids
|
||
|
|
||
|
render_project_nested_lists(projects) do |project|
|
||
|
classes = project.css_classes.split
|
||
|
classes += %w(icon icon-user my-project) if User.current.member_of?(project)
|
||
|
classes += %w(icon icon-bookmarked-project) if bookmarked_project_ids.include?(project.id)
|
||
|
|
||
|
s = (+'').html_safe
|
||
|
if project.parent.present?
|
||
|
parent_missing_from_tree = !projects.include?(project.parent)
|
||
|
if parent_missing_from_tree
|
||
|
ancestor_links = project.ancestors.visible.reorder(:lft).collect { |p| link_to_project(p) }
|
||
|
s << breadcrumb(ancestor_links) if ancestor_links.present?
|
||
|
end
|
||
|
end
|
||
|
s = link_to_project(project, {}, :class => classes.uniq.join(' '))
|
||
|
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)
|
||
|
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)
|
||
|
s << link_to_project(project, {}, :class => classes.uniq.join(' '))
|
||
|
s << sprite_icon('user', l(:label_my_projects), icon_only: true) if User.current.member_of?(project)
|
||
|
s << sprite_icon('bookmarked', l(:label_my_bookmarks), icon_only: true) if bookmarked_project_ids.include?(project.id)
|
||
|
|
||
|
if project.description.present?
|
||
|
s << content_tag('div', textilizable(project, :short_description, :project => project), :class => 'wiki description')
|
||
|
s << content_tag('div', textilizable(project.short_description, :project => project), :class => 'wiki description')
|
||
|
end
|
||
|
|
||
|
s
|
||
|
end
|
||
|
end
|
||