moved `@breadcrumb_title` out of the HAML & into a helper method
This commit is contained in:
parent
9fcc28d428
commit
13cc761a09
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- page_title "New Application"
|
||||
- @breadcrumb_title = "Applications"
|
||||
- breadcrumb_title "Applications"
|
||||
|
||||
%h3.page-title New application
|
||||
- @url = admin_applications_path
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- @breadcrumb_title = "Messages"
|
||||
- breadcrumb_title "Messages"
|
||||
- page_title "Broadcast Messages"
|
||||
|
||||
= render 'form'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- @breadcrumb_title = "Messages"
|
||||
- breadcrumb_title "Messages"
|
||||
- page_title "Broadcast Messages"
|
||||
|
||||
%h3.page-title
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
- @breadcrumb_title = "Service Templates"
|
||||
- breadcrumb_title "Service Templates"
|
||||
- page_title @service.title, "Service Templates"
|
||||
= render 'form'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- @breadcrumb_title = "Profile"
|
||||
- breadcrumb_title "Profile"
|
||||
- @content_class = "limit-container-width" unless fluid_layout
|
||||
= render 'profiles/head'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- @breadcrumb_title = "Repository"
|
||||
- breadcrumb_title "Repository"
|
||||
- @no_container = true
|
||||
|
||||
- page_title @blob.path, @ref
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- breadcrumb_title "Issues"
|
||||
- page_title "New Issue"
|
||||
|
||||
%h3.page-title
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- @breadcrumb_title = "Schedules"
|
||||
- breadcrumb_title "Schedules"
|
||||
|
||||
- content_for :page_specific_javascripts do
|
||||
= webpack_bundle_tag 'common_vue'
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- @breadcrumb_title = "Integrations"
|
||||
- breadcrumb_title "Integrations"
|
||||
- page_title @service.title, "Services"
|
||||
|
||||
- if show_new_nav?
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
- @hide_top_links = true
|
||||
- breadcrumb_title "Snippets"
|
||||
- page_title "New Snippet"
|
||||
%h3.page-title
|
||||
New Snippet
|
||||
|
|
Loading…
Reference in New Issue