diff --git a/app/helpers/breadcrumbs_helper.rb b/app/helpers/breadcrumbs_helper.rb index 6eb1060ed4cdc2ffd8a14d0d63163ad266af0ac4..abe8edd6a8c5d3c0996a383032bbe6c84a54e564 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 c9f5166d0a44929929267c2f88866c3ff1314c6a..73b2ec66ee0e856e60f38672d437f479ccc00f1a 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 diff --git a/app/views/admin/applications/edit.html.haml b/app/views/admin/applications/edit.html.haml index c9ad44be1e981a81a0a33a759e8eeaaad7c49a44..1d28d1c6c56f38095eae07423588744130a5d1dd 100644 --- a/app/views/admin/applications/edit.html.haml +++ b/app/views/admin/applications/edit.html.haml @@ -1,5 +1,5 @@ - page_title "Edit", @application.name, "Applications" -- @breadcrumb_title = "Applications" +- breadcrumb_title "Applications" %h3.page-title Edit application - @url = admin_application_path(@application) diff --git a/app/views/admin/applications/new.html.haml b/app/views/admin/applications/new.html.haml index a5d89ed98570573495979b3ef98dd5c25c977f67..af0cc639670c4fa57c755da2a7ea5fea93522a8b 100644 --- a/app/views/admin/applications/new.html.haml +++ b/app/views/admin/applications/new.html.haml @@ -1,5 +1,5 @@ - page_title "New Application" -- @breadcrumb_title = "Applications" +- breadcrumb_title "Applications" %h3.page-title New application - @url = admin_applications_path diff --git a/app/views/admin/broadcast_messages/edit.html.haml b/app/views/admin/broadcast_messages/edit.html.haml index d0e4d4435dd46a5bcb2e3a33d2d4b2e9189e03b8..8cbc4597e32942d6757fd8374e85996dcac6c0f7 100644 --- a/app/views/admin/broadcast_messages/edit.html.haml +++ b/app/views/admin/broadcast_messages/edit.html.haml @@ -1,4 +1,4 @@ -- @breadcrumb_title = "Messages" +- breadcrumb_title "Messages" - page_title "Broadcast Messages" = render 'form' diff --git a/app/views/admin/broadcast_messages/index.html.haml b/app/views/admin/broadcast_messages/index.html.haml index 2e4390c361446c218c43f90d0ccfe54d7a36454a..b806882eee3a252995aa954c017442ba9ea2fc00 100644 --- a/app/views/admin/broadcast_messages/index.html.haml +++ b/app/views/admin/broadcast_messages/index.html.haml @@ -1,4 +1,4 @@ -- @breadcrumb_title = "Messages" +- breadcrumb_title "Messages" - page_title "Broadcast Messages" %h3.page-title diff --git a/app/views/admin/services/edit.html.haml b/app/views/admin/services/edit.html.haml index 0a641c3f7a6b37cf490b77a68221a0faf79f1187..30a759f99132517e7da6b61f4341c36c7100a707 100644 --- a/app/views/admin/services/edit.html.haml +++ b/app/views/admin/services/edit.html.haml @@ -1,3 +1,3 @@ -- @breadcrumb_title = "Service Templates" +- breadcrumb_title "Service Templates" - page_title @service.title, "Service Templates" = render 'form' diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index 10eb8ce6cc7fe421e240d1fda80d07ae3ffda074..e9daac95ca1beca0d64b3ae0360c6350b75e12a3 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -1,4 +1,5 @@ - @breadcrumb_link = dashboard_groups_path +- breadcrumb_title "Groups" - @hide_top_links = true - page_title 'New Group' - header_title "Groups", dashboard_groups_path diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index fcdd0a84990f3eaa83e987ca03ea8ae2d893bf38..e07f61c94e4ee3a76d0145972fc343e47a1d4506 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -1,5 +1,5 @@ - @no_container = true -- @breadcrumb_title = "Group" +- breadcrumb_title "Group" = content_for :meta_tags do = auto_discovery_link_tag(:atom, group_url(@group, rss_url_options), title: "#{@group.name} activity") diff --git a/app/views/layouts/nav/_breadcrumbs.html.haml b/app/views/layouts/nav/_breadcrumbs.html.haml index 0bdf7819547e9e7b13986df6f7e13f0bbb147286..9aed0efae1c92ea94011d16a1ad204fdda064c8d 100644 --- a/app/views/layouts/nav/_breadcrumbs.html.haml +++ b/app/views/layouts/nav/_breadcrumbs.html.haml @@ -1,4 +1,3 @@ -- breadcrumb_title = @breadcrumb_title || controller.controller_name.humanize - breadcrumb_link = breadcrumb_title_link - hide_top_links = @hide_top_links || false @@ -18,7 +17,7 @@ - if @breadcrumbs_extra_links - @breadcrumbs_extra_links.each do |extra| %li= link_to extra[:text], extra[:link] - %li= link_to breadcrumb_title, breadcrumb_link + %li= link_to @breadcrumb_title, breadcrumb_link - if content_for?(:breadcrumbs_extra) .breadcrumbs-extra.hidden-xs= yield :breadcrumbs_extra = yield :header_content diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 6d97d08ed12b4f3fc7cb2891ac42f7913b761df9..a8ae0b92334d962420dfe0adae06ddf4d38459dd 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -1,4 +1,4 @@ -- @breadcrumb_title = "Profile" +- breadcrumb_title "Profile" - @content_class = "limit-container-width" unless fluid_layout = render 'profiles/head' diff --git a/app/views/projects/blob/edit.html.haml b/app/views/projects/blob/edit.html.haml index 43fef9f134f6c2ba7223eabe0f90a06befbd7b7e..992fe7f717f5042deb535e4871c61f5c86f1052b 100644 --- a/app/views/projects/blob/edit.html.haml +++ b/app/views/projects/blob/edit.html.haml @@ -1,4 +1,4 @@ -- @breadcrumb_title = "Repository" +- breadcrumb_title "Repository" - @no_container = true - page_title "Edit", @blob.path, @ref - content_for :page_specific_javascripts do diff --git a/app/views/projects/blob/new.html.haml b/app/views/projects/blob/new.html.haml index 4433aed20239398343e65aa448ab19be04094e24..a4263774dfdf54b53babde927cb11eba5ad8e206 100644 --- a/app/views/projects/blob/new.html.haml +++ b/app/views/projects/blob/new.html.haml @@ -1,4 +1,4 @@ -- @breadcrumb_title = "Repository" +- breadcrumb_title "Repository" - page_title "New File", @path.presence, @ref - content_for :page_specific_javascripts do = page_specific_javascript_tag('lib/ace.js') diff --git a/app/views/projects/blob/show.html.haml b/app/views/projects/blob/show.html.haml index a3c6c57607c5659b1712e31f6dc97943eead5b2b..7dd834e84b5af6e3f1282448d73dfdc9e20e7ce3 100644 --- a/app/views/projects/blob/show.html.haml +++ b/app/views/projects/blob/show.html.haml @@ -1,4 +1,4 @@ -- @breadcrumb_title = "Repository" +- breadcrumb_title "Repository" - @no_container = true - page_title @blob.path, @ref diff --git a/app/views/projects/issues/new.html.haml b/app/views/projects/issues/new.html.haml index e8aae0f47e2652ebf3c1d818c98372d69a4a0149..60fe442014fa79fb224e87b93a7e09b9271ef280 100644 --- a/app/views/projects/issues/new.html.haml +++ b/app/views/projects/issues/new.html.haml @@ -1,3 +1,4 @@ +- breadcrumb_title "Issues" - page_title "New Issue" %h3.page-title diff --git a/app/views/projects/merge_requests/creations/new.html.haml b/app/views/projects/merge_requests/creations/new.html.haml index 59a88c68009ddb32c1564012943b784799b28d12..3220512d60d9020f3b01f5fb0e19f9ac5de8fdf4 100644 --- a/app/views/projects/merge_requests/creations/new.html.haml +++ b/app/views/projects/merge_requests/creations/new.html.haml @@ -1,4 +1,4 @@ -- @breadcrumb_title = "Merge Requests" +- breadcrumb_title "Merge Requests" - page_title "New Merge Request" - if @merge_request.can_be_created && !params[:change_branches] diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 8faa49d8224c1d9de759223cc63aef4463120a06..a2d7a21d5f6a9a8f0c622cfe0a249c02b8604d75 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -1,4 +1,5 @@ - @breadcrumb_link = dashboard_projects_path +- breadcrumb_title "Projects" - @hide_top_links = true - page_title 'New Project' - header_title "Projects", dashboard_projects_path diff --git a/app/views/projects/pipeline_schedules/index.html.haml b/app/views/projects/pipeline_schedules/index.html.haml index 89042ef4a03232f6d6fea9cbace879d25da747b0..8426b29bb14b709c4bfeab1a6010e8782fe4888a 100644 --- a/app/views/projects/pipeline_schedules/index.html.haml +++ b/app/views/projects/pipeline_schedules/index.html.haml @@ -1,4 +1,4 @@ -- @breadcrumb_title = "Schedules" +- breadcrumb_title "Schedules" - content_for :page_specific_javascripts do = webpack_bundle_tag 'common_vue' diff --git a/app/views/projects/pipeline_schedules/new.html.haml b/app/views/projects/pipeline_schedules/new.html.haml index 115c43a0aecdc02d305a48d902d1fe50409cb374..c7237cb96d8674f1096c4b077feb611841024168 100644 --- a/app/views/projects/pipeline_schedules/new.html.haml +++ b/app/views/projects/pipeline_schedules/new.html.haml @@ -1,4 +1,4 @@ -- @breadcrumb_title = "Schedules" +- breadcrumb_title "Schedules" - @breadcrumb_link = namespace_project_pipeline_schedules_path(@project.namespace, @project) - page_title _("New Pipeline Schedule") diff --git a/app/views/projects/services/edit.html.haml b/app/views/projects/services/edit.html.haml index 3d1d62b886a568421579b2a1897a0557b9c24abf..8056217bb1eb227bc079778504e2694dc24a9a3c 100644 --- a/app/views/projects/services/edit.html.haml +++ b/app/views/projects/services/edit.html.haml @@ -1,4 +1,4 @@ -- @breadcrumb_title = "Integrations" +- breadcrumb_title "Integrations" - page_title @service.title, "Services" - if show_new_nav? diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index c366fb334fe04bf54666155ca929240322d1f5cc..49d0a6828fe9d20068fdd78364c1a5abb48b753d 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -1,5 +1,5 @@ - @no_container = true -- @breadcrumb_title = "Project" +- breadcrumb_title "Project" - @content_class = "limit-container-width" unless fluid_layout - flash_message_container = show_new_nav? ? :new_global_flash : :flash_message diff --git a/app/views/projects/tree/show.html.haml b/app/views/projects/tree/show.html.haml index 2de6d50da3abdfcb29347f2360e557ea1b473c14..c8587245f882dfc1d9c830fabc6ce9237d6c7c4e 100644 --- a/app/views/projects/tree/show.html.haml +++ b/app/views/projects/tree/show.html.haml @@ -1,5 +1,5 @@ - @no_container = true -- @breadcrumb_title = _("Repository") +- breadcrumb_title _("Repository") - @content_class = "limit-container-width" unless fluid_layout - page_title @path.presence || _("Files"), @ref diff --git a/app/views/projects/wikis/show.html.haml b/app/views/projects/wikis/show.html.haml index 42602c6366ba91882c559ac1d5be9156881be299..9dadd685ea2f29c1aaffacedb0f5420f95a5a5bd 100644 --- a/app/views/projects/wikis/show.html.haml +++ b/app/views/projects/wikis/show.html.haml @@ -1,5 +1,5 @@ - @content_class = "limit-container-width limit-container-width-sm" unless fluid_layout -- @breadcrumb_title = "Wiki" +- breadcrumb_title "Wiki" - page_title @page.title.capitalize, "Wiki" .wiki-page-header.has-sidebar-toggle diff --git a/app/views/snippets/new.html.haml b/app/views/snippets/new.html.haml index 513e26e1d8184a180208d7d6a0751d37c9c17b94..f01915107e3995b19f1ac54958d42910d1620cdf 100644 --- a/app/views/snippets/new.html.haml +++ b/app/views/snippets/new.html.haml @@ -1,4 +1,5 @@ - @hide_top_links = true +- breadcrumb_title "Snippets" - page_title "New Snippet" %h3.page-title New Snippet