Commit 13cc761a authored by Phil Hughes's avatar Phil Hughes

moved `@breadcrumb_title` out of the HAML & into a helper method

parent 9fcc28d4
...@@ -16,4 +16,10 @@ module BreadcrumbsHelper ...@@ -16,4 +16,10 @@ module BreadcrumbsHelper
request.path request.path
end end
end end
def breadcrumb_title(title)
return if defined?(@breadcrumb_title)
@breadcrumb_title = title
end
end end
...@@ -5,7 +5,7 @@ module PageLayoutHelper ...@@ -5,7 +5,7 @@ module PageLayoutHelper
@page_title.push(*titles.compact) if titles.any? @page_title.push(*titles.compact) if titles.any?
if show_new_nav? && titles.any? && !defined?(@breadcrumb_title) if show_new_nav? && titles.any? && !defined?(@breadcrumb_title)
@breadcrumb_title = @page_title.first @breadcrumb_title = @page_title[-1]
end end
# Segments are seperated by middot # Segments are seperated by middot
......
- page_title "Edit", @application.name, "Applications" - page_title "Edit", @application.name, "Applications"
- @breadcrumb_title = "Applications" - breadcrumb_title "Applications"
%h3.page-title Edit application %h3.page-title Edit application
- @url = admin_application_path(@application) - @url = admin_application_path(@application)
......
- page_title "New Application" - page_title "New Application"
- @breadcrumb_title = "Applications" - breadcrumb_title "Applications"
%h3.page-title New application %h3.page-title New application
- @url = admin_applications_path - @url = admin_applications_path
......
- @breadcrumb_title = "Messages" - breadcrumb_title "Messages"
- page_title "Broadcast Messages" - page_title "Broadcast Messages"
= render 'form' = render 'form'
- @breadcrumb_title = "Messages" - breadcrumb_title "Messages"
- page_title "Broadcast Messages" - page_title "Broadcast Messages"
%h3.page-title %h3.page-title
......
- @breadcrumb_title = "Service Templates" - breadcrumb_title "Service Templates"
- page_title @service.title, "Service Templates" - page_title @service.title, "Service Templates"
= render 'form' = render 'form'
- @breadcrumb_link = dashboard_groups_path - @breadcrumb_link = dashboard_groups_path
- breadcrumb_title "Groups"
- @hide_top_links = true - @hide_top_links = true
- page_title 'New Group' - page_title 'New Group'
- header_title "Groups", dashboard_groups_path - header_title "Groups", dashboard_groups_path
......
- @no_container = true - @no_container = true
- @breadcrumb_title = "Group" - breadcrumb_title "Group"
= content_for :meta_tags do = content_for :meta_tags do
= auto_discovery_link_tag(:atom, group_url(@group, rss_url_options), title: "#{@group.name} activity") = auto_discovery_link_tag(:atom, group_url(@group, rss_url_options), title: "#{@group.name} activity")
......
- breadcrumb_title = @breadcrumb_title || controller.controller_name.humanize
- breadcrumb_link = breadcrumb_title_link - breadcrumb_link = breadcrumb_title_link
- hide_top_links = @hide_top_links || false - hide_top_links = @hide_top_links || false
...@@ -18,7 +17,7 @@ ...@@ -18,7 +17,7 @@
- if @breadcrumbs_extra_links - if @breadcrumbs_extra_links
- @breadcrumbs_extra_links.each do |extra| - @breadcrumbs_extra_links.each do |extra|
%li= link_to extra[:text], extra[:link] %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) - if content_for?(:breadcrumbs_extra)
.breadcrumbs-extra.hidden-xs= yield :breadcrumbs_extra .breadcrumbs-extra.hidden-xs= yield :breadcrumbs_extra
= yield :header_content = yield :header_content
- @breadcrumb_title = "Profile" - breadcrumb_title "Profile"
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
= render 'profiles/head' = render 'profiles/head'
......
- @breadcrumb_title = "Repository" - breadcrumb_title "Repository"
- @no_container = true - @no_container = true
- page_title "Edit", @blob.path, @ref - page_title "Edit", @blob.path, @ref
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
......
- @breadcrumb_title = "Repository" - breadcrumb_title "Repository"
- page_title "New File", @path.presence, @ref - page_title "New File", @path.presence, @ref
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= page_specific_javascript_tag('lib/ace.js') = page_specific_javascript_tag('lib/ace.js')
......
- @breadcrumb_title = "Repository" - breadcrumb_title "Repository"
- @no_container = true - @no_container = true
- page_title @blob.path, @ref - page_title @blob.path, @ref
......
- breadcrumb_title "Issues"
- page_title "New Issue" - page_title "New Issue"
%h3.page-title %h3.page-title
......
- @breadcrumb_title = "Merge Requests" - breadcrumb_title "Merge Requests"
- page_title "New Merge Request" - page_title "New Merge Request"
- if @merge_request.can_be_created && !params[:change_branches] - if @merge_request.can_be_created && !params[:change_branches]
......
- @breadcrumb_link = dashboard_projects_path - @breadcrumb_link = dashboard_projects_path
- breadcrumb_title "Projects"
- @hide_top_links = true - @hide_top_links = true
- page_title 'New Project' - page_title 'New Project'
- header_title "Projects", dashboard_projects_path - header_title "Projects", dashboard_projects_path
......
- @breadcrumb_title = "Schedules" - breadcrumb_title "Schedules"
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'common_vue'
......
- @breadcrumb_title = "Schedules" - breadcrumb_title "Schedules"
- @breadcrumb_link = namespace_project_pipeline_schedules_path(@project.namespace, @project) - @breadcrumb_link = namespace_project_pipeline_schedules_path(@project.namespace, @project)
- page_title _("New Pipeline Schedule") - page_title _("New Pipeline Schedule")
......
- @breadcrumb_title = "Integrations" - breadcrumb_title "Integrations"
- page_title @service.title, "Services" - page_title @service.title, "Services"
- if show_new_nav? - if show_new_nav?
......
- @no_container = true - @no_container = true
- @breadcrumb_title = "Project" - breadcrumb_title "Project"
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
- flash_message_container = show_new_nav? ? :new_global_flash : :flash_message - flash_message_container = show_new_nav? ? :new_global_flash : :flash_message
......
- @no_container = true - @no_container = true
- @breadcrumb_title = _("Repository") - breadcrumb_title _("Repository")
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
- page_title @path.presence || _("Files"), @ref - page_title @path.presence || _("Files"), @ref
......
- @content_class = "limit-container-width limit-container-width-sm" unless fluid_layout - @content_class = "limit-container-width limit-container-width-sm" unless fluid_layout
- @breadcrumb_title = "Wiki" - breadcrumb_title "Wiki"
- page_title @page.title.capitalize, "Wiki" - page_title @page.title.capitalize, "Wiki"
.wiki-page-header.has-sidebar-toggle .wiki-page-header.has-sidebar-toggle
......
- @hide_top_links = true - @hide_top_links = true
- breadcrumb_title "Snippets"
- page_title "New Snippet" - page_title "New Snippet"
%h3.page-title %h3.page-title
New Snippet New Snippet
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment