diff options
author | Phil Hughes <me@iamphill.com> | 2017-08-17 10:42:04 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-08-18 11:07:05 +0100 |
commit | dae629e5e9a75ef0594399b46191306dcbaab90b (patch) | |
tree | 153bc29edb3732c87cfa40faf4ed591b560d4e74 | |
parent | a10cc2202dffcf8b4a7bc7db22757ac83bf95eb4 (diff) | |
download | gitlab-ce-dae629e5e9a75ef0594399b46191306dcbaab90b.tar.gz |
fix some inconsistencies with the breadcrumbs
-rw-r--r-- | app/assets/javascripts/breadcrumb.js | 5 | ||||
-rw-r--r-- | app/assets/stylesheets/new_nav.scss | 7 | ||||
-rw-r--r-- | app/helpers/groups_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/issuables_helper.rb | 19 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 2 | ||||
-rw-r--r-- | app/views/layouts/nav/_breadcrumbs.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/commit/show.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/environments/show.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/issues/show.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/jobs/show.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/milestones/show.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/pipelines/show.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/snippets/show.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/tags/show.html.haml | 3 | ||||
-rw-r--r-- | app/views/shared/snippets/_header.html.haml | 10 | ||||
-rw-r--r-- | app/views/snippets/show.html.haml | 2 |
17 files changed, 50 insertions, 29 deletions
diff --git a/app/assets/javascripts/breadcrumb.js b/app/assets/javascripts/breadcrumb.js index 7dfdf844325..97340953c77 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 b1d1ea1ba5f..8beaf64e7a1 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 51acd557ea7..7f43e4106fc 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)} <span class='hidable'> / </span>".html_safe end end end diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 197c90c4081..eba8aed05d3 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 cd62835fd29..867f3fadfb9 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 240aee19a9e..9f0cb2fad3a 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 b37b3bfd460..c282b1fe2f9 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 0d0bc499dfa..c35d1b5aaee 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 4c27083f54f..fd4588ca101 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 2c76ca91155..975c08c06e6 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 f6132300c40..c2d16f7e731 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 4137bddef6f..1f5f18801ad 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 bb25cfb440c..7cc9fe79afd 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 ff59d26441f..fda068f08c2 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 3b6601f4dcf..5d6eb4f4026 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 17b34c5eeb3..03bc0b25055 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 706f13dd004..578327883e5 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' |