debian-mirror-gitlab/app/helpers/breadcrumbs_helper.rb

34 lines
755 B
Ruby
Raw Normal View History

2017-09-10 17:25:29 +05:30
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
2018-03-17 18:26:18 +05:30
request.path
2017-09-10 17:25:29 +05:30
end
def breadcrumb_title(title)
return if defined?(@breadcrumb_title)
@breadcrumb_title = title
end
2018-03-17 18:26:18 +05:30
def breadcrumb_list_item(link)
content_tag "li" do
link + sprite_icon("angle-right", size: 8, css_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
2017-09-10 17:25:29 +05:30
end