Commit 0def3677 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Change single-item breadcrumbs to page titles

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 284100a8
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
@import 'framework/blank'; @import 'framework/blank';
@import 'framework/wells'; @import 'framework/wells';
@import 'framework/page_header'; @import 'framework/page_header';
@import 'framework/page_title';
@import 'framework/awards'; @import 'framework/awards';
@import 'framework/images'; @import 'framework/images';
@import 'framework/broadcast_messages'; @import 'framework/broadcast_messages';
......
.page-title-holder {
@extend .d-flex;
@extend .align-items-center;
padding-top: $gl-padding-top;
border-bottom: 1px solid $border-color;
.page-title {
margin: $gl-padding 0;
font-size: 1.75em;
font-weight: $gl-font-weight-bold;
color: $gl-text-color;
}
.page-title-controls {
margin-left: auto;
}
}
.page-title-holder
%h1.page-title= _('Activity')
.top-area .top-area
%ul.nav-links.nav.nav-tabs %ul.nav-links.nav.nav-tabs
%li{ class: active_when(params[:filter].nil?) }> %li{ class: active_when(params[:filter].nil?) }>
......
.page-title-holder
%h1.page-title= _('Groups')
- if current_user.can_create_group?
.page-title-controls
= link_to _("New group"), new_group_path, class: "btn btn-success"
.top-area .top-area
%ul.nav-links.mobile-separator.nav.nav-tabs %ul.nav-links.mobile-separator.nav.nav-tabs
= nav_link(page: dashboard_groups_path) do = nav_link(page: dashboard_groups_path) do
...@@ -9,5 +16,3 @@ ...@@ -9,5 +16,3 @@
.nav-controls .nav-controls
= render 'shared/groups/search_form' = render 'shared/groups/search_form'
= render 'shared/groups/dropdown' = render 'shared/groups/dropdown'
- if current_user.can_create_group?
= link_to _("New group"), new_group_path, class: "btn btn-success"
= content_for :flash_message do = content_for :flash_message do
= render 'shared/project_limit' = render 'shared/project_limit'
.page-title-holder
%h1.page-title= _('Projects')
- if current_user.can_create_project?
.page-title-controls
= link_to "New project", new_project_path, class: "btn btn-success"
.top-area.scrolling-tabs-container.inner-page-scroll-tabs .top-area.scrolling-tabs-container.inner-page-scroll-tabs
.fade-left= icon('angle-left') .fade-left= icon('angle-left')
.fade-right= icon('angle-right') .fade-right= icon('angle-right')
...@@ -18,5 +25,3 @@ ...@@ -18,5 +25,3 @@
.nav-controls .nav-controls
= render 'shared/projects/search_form' = render 'shared/projects/search_form'
= render 'shared/projects/dropdown' = render 'shared/projects/dropdown'
- if current_user.can_create_project?
= link_to "New project", new_project_path, class: "btn btn-success"
.page-title-holder
%h1.page-title= _('Snippets')
- if current_user
.page-title-controls
= link_to "New snippet", new_snippet_path, class: "btn btn-success", title: "New snippet"
.top-area .top-area
%ul.nav-links.nav.nav-tabs %ul.nav-links.nav.nav-tabs
= nav_link(page: dashboard_snippets_path, html_options: {class: 'home'}) do = nav_link(page: dashboard_snippets_path, html_options: {class: 'home'}) do
...@@ -6,7 +13,3 @@ ...@@ -6,7 +13,3 @@
= nav_link(page: explore_snippets_path) do = nav_link(page: explore_snippets_path) do
= link_to explore_snippets_path, title: 'Explore snippets', data: {placement: 'right'} do = link_to explore_snippets_path, title: 'Explore snippets', data: {placement: 'right'} do
Explore snippets Explore snippets
- if current_user
.nav-controls.d-none.d-sm-block
= link_to "New snippet", new_snippet_path, class: "btn btn-success", title: "New snippet"
...@@ -4,11 +4,17 @@ ...@@ -4,11 +4,17 @@
= content_for :meta_tags do = content_for :meta_tags do
= auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{current_user.name} issues") = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{current_user.name} issues")
.page-title-holder
%h1.page-title= _('Issues')
- if current_user
.page-title-controls
= render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", with_feature_enabled: 'issues', type: :issues
.top-area .top-area
= render 'shared/issuable/nav', type: :issues, display_count: !@no_filters_set = render 'shared/issuable/nav', type: :issues, display_count: !@no_filters_set
.nav-controls .nav-controls
= render 'shared/issuable/feed_buttons' = render 'shared/issuable/feed_buttons'
= render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", with_feature_enabled: 'issues', type: :issues
= render 'shared/issuable/filter', type: :issues = render 'shared/issuable/filter', type: :issues
......
...@@ -2,10 +2,15 @@ ...@@ -2,10 +2,15 @@
- page_title _("Merge Requests") - page_title _("Merge Requests")
- @breadcrumb_link = merge_requests_dashboard_path(assignee_id: current_user.id) - @breadcrumb_link = merge_requests_dashboard_path(assignee_id: current_user.id)
.page-title-holder
%h1.page-title= _('Merge Requests')
- if current_user
.page-title-controls
= render 'shared/new_project_item_select', path: 'merge_requests/new', label: "New merge request", with_feature_enabled: 'merge_requests', type: :merge_requests
.top-area .top-area
= render 'shared/issuable/nav', type: :merge_requests, display_count: !@no_filters_set = render 'shared/issuable/nav', type: :merge_requests, display_count: !@no_filters_set
.nav-controls
= render 'shared/new_project_item_select', path: 'merge_requests/new', label: "New merge request", with_feature_enabled: 'merge_requests', type: :merge_requests
= render 'shared/issuable/filter', type: :merge_requests = render 'shared/issuable/filter', type: :merge_requests
......
...@@ -2,12 +2,18 @@ ...@@ -2,12 +2,18 @@
- page_title 'Milestones' - page_title 'Milestones'
- header_title 'Milestones', dashboard_milestones_path - header_title 'Milestones', dashboard_milestones_path
.page-title-holder
%h1.page-title= _('Milestones')
- if current_user
.page-title-controls
= render 'shared/new_project_item_select',
path: 'milestones/new', label: 'New milestone',
include_groups: true, type: :milestones
.top-area .top-area
= render 'shared/milestones_filter', counts: @milestone_states = render 'shared/milestones_filter', counts: @milestone_states
.nav-controls
= render 'shared/new_project_item_select', path: 'milestones/new', label: 'New milestone', include_groups: true, type: :milestones
.milestones .milestones
%ul.content-list %ul.content-list
- if @milestones.blank? - if @milestones.blank?
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
- page_title "Todos" - page_title "Todos"
- header_title "Todos", dashboard_todos_path - header_title "Todos", dashboard_todos_path
.page-title-holder
%h1.page-title= _('Todos')
- if current_user.todos.any? - if current_user.todos.any?
.top-area .top-area
%ul.nav-links.mobile-separator.nav.nav-tabs %ul.nav-links.mobile-separator.nav.nav-tabs
......
- @breadcrumb_link = dashboard_groups_path - @hide_breadcrumbs = true
- breadcrumb_title "Groups"
- @hide_top_links = true - @hide_top_links = true
- page_title 'New Group' - page_title 'New Group'
- header_title "Groups", dashboard_groups_path - header_title "Groups", dashboard_groups_path
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
- unless @hide_breadcrumbs - unless @hide_breadcrumbs
= render "layouts/nav/breadcrumbs" = render "layouts/nav/breadcrumbs"
= render "layouts/flash" = render "layouts/flash"
.d-flex
%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" }
= yield = yield
- page_title _("Dashboard") - page_title _("Dashboard")
- header_title _("Dashboard"), root_path unless header_title - header_title _("Dashboard"), root_path unless header_title
- sidebar "dashboard" - sidebar "dashboard"
- @hide_breadcrumbs = true
= render template: "layouts/application" = render template: "layouts/application"
- page_title _("Explore") - page_title _("Explore")
- @hide_breadcrumbs = true
- unless current_user - unless current_user
- header_title _("Explore GitLab"), explore_root_path - header_title _("Explore GitLab"), explore_root_path
......
- @breadcrumb_link = dashboard_projects_path - @hide_breadcrumbs = true
- breadcrumb_title "Projects"
- @hide_top_links = true - @hide_top_links = true
- page_title 'New Project' - page_title 'New Project'
- header_title "Projects", dashboard_projects_path - header_title "Projects", dashboard_projects_path
......
- @hide_top_links = true - @hide_top_links = true
- add_to_breadcrumbs "Snippets", dashboard_snippets_path - @hide_breadcrumbs = true
- breadcrumb_title "New"
- page_title "New Snippet" - page_title "New Snippet"
%h3.page-title
New Snippet .page-title-holder
%hr %h1.page-title= _('New Snippet')
= render "shared/snippets/form", url: snippets_path(@snippet)
.prepend-top-default
= render "shared/snippets/form", url: snippets_path(@snippet)
---
title: Change single-item breadcrumbs to page titles
merge_request: 22155
author:
type: changed
...@@ -2,8 +2,12 @@ require 'spec_helper' ...@@ -2,8 +2,12 @@ require 'spec_helper'
describe 'Dashboard shortcuts', :js do describe 'Dashboard shortcuts', :js do
context 'logged in' do context 'logged in' do
let(:user) { create(:user) }
let(:project) { create(:project) }
before do before do
sign_in(create(:user)) project.add_developer(user)
sign_in(user)
visit root_dashboard_path visit root_dashboard_path
end end
...@@ -50,6 +54,6 @@ describe 'Dashboard shortcuts', :js do ...@@ -50,6 +54,6 @@ describe 'Dashboard shortcuts', :js do
end end
def check_page_title(title) def check_page_title(title)
expect(find('.breadcrumbs-sub-title')).to have_content(title) expect(find('.page-title')).to have_content(title)
end end
end end
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