diff options
author | Phil Hughes <me@iamphill.com> | 2017-07-12 09:16:32 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-07-12 09:16:32 +0100 |
commit | 13cc761a09a88138294300cdcc26a6db28f3d67d (patch) | |
tree | 74863ef18cb1bd39f09306190294619c5ec301b7 /app/helpers | |
parent | 9fcc28d42850eb7aa891b701721f803ebb0a3d55 (diff) | |
download | gitlab-ce-13cc761a09a88138294300cdcc26a6db28f3d67d.tar.gz |
moved `@breadcrumb_title` out of the HAML & into a helper method
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/breadcrumbs_helper.rb | 6 | ||||
-rw-r--r-- | app/helpers/page_layout_helper.rb | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/app/helpers/breadcrumbs_helper.rb b/app/helpers/breadcrumbs_helper.rb index 6eb1060ed4c..abe8edd6a8c 100644 --- a/app/helpers/breadcrumbs_helper.rb +++ b/app/helpers/breadcrumbs_helper.rb @@ -16,4 +16,10 @@ module BreadcrumbsHelper request.path end end + + def breadcrumb_title(title) + return if defined?(@breadcrumb_title) + + @breadcrumb_title = title + end end diff --git a/app/helpers/page_layout_helper.rb b/app/helpers/page_layout_helper.rb index c9f5166d0a4..73b2ec66ee0 100644 --- a/app/helpers/page_layout_helper.rb +++ b/app/helpers/page_layout_helper.rb @@ -5,7 +5,7 @@ module PageLayoutHelper @page_title.push(*titles.compact) if titles.any? if show_new_nav? && titles.any? && !defined?(@breadcrumb_title) - @breadcrumb_title = @page_title.first + @breadcrumb_title = @page_title[-1] end # Segments are seperated by middot |