Commit c85df810 authored by Phil Hughes's avatar Phil Hughes

improvements to breadcrumb titles, links & nesting

parent 6d3a9cc9
...@@ -5,6 +5,8 @@ export default class GroupName { ...@@ -5,6 +5,8 @@ export default class GroupName {
constructor() { constructor() {
this.titleContainer = document.querySelector('.js-title-container'); this.titleContainer = document.querySelector('.js-title-container');
this.title = this.titleContainer.querySelector('.title'); this.title = this.titleContainer.querySelector('.title');
if (this.title) {
this.titleWidth = this.title.offsetWidth; this.titleWidth = this.title.offsetWidth;
this.groupTitle = this.titleContainer.querySelector('.group-title'); this.groupTitle = this.titleContainer.querySelector('.group-title');
this.groups = this.titleContainer.querySelectorAll('.group-path'); this.groups = this.titleContainer.querySelectorAll('.group-path');
...@@ -12,6 +14,7 @@ export default class GroupName { ...@@ -12,6 +14,7 @@ export default class GroupName {
this.isHidden = false; this.isHidden = false;
this.init(); this.init();
} }
}
init() { init() {
if (this.groups.length > 0) { if (this.groups.length > 0) {
......
module BreadcrumbsHelper
def breadcrumbs_extra_links(text, link)
@breadcrumbs_extra_links ||= []
@breadcrumbs_extra_links.push({
text: text,
link: link
})
end
def breadcrumb_title_link
return @breadcrumb_link if @breadcrumb_link
if controller.available_action?(:index)
url_for(action: "index")
else
request.path
end
end
end
- @breadcrumb_title = "Appearance"
- page_title "Appearance" - page_title "Appearance"
%h3.page-title %h3.page-title
......
- @breadcrumb_title = "Settings"
- page_title "Settings" - page_title "Settings"
%h3.page-title Settings %h3.page-title Settings
......
- @breadcrumb_title = "Messages"
- page_title "Broadcast Messages" - page_title "Broadcast Messages"
= render 'form' = render 'form'
- @breadcrumb_title = "Messages"
- page_title "Broadcast Messages" - page_title "Broadcast Messages"
%h3.page-title %h3.page-title
......
- @breadcrumb_title = "System Hooks"
- page_title 'System Hooks' - page_title 'System Hooks'
%h3.page-title %h3.page-title
System hooks System hooks
......
- @breadcrumb_title = "Services Templates"
- page_title "Service Templates" - page_title "Service Templates"
%h3.page-title Service templates %h3.page-title Service templates
%p.light Service template allows you to set default values for project services %p.light Service template allows you to set default values for project services
......
- @breadcrumb_title = "Activity"
- @hide_top_links = true - @hide_top_links = true
- @no_container = true - @no_container = true
......
- @hide_top_links = true
- page_title "Issues" - page_title "Issues"
- header_title "Issues", issues_dashboard_path(assignee_id: current_user.id) - header_title "Issues", issues_dashboard_path(assignee_id: current_user.id)
= content_for :meta_tags do = content_for :meta_tags do
......
- @hide_top_links = true
- page_title "Merge Requests" - page_title "Merge Requests"
- header_title "Merge Requests", merge_requests_dashboard_path(assignee_id: current_user.id) - header_title "Merge Requests", merge_requests_dashboard_path(assignee_id: current_user.id)
......
- @hide_top_links = true
- @no_container = true - @no_container = true
- page_title "Starred Projects" - page_title "Starred Projects"
......
- @hide_top_links = true
- page_title "Todos" - page_title "Todos"
- header_title "Todos", dashboard_todos_path - header_title "Todos", dashboard_todos_path
......
- @hide_top_links = true
- page_title "Groups" - page_title "Groups"
- header_title "Groups", dashboard_groups_path - header_title "Groups", dashboard_groups_path
......
- @hide_top_links = true
- page_title "Projects" - page_title "Projects"
- header_title "Projects", dashboard_projects_path - header_title "Projects", dashboard_projects_path
......
- @hide_top_links = true
- page_title "Projects" - page_title "Projects"
- header_title "Projects", dashboard_projects_path - header_title "Projects", dashboard_projects_path
......
- @hide_top_links = true
- page_title "Projects" - page_title "Projects"
- header_title "Projects", dashboard_projects_path - header_title "Projects", dashboard_projects_path
......
- @breadcrumb_title = "Settings"
= render "groups/settings_head" = render "groups/settings_head"
.panel.panel-default.prepend-top-default .panel.panel-default.prepend-top-default
.panel-heading .panel-heading
......
- @breadcrumb_title = "Members"
- page_title "Members" - page_title "Members"
.project-members-page.prepend-top-default .project-members-page.prepend-top-default
......
- @breadcrumb_title = "Issues"
- page_title "Issues" - page_title "Issues"
- group_issues_exists = group_issues(@group).exists? - group_issues_exists = group_issues(@group).exists?
= render "head_issues" = render "head_issues"
......
- @breadcrumb_title = "Merge Requests"
- page_title "Merge Requests" - page_title "Merge Requests"
- if show_new_nav? && current_user - if show_new_nav? && current_user
......
- @hide_top_links = true
- page_title 'New Group' - page_title 'New Group'
- header_title "Groups", dashboard_groups_path - header_title "Groups", dashboard_groups_path
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/flash" = render "layouts/flash"
= yield :flash_message = yield :flash_message
- if show_new_nav? - if show_new_nav? && !@hide_breadcrumbs
= render "layouts/nav/breadcrumbs" = render "layouts/nav/breadcrumbs"
%div{ class: "#{(container_class unless @no_container)} #{@content_class}" } %div{ class: "#{(container_class unless @no_container)} #{@content_class}" }
.content{ id: "content-body" } .content{ id: "content-body" }
......
- breadcrumb_title = @breadcrumb_title || controller.controller_name.humanize - breadcrumb_title = @breadcrumb_title || controller.controller_name.humanize
- breadcrumb_link = breadcrumb_title_link
- hide_top_links = @hide_top_links || false - hide_top_links = @hide_top_links || false
%nav.breadcrumbs{ role: "navigation" } %nav.breadcrumbs{ role: "navigation" }
...@@ -8,12 +9,16 @@ ...@@ -8,12 +9,16 @@
.title .title
= link_to "GitLab", root_path = link_to "GitLab", root_path
\/ \/
- if content_for?(:header_title_before)
= yield :header_title_before
\/
= header_title = header_title
%h2.breadcrumbs-sub-title %h2.breadcrumbs-sub-title
%ul.list-unstyled %ul.list-unstyled
- if content_for?(:sub_title_before) - if @breadcrumbs_extra_links
= yield :sub_title_before - @breadcrumbs_extra_links.each do |extra|
%li= link_to breadcrumb_title, request.path %li= link_to extra[:text], extra[: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 = "Authentication log"
- page_title "Authentication log" - page_title "Authentication log"
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
= render 'profiles/head' = render 'profiles/head'
......
- @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'
......
- page_title 'Two-Factor Authentication', 'Account' - page_title 'Two-Factor Authentication', 'Account'
- header_title "Two-Factor Authentication", profile_two_factor_auth_path - header_title "Two-Factor Authentication", profile_two_factor_auth_path
- @breadcrumb_title = "Two-Factor Authentication"
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
- if show_new_nav?
- content_for :header_title_before do
= link_to "User Settings", profile_path
= render 'profiles/head' = render 'profiles/head'
- if inject_u2f_api? - if inject_u2f_api?
......
- @no_container = true - @no_container = true
- @breadcrumb_title = "Activity" - @breadcrumb_title = "Activity"
- if show_new_nav?
- breadcrumbs_extra_links("Project", project_path(@project))
- page_title "Activity" - page_title "Activity"
= render "projects/head" = render "projects/head"
......
- @no_container = true - @no_container = true
- @content_class = "issue-boards-content" - @content_class = "issue-boards-content"
- @breadcrumb_title = "Board"
- page_title "Boards" - page_title "Boards"
- if show_new_nav? - if show_new_nav?
- content_for :sub_title_before do - breadcrumbs_extra_links("Issues", namespace_project_issues_path(@project.namespace, @project))
%li= link_to "Issues", namespace_project_issues_path(@project.namespace, @project)
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'common_vue'
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
- page_title "Branches" - page_title "Branches"
= render "projects/commits/head" = render "projects/commits/head"
- if show_new_nav?
- breadcrumbs_extra_links("Repository", project_files_path(@project))
%div{ class: container_class } %div{ class: container_class }
.top-area.adjust .top-area.adjust
.nav-text .nav-text
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
= content_for :meta_tags do = content_for :meta_tags do
= auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, rss_url_options), title: "#{@project.name}:#{@ref} commits") = auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, rss_url_options), title: "#{@project.name}:#{@ref} commits")
- if show_new_nav?
- breadcrumbs_extra_links("Repository", project_files_path(@project))
= content_for :sub_nav do = content_for :sub_nav do
= render "head" = render "head"
......
- @no_container = true - @no_container = true
- page_title "Compare" - page_title "Compare"
- if show_new_nav?
- breadcrumbs_extra_links("Repository", project_files_path(@project))
= render "projects/commits/head" = render "projects/commits/head"
%div{ class: container_class } %div{ class: container_class }
......
- @no_container = true - @no_container = true
- page_title "#{params[:from]}...#{params[:to]}" - page_title "#{params[:from]}...#{params[:to]}"
- if show_new_nav?
- breadcrumbs_extra_links("Repository", project_files_path(@project))
= render "projects/commits/head" = render "projects/commits/head"
%div{ class: container_class } %div{ class: container_class }
......
- @no_container = true - @no_container = true
- page_title "Cycle Analytics" - page_title "Cycle Analytics"
- if show_new_nav?
- breadcrumbs_extra_links("Project", project_path(@project))
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('common_vue') = page_specific_javascript_bundle_tag('common_vue')
= page_specific_javascript_bundle_tag('cycle_analytics') = page_specific_javascript_bundle_tag('cycle_analytics')
......
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
- @breadcrumb_title = "Settings"
= render "projects/settings/head" = render "projects/settings/head"
.project-edit-container .project-edit-container
......
- @no_container = true - @no_container = true
- @breadcrumb_title = "Charts" - @breadcrumb_title = "Charts"
- page_title "Charts" - page_title "Charts"
- if show_new_nav?
- breadcrumbs_extra_links("Repository", project_files_path(@project))
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('common_d3') = page_specific_javascript_bundle_tag('common_d3')
= page_specific_javascript_bundle_tag('graphs') = page_specific_javascript_bundle_tag('graphs')
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('common_d3') = page_specific_javascript_bundle_tag('common_d3')
= page_specific_javascript_bundle_tag('graphs') = page_specific_javascript_bundle_tag('graphs')
- if show_new_nav?
- breadcrumbs_extra_links("Repository", project_files_path(@project))
= render 'projects/commits/head' = render 'projects/commits/head'
%div{ class: container_class } %div{ class: container_class }
......
- @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]
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
- page_title "Graph", @ref - page_title "Graph", @ref
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('network') = page_specific_javascript_bundle_tag('network')
- if show_new_nav?
- breadcrumbs_extra_links("Repository", project_files_path(@project))
= render "projects/commits/head" = render "projects/commits/head"
= render "head" = render "head"
%div{ class: container_class } %div{ class: container_class }
......
- @hide_top_links = true
- page_title 'New Project' - page_title 'New Project'
- header_title "Projects", dashboard_projects_path - header_title "Projects", dashboard_projects_path
- visibility_level = params.dig(:project, :visibility_level) || default_project_visibility - visibility_level = params.dig(:project, :visibility_level) || default_project_visibility
......
- @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'
= webpack_bundle_tag 'schedules_index' = webpack_bundle_tag 'schedules_index'
...@@ -9,6 +11,8 @@ ...@@ -9,6 +11,8 @@
- content_for :breadcrumbs_extra do - content_for :breadcrumbs_extra do
= link_to _('New schedule'), new_namespace_project_pipeline_schedule_path(@project.namespace, @project), class: 'btn btn-create' = link_to _('New schedule'), new_namespace_project_pipeline_schedule_path(@project.namespace, @project), class: 'btn btn-create'
- breadcrumbs_extra_links("Pipelines", project_pipelines_path(@project))
= render "projects/pipelines/head" = render "projects/pipelines/head"
%div{ class: container_class } %div{ class: container_class }
......
- @breadcrumb_title = "Schedules"
- @breadcrumb_link = namespace_project_pipeline_schedules_path(@project.namespace, @project)
- page_title _("New Pipeline Schedule") - page_title _("New Pipeline Schedule")
- if show_new_nav?
- breadcrumbs_extra_links("Pipelines", project_pipelines_path(@project))
%h3.page-title %h3.page-title
= _("Schedule a new pipeline") = _("Schedule a new pipeline")
%hr %hr
......
- @no_container = true - @no_container = true
- @breadcrumb_title = "Charts"
- page_title "Charts", "Pipelines" - page_title "Charts", "Pipelines"
- if show_new_nav?
- breadcrumbs_extra_links("Pipelines", project_pipelines_path(@project))
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('common_d3') = page_specific_javascript_bundle_tag('common_d3')
= page_specific_javascript_bundle_tag('graphs') = page_specific_javascript_bundle_tag('graphs')
......
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
- @breadcrumb_title = "Pipelines"
- page_title "Pipelines" - page_title "Pipelines"
- if show_new_nav?
- breadcrumbs_extra_links("Settings", edit_project_path(@project))
= render "projects/settings/head" = render "projects/settings/head"
= render 'projects/runners/index' = render 'projects/runners/index'
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
- page_title "Tags" - page_title "Tags"
= render "projects/commits/head" = render "projects/commits/head"
- if show_new_nav?
- breadcrumbs_extra_links("Repository", project_files_path(@project))
.flex-list{ class: container_class } .flex-list{ class: container_class }
.top-area.adjust .top-area.adjust
.nav-text.row-main-content .nav-text.row-main-content
......
- @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"
- 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
- page_title @search_term - page_title @search_term
.prepend-top-default .prepend-top-default
......
- @hide_top_links = true
- @hide_breadcrumbs = true
- page_title @user.name - page_title @user.name
- page_description @user.bio - page_description @user.bio
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
......
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