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
request.path
end
end
def breadcrumb_title(title)
return if defined?(@breadcrumb_title)
@breadcrumb_title = title
end
end
......@@ -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
......
- page_title "Edit", @application.name, "Applications"
- @breadcrumb_title = "Applications"
- breadcrumb_title "Applications"
%h3.page-title Edit application
- @url = admin_application_path(@application)
......
- page_title "New Application"
- @breadcrumb_title = "Applications"
- breadcrumb_title "Applications"
%h3.page-title New application
- @url = admin_applications_path
......
- @breadcrumb_title = "Messages"
- breadcrumb_title "Messages"
- page_title "Broadcast Messages"
= render 'form'
- @breadcrumb_title = "Messages"
- breadcrumb_title "Messages"
- page_title "Broadcast Messages"
%h3.page-title
......
- @breadcrumb_title = "Service Templates"
- breadcrumb_title "Service Templates"
- page_title @service.title, "Service Templates"
= render 'form'
- @breadcrumb_link = dashboard_groups_path
- breadcrumb_title "Groups"
- @hide_top_links = true
- page_title 'New Group'
- header_title "Groups", dashboard_groups_path
......
- @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")
......
- 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
- @breadcrumb_title = "Profile"
- breadcrumb_title "Profile"
- @content_class = "limit-container-width" unless fluid_layout
= render 'profiles/head'
......
- @breadcrumb_title = "Repository"
- breadcrumb_title "Repository"
- @no_container = true
- page_title "Edit", @blob.path, @ref
- content_for :page_specific_javascripts do
......
- @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')
......
- @breadcrumb_title = "Repository"
- breadcrumb_title "Repository"
- @no_container = true
- page_title @blob.path, @ref
......
- breadcrumb_title "Issues"
- page_title "New Issue"
%h3.page-title
......
- @breadcrumb_title = "Merge Requests"
- breadcrumb_title "Merge Requests"
- page_title "New Merge Request"
- if @merge_request.can_be_created && !params[:change_branches]
......
- @breadcrumb_link = dashboard_projects_path
- breadcrumb_title "Projects"
- @hide_top_links = true
- page_title 'New Project'
- header_title "Projects", dashboard_projects_path
......
- @breadcrumb_title = "Schedules"
- breadcrumb_title "Schedules"
- content_for :page_specific_javascripts do
= webpack_bundle_tag 'common_vue'
......
- @breadcrumb_title = "Schedules"
- breadcrumb_title "Schedules"
- @breadcrumb_link = namespace_project_pipeline_schedules_path(@project.namespace, @project)
- page_title _("New Pipeline Schedule")
......
- @breadcrumb_title = "Integrations"
- breadcrumb_title "Integrations"
- page_title @service.title, "Services"
- if show_new_nav?
......
- @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
......
- @no_container = true
- @breadcrumb_title = _("Repository")
- breadcrumb_title _("Repository")
- @content_class = "limit-container-width" unless fluid_layout
- page_title @path.presence || _("Files"), @ref
......
- @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
......
- @hide_top_links = true
- breadcrumb_title "Snippets"
- page_title "New Snippet"
%h3.page-title
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