gitlab-org--gitlab-foss/app/helpers/breadcrumbs_helper.rb
Phil Hughes 05844d8b47
Fixed breadcrumb title not linking
This fixes the breadcrumb titles not having links. This was a regression
in the updated breadcrumbs introduced in 10.0.

This introduces the link for all pages rather than selectively doing it.
This will cover issues, merge requests, pipelines, jobs etc.

Closes #38059
2017-09-27 17:06:24 +01:00

33 lines
735 B
Ruby

module BreadcrumbsHelper
def add_to_breadcrumbs(text, link)
@breadcrumbs_extra_links ||= []
@breadcrumbs_extra_links.push({
text: text,
link: link
})
end
def breadcrumb_title_link
return @breadcrumb_link if @breadcrumb_link
request.path
end
def breadcrumb_title(title)
return if defined?(@breadcrumb_title)
@breadcrumb_title = title
end
def breadcrumb_list_item(link)
content_tag "li" do
link + icon("angle-right", class: "breadcrumbs-list-angle")
end
end
def add_to_breadcrumb_dropdown(link, location: :before)
@breadcrumb_dropdown_links ||= {}
@breadcrumb_dropdown_links[location] ||= []
@breadcrumb_dropdown_links[location] << link
end
end