diff options
author | Phil Hughes <me@iamphill.com> | 2017-07-06 17:24:03 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-07-06 17:24:03 +0100 |
commit | c85df8105e3b8982ecf6a16f8ae9f3af2f130030 (patch) | |
tree | 099acdacb9e622db8780c520faff649e2a6cf27d /app/helpers/breadcrumbs_helper.rb | |
parent | 6d3a9cc98e1503b0ef49906833aab094a8e6b686 (diff) | |
download | gitlab-ce-c85df8105e3b8982ecf6a16f8ae9f3af2f130030.tar.gz |
improvements to breadcrumb titles, links & nesting
Diffstat (limited to 'app/helpers/breadcrumbs_helper.rb')
-rw-r--r-- | app/helpers/breadcrumbs_helper.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/helpers/breadcrumbs_helper.rb b/app/helpers/breadcrumbs_helper.rb new file mode 100644 index 00000000000..eb8df3bc1ea --- /dev/null +++ b/app/helpers/breadcrumbs_helper.rb @@ -0,0 +1,19 @@ +module BreadcrumbsHelper + def breadcrumbs_extra_links(text, link) + @breadcrumbs_extra_links ||= [] + @breadcrumbs_extra_links.push({ + text: text, + link: link + }) + end + + def breadcrumb_title_link + return @breadcrumb_link if @breadcrumb_link + + if controller.available_action?(:index) + url_for(action: "index") + else + request.path + end + end +end |