diff --git a/app/assets/javascripts/breadcrumb.js b/app/assets/javascripts/breadcrumb.js index 7dfdf844325c3f5782f6482e8ccaf04624e6632a..97340953c77a88ef7621342446b34f61e785f221 100644 --- a/app/assets/javascripts/breadcrumb.js +++ b/app/assets/javascripts/breadcrumb.js @@ -14,7 +14,8 @@ export default () => { topLevelLinks.forEach(el => addTooltipToEl(el)); $expander.closest('.dropdown') - .on('show.bs.dropdown hide.bs.dropdown', () => { - $expander.toggleClass('open'); + .on('show.bs.dropdown hide.bs.dropdown', (e) => { + $('.js-breadcrumbs-collapsed-expander', e.currentTarget).toggleClass('open') + .tooltip('hide'); }); }; diff --git a/app/assets/stylesheets/new_nav.scss b/app/assets/stylesheets/new_nav.scss index b1d1ea1ba5fbdcaf3ba11c92675eb7c1b22a148f..8beaf64e7a1f0892a08e6ab1853db1cbe4b4ada6 100644 --- a/app/assets/stylesheets/new_nav.scss +++ b/app/assets/stylesheets/new_nav.scss @@ -330,6 +330,7 @@ header.navbar-gitlab-new { .breadcrumbs-list { display: flex; + flex-wrap: wrap; margin-bottom: 0; > li { @@ -338,11 +339,7 @@ header.navbar-gitlab-new { position: relative; &:not(:last-child) { - margin-right: 10px; - } - - &:not(:first-child) { - margin-left: 10px; + margin-right: 20px; } > a { diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index 51acd557ea7d00b66d48bfb016a7adbd37d8bbce..7f43e4106fc932b5072d6bf0a649b167b2c52a2d 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -22,7 +22,7 @@ module GroupsHelper full_title += if show_new_nav? breadcrumb_list_item group_title_link(parent, hidable: false) else - group_title_link(parent, hidable: true) + "#{group_title_link(parent, hidable: true)} / ".html_safe end end end diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 197c90c4081caa94ba20c37b7a37356b1bc5f5c2..eba8aed05d3afa682ba91775143858a335eb89c9 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -126,12 +126,21 @@ module IssuablesHelper end def issuable_meta(issuable, project, text) - output = content_tag(:strong, class: "identifier") do - concat("#{text} ") - concat(to_url_reference(issuable)) + output = "" + + unless show_new_nav? + output << content_tag(:strong, class: "identifier") do + concat("#{text} ") + concat(to_url_reference(issuable)) + end end - output << " opened #{time_ago_with_tooltip(issuable.created_at)} by ".html_safe + opened_text = if show_new_nav? + "Opened" + else + " opened" + end + output << "#{opened_text} #{time_ago_with_tooltip(issuable.created_at)} by ".html_safe output << content_tag(:strong) do author_output = link_to_member(project, issuable.author, size: 24, mobile_classes: "hidden-xs", tooltip: true) author_output << link_to_member(project, issuable.author, size: 24, by_username: true, avatar: false, mobile_classes: "hidden-sm hidden-md hidden-lg") @@ -141,7 +150,7 @@ module IssuablesHelper output << content_tag(:span, (issuable.task_status if issuable.tasks?), id: "task_status", class: "hidden-xs hidden-sm") output << content_tag(:span, (issuable.task_status_short if issuable.tasks?), id: "task_status_short", class: "hidden-md hidden-lg") - output + output.html_safe end def issuable_todo(issuable) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index cd62835fd290905ce883847b24381faf7a0b645b..867f3fadfb9daea2dcd45246e43d88101876451e 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -81,7 +81,7 @@ module ProjectsHelper end end - "#{namespace_link} #{project_link}".html_safe + "#{namespace_link} #{('/' unless show_new_nav?)} #{project_link}".html_safe end def remove_project_message(project) diff --git a/app/views/layouts/nav/_breadcrumbs.html.haml b/app/views/layouts/nav/_breadcrumbs.html.haml index 240aee19a9e654774a2285036b60d0e3f3a0fd75..9f0cb2fad3acba0c42659e9a599e4eab62042585 100644 --- a/app/views/layouts/nav/_breadcrumbs.html.haml +++ b/app/views/layouts/nav/_breadcrumbs.html.haml @@ -1,8 +1,7 @@ -- breadcrumb_link = breadcrumb_title_link - hide_top_links = @hide_top_links || false -%nav.breadcrumbs{ role: "navigation" } - .breadcrumbs-container{ class: [container_class, @content_class] } +%nav.breadcrumbs{ role: "navigation", class: [container_class, @content_class] } + .breadcrumbs-container - if defined?(@new_sidebar) = button_tag class: 'toggle-mobile-nav', type: 'button' do %span.sr-only Open sidebar diff --git a/app/views/projects/commit/show.html.haml b/app/views/projects/commit/show.html.haml index b37b3bfd460599224d31cecada00347612ce29ab..c282b1fe2f9158a618f744d6afc3885def048c70 100644 --- a/app/views/projects/commit/show.html.haml +++ b/app/views/projects/commit/show.html.haml @@ -1,5 +1,6 @@ - @no_container = true -- breadcrumb_title "Commit #{@commit.short_id}" +- add_to_breadcrumbs "Commit", project_commits_path(@project) +- breadcrumb_title @commit.short_id - container_class = !fluid_layout && diff_view == :inline ? 'container-limited' : '' - limited_container_width = fluid_layout ? '' : 'limit-container-width' - @content_class = limited_container_width diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index 0d0bc499dfad3364ad771024238c9cbc95dad745..c35d1b5aaee1145df523b5e8bad1325a78cd8b78 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -1,5 +1,6 @@ - @no_container = true -- breadcrumb_title "Enviroment '#{@environment.name}'" +- add_to_breadcrumbs "Environments", project_environments_path(@project) +- breadcrumb_title @environment.name - page_title "Environments" = render "projects/pipelines/head" diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index 4c27083f54f013216a8945c9a1d7d0107206fbd1..fd4588ca101c2f7fe7fc75e5750f21f788aa51c1 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -1,5 +1,6 @@ - @content_class = "limit-container-width" unless fluid_layout -- breadcrumb_title "Issues #{@issue.to_reference}" +- add_to_breadcrumbs "Issues", project_issues_path(@project) +- breadcrumb_title @issue.to_reference - page_title "#{@issue.title} (#{@issue.to_reference})", "Issues" - page_description @issue.description - page_card_attributes @issue.card_attributes diff --git a/app/views/projects/jobs/show.html.haml b/app/views/projects/jobs/show.html.haml index 2c76ca91155bf0bbd50f4e999da4f7918a2b2ba3..975c08c06e6e2ff3b9b16043c59df82706775a02 100644 --- a/app/views/projects/jobs/show.html.haml +++ b/app/views/projects/jobs/show.html.haml @@ -1,5 +1,6 @@ - @no_container = true -- breadcrumb_title "Jobs ##{@build.id}" +- add_to_breadcrumbs "Jobs", project_jobs_path(@project) +- breadcrumb_title "##{@build.id}" - page_title "#{@build.name} (##{@build.id})", "Jobs" = render "projects/pipelines/head" diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml index f6132300c403799de8b27e1e869161d1380e3e45..c2d16f7e731bdff075dcf6805dbfbd49a14b32b8 100644 --- a/app/views/projects/merge_requests/show.html.haml +++ b/app/views/projects/merge_requests/show.html.haml @@ -1,5 +1,6 @@ - @content_class = "limit-container-width" unless fluid_layout -- breadcrumb_title "Merge Requests #{@merge_request.to_reference}" +- add_to_breadcrumbs "Merge Requests", project_merge_requests_path(@project) +- breadcrumb_title @merge_request.to_reference - page_title "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests" - page_description @merge_request.description - page_card_attributes @merge_request.card_attributes diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml index 4137bddef6f1c2d189531cef6508e4e2634b3997..1f5f18801adf31f960adb1249692baec9e166280 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -1,5 +1,6 @@ - @no_container = true -- breadcrumb_title "Milestone #{@milestone.title}" +- add_to_breadcrumbs "Milestones", project_milestones_path(@project) +- breadcrumb_title @milestone.title - page_title @milestone.title, "Milestones" - page_description @milestone.description = render "shared/mr_head" diff --git a/app/views/projects/pipelines/show.html.haml b/app/views/projects/pipelines/show.html.haml index bb25cfb440c305978b6c1571b9e4efdfba9603b9..7cc9fe79afd5a09bb6d42c4daa634fb8ce210c91 100644 --- a/app/views/projects/pipelines/show.html.haml +++ b/app/views/projects/pipelines/show.html.haml @@ -1,5 +1,6 @@ - @no_container = true -- breadcrumb_title "Pipelines ##{@pipeline.id}" +- add_to_breadcrumbs "Pipelines", project_pipelines_path(@project) +- breadcrumb_title "##{@pipeline.id}" - page_title "Pipeline" = render "projects/pipelines/head" diff --git a/app/views/projects/snippets/show.html.haml b/app/views/projects/snippets/show.html.haml index ff59d26441f50e8c835cc4b53632ca47abbc0e4e..fda068f08c22a2f181b1cd35994c03ee28822182 100644 --- a/app/views/projects/snippets/show.html.haml +++ b/app/views/projects/snippets/show.html.haml @@ -1,5 +1,6 @@ - @content_class = "limit-container-width limited-inner-width-container" unless fluid_layout -- breadcrumb_title "Snippet #{@snippet.to_reference}" +- add_to_breadcrumbs "Snippets", dashboard_snippets_path +- breadcrumb_title @snippet.to_reference - page_title "#{@snippet.title} (#{@snippet.to_reference})", "Snippets" = render 'shared/snippets/header' diff --git a/app/views/projects/tags/show.html.haml b/app/views/projects/tags/show.html.haml index 3b6601f4dcf82d1ddc32e8b3d3b4b45488838dcb..5d6eb4f402630b49a143cb8fa7d72cd2eb76b41c 100644 --- a/app/views/projects/tags/show.html.haml +++ b/app/views/projects/tags/show.html.haml @@ -1,5 +1,6 @@ - @no_container = true -- breadcrumb_title "Tags #{@tag.name}" +- add_to_breadcrumbs "Tags", project_tags_path(@project) +- breadcrumb_title @tag.name - page_title @tag.name, "Tags" = render "projects/commits/head" diff --git a/app/views/shared/snippets/_header.html.haml b/app/views/shared/snippets/_header.html.haml index 17b34c5eeb3dc3019bb48a21e9c3d79fe2bd5520..03bc0b25055f1ad6e2b222566d5850cb259b0814 100644 --- a/app/views/shared/snippets/_header.html.haml +++ b/app/views/shared/snippets/_header.html.haml @@ -3,10 +3,14 @@ %span.sr-only = visibility_level_label(@snippet.visibility_level) = visibility_level_icon(@snippet.visibility_level, fw: false) - %strong.item-title - Snippet #{@snippet.to_reference} + - unless show_new_nav? + %strong.item-title + Snippet #{@snippet.to_reference} %span.creator - authored + - if show_new_nav? + Authored + - else + authored = time_ago_with_tooltip(@snippet.created_at, placement: 'bottom', html_class: 'snippet_updated_ago') by #{link_to_member(@project, @snippet.author, size: 24, author_class: "author item-title", avatar_class: "hidden-xs")} diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index 706f13dd004c415aa99ec40db525a9dd153b7541..578327883e5d3dbce8679b195bd219250bc9ddd0 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -1,5 +1,7 @@ - @hide_top_links = true - @content_class = "limit-container-width limited-inner-width-container" unless fluid_layout +- add_to_breadcrumbs "Snippets", dashboard_snippets_path +- breadcrumb_title @snippet.to_reference - page_title "#{@snippet.title} (#{@snippet.to_reference})", "Snippets" = render 'shared/snippets/header'