Show full path in header UI for nested groups/projects
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
0764c2ead1
commit
6328f26c41
2 changed files with 11 additions and 4 deletions
|
@ -12,11 +12,18 @@ module GroupsHelper
|
|||
end
|
||||
|
||||
def group_title(group, name = nil, url = nil)
|
||||
full_title = link_to(simple_sanitize(group.name), group_path(group))
|
||||
full_title = ''
|
||||
|
||||
group.parents.each do |parent|
|
||||
full_title += link_to(simple_sanitize(parent.name), group_path(parent))
|
||||
full_title += ' / '.html_safe
|
||||
end
|
||||
|
||||
full_title += link_to(simple_sanitize(group.name), group_path(group))
|
||||
full_title += ' · '.html_safe + link_to(simple_sanitize(name), url) if name
|
||||
|
||||
content_tag :span do
|
||||
full_title
|
||||
full_title.html_safe
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ module ProjectsHelper
|
|||
def project_title(project)
|
||||
namespace_link =
|
||||
if project.group
|
||||
link_to(simple_sanitize(project.group.name), group_path(project.group))
|
||||
group_title(project.group)
|
||||
else
|
||||
owner = project.namespace.owner
|
||||
link_to(simple_sanitize(owner.name), user_path(owner))
|
||||
|
|
Loading…
Reference in a new issue