From a1fbdbb6b106bcf6a959eb8f9a2a89dec6a15c9c Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Thu, 9 Jun 2016 12:37:47 -0500 Subject: [PATCH 1/8] Move tanuki icon to center of nav bar; keep nav closed by default; remove collapsed nav cookie --- app/assets/javascripts/application.js.coffee | 7 +---- app/assets/javascripts/sidebar.js.coffee | 9 ------- app/assets/stylesheets/framework/header.scss | 18 +++++++++++++ app/assets/stylesheets/framework/nav.scss | 1 + app/assets/stylesheets/framework/sidebar.scss | 27 ++++++++++--------- app/views/layouts/_collapse_button.html.haml | 5 +--- app/views/layouts/_page.html.haml | 7 +++-- app/views/layouts/header/_default.html.haml | 6 ++++- 8 files changed, 44 insertions(+), 36 deletions(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index e0ca546350..35b7d4a044 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -241,7 +241,6 @@ $ -> $this.attr 'value', $this.val() $sidebarGutterToggle = $('.js-sidebar-toggle') - $navIconToggle = $('.toggle-nav-collapse') $(document) .off 'breakpoint:change' @@ -251,10 +250,6 @@ $ -> if $gutterIcon.hasClass('fa-angle-double-right') $sidebarGutterToggle.trigger('click') - $navIcon = $navIconToggle.find('.fa') - if $navIcon.hasClass('fa-angle-left') - $navIconToggle.trigger('click') - fitSidebarForSize = -> oldBootstrapBreakpoint = bootstrapBreakpoint bootstrapBreakpoint = bp.getBreakpointSize() @@ -263,7 +258,7 @@ $ -> checkInitialSidebarSize = -> bootstrapBreakpoint = bp.getBreakpointSize() - if bootstrapBreakpoint is "xs" or "sm" + if bootstrapBreakpoint is "xs" $(document).trigger('breakpoint:change', [bootstrapBreakpoint]) $(window) diff --git a/app/assets/javascripts/sidebar.js.coffee b/app/assets/javascripts/sidebar.js.coffee index ea4ac52da3..2ce63c1642 100644 --- a/app/assets/javascripts/sidebar.js.coffee +++ b/app/assets/javascripts/sidebar.js.coffee @@ -4,8 +4,6 @@ expanded = 'page-sidebar-expanded' toggleSidebar = -> $('.page-with-sidebar').toggleClass("#{collapsed} #{expanded}") $('header').toggleClass("header-collapsed header-expanded") - $('.toggle-nav-collapse i').toggleClass("fa-angle-right fa-angle-left") - $.cookie("collapsed_nav", $('.page-with-sidebar').hasClass(collapsed), { path: '/' }) setTimeout ( -> niceScrollBars = $('.nicescroll').niceScroll(); @@ -17,10 +15,3 @@ $(document).on("click", '.toggle-nav-collapse, .side-nav-toggle', (e) -> toggleSidebar() ) - -$ -> - size = bp.getBreakpointSize() - - if size is "xs" or size is "sm" - if $('.page-with-sidebar').hasClass(expanded) - toggleSidebar() diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index b8d4233537..f883ad1b8d 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -122,9 +122,18 @@ header { margin-top: -5px; } + .header-logo { + position: absolute; + left: 50%; + margin-left: -18px; + top: 7px; + } + .title { margin: 0; font-size: 19px; + max-width: 250px; + display: inline-block; line-height: $header-height; font-weight: normal; color: $gl-text-color; @@ -190,6 +199,15 @@ header { } } +.tanuki-shape { + transition: all 0.8s; + + &:hover, &.highlight { + fill: rgb(255, 255, 255); + transition: all 0.1s; + } +} + @media (max-width: $screen-xs-max) { header .container-fluid { font-size: 18px; diff --git a/app/assets/stylesheets/framework/nav.scss b/app/assets/stylesheets/framework/nav.scss index a036799e15..8982eaa683 100644 --- a/app/assets/stylesheets/framework/nav.scss +++ b/app/assets/stylesheets/framework/nav.scss @@ -1,6 +1,7 @@ @mixin fade($gradient-direction, $rgba, $gradient-color) { visibility: visible; opacity: 1; + z-index: 2; position: absolute; bottom: 12px; width: 43px; diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss index 06a688690f..05c87cf0d4 100644 --- a/app/assets/stylesheets/framework/sidebar.scss +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -66,19 +66,8 @@ } } - -.tanuki-shape { - transition: all 0.8s; - - &:hover, &.highlight { - fill: rgb(255, 255, 255); - transition: all 0.1s; - } -} - - .nav-sidebar { - margin-top: 22 + $header-height; + margin-top: 22px; margin-bottom: 116px; transition-duration: .3s; list-style: none; @@ -217,6 +206,20 @@ } } +.gitlab-text-container { + height: 50px; + padding: 5px; + text-align: center; + + h3 { + color: white; + margin: 0; + font-size: 19px; + line-height: 41px; + font-weight: normal; + } +} + .page-sidebar-expanded { padding-left: $sidebar_width; diff --git a/app/views/layouts/_collapse_button.html.haml b/app/views/layouts/_collapse_button.html.haml index 2ed51d87ca..61c0e71f03 100644 --- a/app/views/layouts/_collapse_button.html.haml +++ b/app/views/layouts/_collapse_button.html.haml @@ -1,4 +1 @@ -- if nav_menu_collapsed? - = link_to icon('angle-right'), '#', class: 'toggle-nav-collapse', title: "Open/Close" -- else - = link_to icon('angle-left'), '#', class: 'toggle-nav-collapse', title: "Open/Close" += link_to icon('angle-left'), '#', class: 'toggle-nav-collapse', title: "Open/Close" diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index 261038ef94..def874008f 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -1,9 +1,8 @@ -.page-with-sidebar{ class: "#{page_sidebar_class} #{page_gutter_class}" } +.page-with-sidebar.page-sidebar-collapsed{ class: "#{page_gutter_class}" } .sidebar-wrapper.nicescroll{ class: nav_sidebar_class } = link_to root_path, class: 'gitlab-text-container-link', title: 'Dashboard', id: 'js-shortcuts-home' do - .header-logo - #logo - = brand_header_logo + .gitlab-text-container + %h3 GitLab - if defined?(sidebar) && sidebar = render "layouts/nav/#{sidebar}" diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index c33740e23f..184dac32e5 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -1,4 +1,4 @@ -%header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class } +%header.navbar.navbar-fixed-top.navbar-gitlab.header-collapsed %div{ class: fluid_layout ? "container-fluid" : "container-fluid" } .header-content %button.side-nav-toggle{type: 'button'} @@ -50,6 +50,10 @@ %h1.title= title + .header-logo + #logo + = brand_header_logo + = yield :header_content = render 'shared/outdated_browser' From ade0a4af8b85c16f6b36bee7216a3d29c4b4be0c Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Thu, 9 Jun 2016 17:23:27 -0500 Subject: [PATCH 2/8] Fix logo at all screen widths, update sidebar text --- app/assets/javascripts/application.js.coffee | 3 +- .../stylesheets/framework/gitlab-theme.scss | 3 +- app/assets/stylesheets/framework/header.scss | 39 +++++++---- app/assets/stylesheets/framework/nav.scss | 19 ++++++ app/assets/stylesheets/framework/sidebar.scss | 64 ++++++++----------- .../stylesheets/framework/variables.scss | 2 +- app/views/layouts/_page.html.haml | 4 +- 7 files changed, 78 insertions(+), 56 deletions(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 35b7d4a044..03bb7fc1f7 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -207,6 +207,7 @@ $ -> $('.navbar-toggle').on 'click', -> $('.header-content .title').toggle() + $('.header-content .header-logo').toggle() $('.header-content .navbar-collapse').toggle() $('.navbar-toggle').toggleClass('active') $('.navbar-toggle i').toggleClass("fa-angle-right fa-angle-left") @@ -258,7 +259,7 @@ $ -> checkInitialSidebarSize = -> bootstrapBreakpoint = bp.getBreakpointSize() - if bootstrapBreakpoint is "xs" + if bootstrapBreakpoint is "xs" or "sm" $(document).trigger('breakpoint:change', [bootstrapBreakpoint]) $(window) diff --git a/app/assets/stylesheets/framework/gitlab-theme.scss b/app/assets/stylesheets/framework/gitlab-theme.scss index 2540ff497f..bec0e51496 100644 --- a/app/assets/stylesheets/framework/gitlab-theme.scss +++ b/app/assets/stylesheets/framework/gitlab-theme.scss @@ -8,7 +8,7 @@ */ @mixin gitlab-theme($color-light, $color, $color-darker, $color-dark) { .page-with-sidebar { - .header-logo { + .gitlab-text-container { background: $color-darker; a { @@ -23,6 +23,7 @@ background-color: $color-dark; a { color: $white-light; + text-decoration: none; h3 { color: $white-light; diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index f883ad1b8d..7897e544af 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -109,15 +109,17 @@ header { position: relative; height: $header-height; padding-right: 40px; - - @media (max-width: $screen-xs-min) { - padding-left: 40px; - } + padding-left: 30px; + transition-duration: .3s; @media (min-width: $screen-sm-min) { padding-right: 0; } + @media (max-width: $screen-sm-max) { + padding-right: 30px; + } + .dropdown-menu { margin-top: -5px; } @@ -127,6 +129,13 @@ header { left: 50%; margin-left: -18px; top: 7px; + transition-duration: .3s; + z-index: 999; + + @media (max-width: $screen-sm-min) { + right: 25px; + left: auto; + } } .title { @@ -142,6 +151,10 @@ header { vertical-align: top; white-space: nowrap; + @media (max-width: $screen-sm-min) { + max-width: 220px; + } + a { color: $gl-text-color; &:hover { @@ -169,6 +182,10 @@ header { .navbar-collapse { float: right; border-top: none; + + @media (max-width: $screen-sm-min) { + float: none; + } } } @@ -185,17 +202,11 @@ header { margin-left: 0; .header-content { - padding-left: 30px; - transition-duration: .3s; - } -} -.header-expanded { - margin-left: 0; - - .header-content { - margin-left: $sidebar_width; - transition-duration: .3s; + @media (min-width: $screen-sm-max) { + padding-left: 30px; + transition-duration: .3s; + } } } diff --git a/app/assets/stylesheets/framework/nav.scss b/app/assets/stylesheets/framework/nav.scss index 8982eaa683..75f44d8161 100644 --- a/app/assets/stylesheets/framework/nav.scss +++ b/app/assets/stylesheets/framework/nav.scss @@ -350,6 +350,8 @@ } .nav-control { + padding-left: 0; + transition-duration: .3s; .fade-right { @media (min-width: $screen-xs-max) { @@ -362,6 +364,23 @@ } } +.page-sidebar-collapsed { + + .nav-control { + @media (min-width: $screen-md-min) { + padding-left: 32px; + transition-duration: .3s; + } + } + + .layout-nav { + + @media (max-width: $screen-sm-min) { + padding-left: 0; + } + } +} + .scrolling-tabs-container { position: relative; diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss index 05c87cf0d4..e461550984 100644 --- a/app/assets/stylesheets/framework/sidebar.scss +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -35,9 +35,9 @@ } .sidebar-wrapper { - .header-logo { + .gitlab-text-container { height: $header-height; - padding: 8px 26px; + padding: 0 19px; width: $sidebar_width; position: fixed; z-index: 999; @@ -47,6 +47,13 @@ &:hover { background-color: #eee; } + + h3 { + font-size: 19px; + line-height: 50px; + font-weight: normal; + margin: 0; + } } .sidebar-user { @@ -66,8 +73,19 @@ } } + +.tanuki-shape { + transition: all 0.8s; + + &:hover, &.highlight { + fill: rgb(255, 255, 255); + transition: all 0.1s; + } +} + + .nav-sidebar { - margin-top: 22px; + margin-top: 22 + $header-height; margin-bottom: 116px; transition-duration: .3s; list-style: none; @@ -159,23 +177,15 @@ .sidebar-wrapper { width: 0; - .header-logo { + .gitlab-text-container { width: 0; - padding: 8px 0; + padding: 0; - a { - padding-left: ($sidebar_collapsed_width - 36) / 2; - - .gitlab-text-container { - display: none; - } + h3 { + display: none; } } - #logo { - display: none; - } - .nav-sidebar { width: $sidebar_collapsed_width; @@ -206,24 +216,10 @@ } } -.gitlab-text-container { - height: 50px; - padding: 5px; - text-align: center; - - h3 { - color: white; - margin: 0; - font-size: 19px; - line-height: 41px; - font-weight: normal; - } -} - .page-sidebar-expanded { padding-left: $sidebar_width; - @media (max-width: $screen-xs-min) { + @media (max-width: $screen-sm-max) { padding-left: 0; } @@ -246,13 +242,7 @@ } .layout-nav { - @media (max-width: $screen-xs-min) { - padding-right: 0; - } - - @media (min-width: $screen-xs-min) and (max-width: $screen-md-min) { - padding-right: 90px; - } + padding-right: 0; @media (min-width: $screen-md-min) { padding-right: $sidebar_width; diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss index 847b2f80bd..6f724afa9d 100644 --- a/app/assets/stylesheets/framework/variables.scss +++ b/app/assets/stylesheets/framework/variables.scss @@ -1,7 +1,7 @@ /* * Layout */ -$sidebar_collapsed_width: 62px; +$sidebar_collapsed_width: 0; $sidebar_width: 90px; $gutter_collapsed_width: 62px; $gutter_width: 290px; diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index def874008f..6030613c8c 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -1,7 +1,7 @@ .page-with-sidebar.page-sidebar-collapsed{ class: "#{page_gutter_class}" } .sidebar-wrapper.nicescroll{ class: nav_sidebar_class } - = link_to root_path, class: 'gitlab-text-container-link', title: 'Dashboard', id: 'js-shortcuts-home' do - .gitlab-text-container + .gitlab-text-container + = link_to root_path, class: 'gitlab-text-container-link', title: 'Dashboard', id: 'js-shortcuts-home' do %h3 GitLab - if defined?(sidebar) && sidebar From 5957fdc493af72579571368d584145acf10861a1 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Thu, 9 Jun 2016 21:35:25 -0500 Subject: [PATCH 3/8] Fix profile test --- app/assets/stylesheets/framework/variables.scss | 2 +- features/steps/profile/profile.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss index 6f724afa9d..847b2f80bd 100644 --- a/app/assets/stylesheets/framework/variables.scss +++ b/app/assets/stylesheets/framework/variables.scss @@ -1,7 +1,7 @@ /* * Layout */ -$sidebar_collapsed_width: 0; +$sidebar_collapsed_width: 62px; $sidebar_width: 90px; $gutter_collapsed_width: 62px; $gutter_width: 290px; diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index b1a87b96ef..9e5602dacf 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -155,6 +155,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I click on my profile picture' do + find(:css, '.side-nav-toggle').click find(:css, '.sidebar-user').click end From 9662a5e3df59216d7a3cc18b16bbf467b2233ece Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Thu, 9 Jun 2016 22:39:54 -0500 Subject: [PATCH 4/8] Update media queries --- app/assets/stylesheets/framework/header.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index 7897e544af..7ccd25bc1b 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -132,7 +132,7 @@ header { transition-duration: .3s; z-index: 999; - @media (max-width: $screen-sm-min) { + @media (max-width: $screen-xs-max) { right: 25px; left: auto; } @@ -151,7 +151,7 @@ header { vertical-align: top; white-space: nowrap; - @media (max-width: $screen-sm-min) { + @media (max-width: $screen-xs-max) { max-width: 220px; } @@ -183,7 +183,7 @@ header { float: right; border-top: none; - @media (max-width: $screen-sm-min) { + @media (max-width: $screen-xs-max) { float: none; } } From cb126995aa57cc9e169f875fbd4f9b5b82575a27 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Fri, 10 Jun 2016 10:41:00 -0500 Subject: [PATCH 5/8] Revert side nav to full width; remove border under nav; remove tooltips on nav links; stop page content shifting with side nav; put project nav in container --- app/assets/javascripts/application.js.coffee | 6 -- .../stylesheets/framework/gitlab-theme.scss | 23 -------- app/assets/stylesheets/framework/header.scss | 11 ++-- app/assets/stylesheets/framework/nav.scss | 21 +------ app/assets/stylesheets/framework/sidebar.scss | 55 +++---------------- .../stylesheets/framework/variables.scss | 2 +- app/views/layouts/_collapse_button.html.haml | 2 +- app/views/layouts/_page.html.haml | 5 +- app/views/layouts/ci/_page.html.haml | 6 -- app/views/layouts/nav/_admin.html.haml | 38 ++++++------- app/views/layouts/nav/_dashboard.html.haml | 20 +++---- app/views/layouts/nav/_explore.html.haml | 8 +-- 12 files changed, 52 insertions(+), 145 deletions(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 03bb7fc1f7..e5531c0283 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -169,12 +169,6 @@ $ -> container: 'body' ) - $('.page-with-sidebar').tooltip( - selector: '.sidebar-collapsed .nav-sidebar a, .sidebar-collapsed a.sidebar-user' - placement: 'right' - container: 'body' - ) - # Form submitter $('.trigger-submit').on 'change', -> $(@).parents('form').submit() diff --git a/app/assets/stylesheets/framework/gitlab-theme.scss b/app/assets/stylesheets/framework/gitlab-theme.scss index bec0e51496..245e8b285e 100644 --- a/app/assets/stylesheets/framework/gitlab-theme.scss +++ b/app/assets/stylesheets/framework/gitlab-theme.scss @@ -8,29 +8,6 @@ */ @mixin gitlab-theme($color-light, $color, $color-darker, $color-dark) { .page-with-sidebar { - .gitlab-text-container { - background: $color-darker; - - a { - color: $color-light; - - h3 { - color: $color-light; - } - } - - &:hover { - background-color: $color-dark; - a { - color: $white-light; - text-decoration: none; - - h3 { - color: $white-light; - } - } - } - } .collapse-nav a { color: $white-light; diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index 7ccd25bc1b..824f5cd21b 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -28,7 +28,6 @@ header { height: $header-height; background-color: $background-color; border: none; - border-bottom: 1px solid $border-color; @media (max-width: $screen-xs-min) { padding: 0 16px; @@ -132,6 +131,10 @@ header { transition-duration: .3s; z-index: 999; + &:hover { + cursor: pointer; + } + @media (max-width: $screen-xs-max) { right: 25px; left: auto; @@ -141,7 +144,7 @@ header { .title { margin: 0; font-size: 19px; - max-width: 250px; + max-width: 400px; display: inline-block; line-height: $header-height; font-weight: normal; @@ -151,8 +154,8 @@ header { vertical-align: top; white-space: nowrap; - @media (max-width: $screen-xs-max) { - max-width: 220px; + @media (max-width: $screen-sm-max) { + max-width: 190px; } a { diff --git a/app/assets/stylesheets/framework/nav.scss b/app/assets/stylesheets/framework/nav.scss index 75f44d8161..793d4e0479 100644 --- a/app/assets/stylesheets/framework/nav.scss +++ b/app/assets/stylesheets/framework/nav.scss @@ -350,12 +350,10 @@ } .nav-control { - padding-left: 0; - transition-duration: .3s; .fade-right { @media (min-width: $screen-xs-max) { - right: 67px; + right: 68px; } @media (max-width: $screen-xs-min) { right: 0; @@ -364,23 +362,6 @@ } } -.page-sidebar-collapsed { - - .nav-control { - @media (min-width: $screen-md-min) { - padding-left: 32px; - transition-duration: .3s; - } - } - - .layout-nav { - - @media (max-width: $screen-sm-min) { - padding-left: 0; - } - } -} - .scrolling-tabs-container { position: relative; diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss index e461550984..a96ce02230 100644 --- a/app/assets/stylesheets/framework/sidebar.scss +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -35,31 +35,11 @@ } .sidebar-wrapper { - .gitlab-text-container { - height: $header-height; - padding: 0 19px; - width: $sidebar_width; - position: fixed; - z-index: 999; - overflow: hidden; - transition-duration: .3s; - - &:hover { - background-color: #eee; - } - - h3 { - font-size: 19px; - line-height: 50px; - font-weight: normal; - margin: 0; - } - } .sidebar-user { padding: 15px 22px; position: fixed; - bottom: 40px; + bottom: 0; width: $sidebar_width; overflow: hidden; transition-duration: .3s; @@ -104,10 +84,10 @@ } a { - text-align: center; - padding: 8px; + width: $sidebar_width; + padding: 7px 15px 7px 23px; font-size: $gl-font-size; - color: $gray; + line-height: 24px; display: block; text-decoration: none; font-weight: normal; @@ -125,10 +105,9 @@ font-size: 16px; } - .nav-link-text { - margin-top: 3px; - font-size: 13px; - line-height: 18px; + i, + svg { + margin-right: 13px; } &.back-link i { @@ -150,7 +129,7 @@ .collapse-nav a { width: $sidebar_width; position: fixed; - bottom: 0; + top: 0; left: 0; font-size: 13px; background: transparent; @@ -177,15 +156,6 @@ .sidebar-wrapper { width: 0; - .gitlab-text-container { - width: 0; - padding: 0; - - h3 { - display: none; - } - } - .nav-sidebar { width: $sidebar_collapsed_width; @@ -217,7 +187,6 @@ } .page-sidebar-expanded { - padding-left: $sidebar_width; @media (max-width: $screen-sm-max) { padding-left: 0; @@ -240,14 +209,6 @@ } } } - - .layout-nav { - padding-right: 0; - - @media (min-width: $screen-md-min) { - padding-right: $sidebar_width; - } - } } .right-sidebar-collapsed { diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss index 847b2f80bd..752d8ec878 100644 --- a/app/assets/stylesheets/framework/variables.scss +++ b/app/assets/stylesheets/framework/variables.scss @@ -2,7 +2,7 @@ * Layout */ $sidebar_collapsed_width: 62px; -$sidebar_width: 90px; +$sidebar_width: 220px; $gutter_collapsed_width: 62px; $gutter_width: 290px; $gutter_inner_width: 258px; diff --git a/app/views/layouts/_collapse_button.html.haml b/app/views/layouts/_collapse_button.html.haml index 61c0e71f03..e4fab89737 100644 --- a/app/views/layouts/_collapse_button.html.haml +++ b/app/views/layouts/_collapse_button.html.haml @@ -1 +1 @@ -= link_to icon('angle-left'), '#', class: 'toggle-nav-collapse', title: "Open/Close" += link_to icon('bars'), '#', class: 'toggle-nav-collapse', title: "Open/Close" diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index 6030613c8c..c08aec959f 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -1,8 +1,5 @@ .page-with-sidebar.page-sidebar-collapsed{ class: "#{page_gutter_class}" } .sidebar-wrapper.nicescroll{ class: nav_sidebar_class } - .gitlab-text-container - = link_to root_path, class: 'gitlab-text-container-link', title: 'Dashboard', id: 'js-shortcuts-home' do - %h3 GitLab - if defined?(sidebar) && sidebar = render "layouts/nav/#{sidebar}" @@ -18,7 +15,7 @@ = image_tag avatar_icon(current_user, 60), alt: 'Profile', class: 'avatar avatar s46' - if defined?(nav) && nav .layout-nav - .container-fluid + %div{ class: (container_class) } = render "layouts/nav/#{nav}" .content-wrapper{ class: "#{layout_nav_class}" } = render "layouts/broadcast" diff --git a/app/views/layouts/ci/_page.html.haml b/app/views/layouts/ci/_page.html.haml index a13241bebe..2e56d0ac6a 100644 --- a/app/views/layouts/ci/_page.html.haml +++ b/app/views/layouts/ci/_page.html.haml @@ -1,12 +1,6 @@ .page-with-sidebar{ class: page_sidebar_class } = render "layouts/broadcast" .sidebar-wrapper.nicescroll{ class: nav_sidebar_class } - .header-logo - %a#logo - = brand_header_logo - = link_to root_path, class: 'gitlab-text-container-link', title: 'Dashboard', id: 'js-shortcuts-home' do - .gitlab-text-container - %h3 GitLab - if defined?(sidebar) && sidebar = render "layouts/ci/#{sidebar}" diff --git a/app/views/layouts/nav/_admin.html.haml b/app/views/layouts/nav/_admin.html.haml index de2276e75e..40c47487fa 100644 --- a/app/views/layouts/nav/_admin.html.haml +++ b/app/views/layouts/nav/_admin.html.haml @@ -2,102 +2,102 @@ = nav_link(controller: :dashboard, html_options: {class: 'home'}) do = link_to admin_root_path, title: 'Overview' do = icon('dashboard fw') - .nav-link-text + %span Overview = nav_link(controller: [:admin, :projects]) do = link_to admin_namespaces_projects_path, title: 'Projects' do = icon('cube fw') - .nav-link-text + %span Projects = nav_link(controller: :users) do = link_to admin_users_path, title: 'Users' do = icon('user fw') - .nav-link-text + %span Users = nav_link(controller: :groups) do = link_to admin_groups_path, title: 'Groups' do = icon('group fw') - .nav-link-text + %span Groups = nav_link(controller: :deploy_keys) do = link_to admin_deploy_keys_path, title: 'Deploy Keys' do = icon('key fw') - .nav-link-text + %span Deploy Keys = nav_link path: ['runners#index', 'runners#show'] do = link_to admin_runners_path, title: 'Runners' do = icon('cog fw') - .nav-link-text + %span Runners = nav_link path: 'builds#index' do = link_to admin_builds_path, title: 'Builds' do = icon('link fw') - .nav-link-text + %span Builds = nav_link(controller: :logs) do = link_to admin_logs_path, title: 'Logs' do = icon('file-text fw') - .nav-link-text + %span Logs = nav_link(controller: :health_check) do = link_to admin_health_check_path, title: 'Health Check' do = icon('medkit fw') - .nav-link-text + %span Health Check = nav_link(controller: :broadcast_messages) do = link_to admin_broadcast_messages_path, title: 'Messages' do = icon('bullhorn fw') - .nav-link-text + %span Messages = nav_link(controller: :hooks) do = link_to admin_hooks_path, title: 'Hooks' do = icon('external-link fw') - .nav-link-text + %span Hooks = nav_link(controller: :background_jobs) do = link_to admin_background_jobs_path, title: 'Background Jobs' do = icon('cog fw') - .nav-link-text + %span Background Jobs = nav_link(controller: :appearances) do = link_to admin_appearances_path, title: 'Appearances' do = icon('image') - .nav-link-text + %span Appearance = nav_link(controller: :applications) do = link_to admin_applications_path, title: 'Applications' do = icon('cloud fw') - .nav-link-text + %span Applications = nav_link(controller: :services) do = link_to admin_application_settings_services_path, title: 'Service Templates' do = icon('copy fw') - .nav-link-text + %span Service Templates = nav_link(controller: :labels) do = link_to admin_labels_path, title: 'Labels' do = icon('tags fw') - .nav-link-text + %span Labels = nav_link(controller: :abuse_reports) do = link_to admin_abuse_reports_path, title: "Abuse Reports" do = icon('exclamation-circle fw') - .nav-link-text + %span Abuse Reports - if askimet_enabled? = nav_link(controller: :spam_logs) do = link_to admin_spam_logs_path, title: "Spam Logs" do = icon('exclamation-triangle fw') - .nav-link-text + %span Spam Logs = nav_link(controller: :application_settings, html_options: { class: 'separate-item'}) do = link_to admin_application_settings_path, title: 'Settings' do = icon('cogs fw') - .nav-link-text + %span Settings diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml index b73fde7797..5dc85ef0d9 100644 --- a/app/views/layouts/nav/_dashboard.html.haml +++ b/app/views/layouts/nav/_dashboard.html.haml @@ -2,50 +2,50 @@ = nav_link(path: ['root#index', 'projects#trending', 'projects#starred', 'dashboard/projects#index'], html_options: {class: "#{project_tab_class} home"}) do = link_to dashboard_projects_path, title: 'Projects', class: 'dashboard-shortcuts-projects' do = navbar_icon('project') - .nav-link-text + %span Projects = nav_link(controller: :todos) do = link_to dashboard_todos_path, title: 'Todos' do = icon('bell fw') - .nav-link-text + %span Todos = nav_link(path: 'dashboard#activity') do = link_to activity_dashboard_path, class: 'dashboard-shortcuts-activity', title: 'Activity' do = navbar_icon('activity') - .nav-link-text + %span Activity = nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do = link_to dashboard_groups_path, title: 'Groups' do = navbar_icon('group') - .nav-link-text + %span Groups = nav_link(controller: 'dashboard/milestones') do = link_to dashboard_milestones_path, title: 'Milestones' do = navbar_icon('milestones') - .nav-link-text + %span Milestones = nav_link(path: 'dashboard#issues') do = link_to assigned_issues_dashboard_path, title: 'Issues', class: 'dashboard-shortcuts-issues' do = navbar_icon('issues') - .nav-link-text + %span Issues = nav_link(path: 'dashboard#merge_requests') do = link_to assigned_mrs_dashboard_path, title: 'Merge Requests', class: 'dashboard-shortcuts-merge_requests' do = navbar_icon('mr') - .nav-link-text + %span Merge Requests = nav_link(controller: :snippets) do = link_to dashboard_snippets_path, title: 'Snippets' do = icon('clipboard fw') - .nav-link-text + %span Snippets = nav_link(controller: :help) do = link_to help_path, title: 'Help' do = icon('question-circle fw') - .nav-link-text + %span Help = nav_link(html_options: {class: profile_tab_class}) do = link_to profile_path, title: 'Profile Settings', data: {placement: 'bottom'} do = icon('user fw') - .nav-link-text + %span Profile Settings diff --git a/app/views/layouts/nav/_explore.html.haml b/app/views/layouts/nav/_explore.html.haml index 46fcf1545f..3b40006a0c 100644 --- a/app/views/layouts/nav/_explore.html.haml +++ b/app/views/layouts/nav/_explore.html.haml @@ -2,20 +2,20 @@ = nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do = link_to explore_root_path, title: 'Projects' do = icon('bookmark fw') - .nav-link-text + %span Projects = nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do = link_to explore_groups_path, title: 'Groups' do = icon('group fw') - .nav-link-text + %span Groups = nav_link(controller: :snippets) do = link_to explore_snippets_path, title: 'Snippets' do = icon('clipboard fw') - .nav-link-text + %span Snippets = nav_link(controller: :help) do = link_to help_path, title: 'Help' do = icon('question-circle fw') - .nav-link-text + %span Help From 67a18f34e93ce8aa990794558371096f8f3a4e4c Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Fri, 10 Jun 2016 12:01:16 -0500 Subject: [PATCH 6/8] Fix safari logo loading animation safari bug --- app/assets/javascripts/application.js.coffee | 7 ------- app/assets/javascripts/logo.js.coffee | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index e5531c0283..69d4c4f5dd 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -162,13 +162,6 @@ $ -> $el.data('placement') || 'bottom' ) - $('.header-logo .home').tooltip( - placement: (_, el) -> - $el = $(el) - if $('.page-with-sidebar').hasClass('page-sidebar-collapsed') then 'right' else 'bottom' - container: 'body' - ) - # Form submitter $('.trigger-submit').on 'change', -> $(@).parents('form').submit() diff --git a/app/assets/javascripts/logo.js.coffee b/app/assets/javascripts/logo.js.coffee index d14b713923..9fdc27a978 100644 --- a/app/assets/javascripts/logo.js.coffee +++ b/app/assets/javascripts/logo.js.coffee @@ -47,4 +47,4 @@ $ -> # Make logo clickable as part of a workaround for Safari visited # link behaviour (See !2690). $('#logo').on 'click', -> - $('#js-shortcuts-home').get(0).click() + Turbolinks.visit('/') From 630aeb31eb7728789d1f7659ec0e12ea5a5fd59c Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Fri, 10 Jun 2016 12:27:05 -0500 Subject: [PATCH 7/8] Add back sidebar counters and username --- .../stylesheets/framework/gitlab-theme.scss | 6 +++++- app/assets/stylesheets/framework/header.scss | 1 + app/assets/stylesheets/framework/nav.scss | 1 - app/assets/stylesheets/framework/sidebar.scss | 17 ++++++++++++++--- app/helpers/nav_helper.rb | 8 +------- app/views/layouts/_page.html.haml | 6 ++++-- app/views/layouts/header/_default.html.haml | 2 +- app/views/layouts/nav/_admin.html.haml | 4 ++++ app/views/layouts/nav/_dashboard.html.haml | 3 +++ 9 files changed, 33 insertions(+), 15 deletions(-) diff --git a/app/assets/stylesheets/framework/gitlab-theme.scss b/app/assets/stylesheets/framework/gitlab-theme.scss index 245e8b285e..408d4a68e1 100644 --- a/app/assets/stylesheets/framework/gitlab-theme.scss +++ b/app/assets/stylesheets/framework/gitlab-theme.scss @@ -10,8 +10,12 @@ .page-with-sidebar { .collapse-nav a { - color: $white-light; + color: $color-light; background: $color; + + &:hover { + color: $white-light; + } } .sidebar-wrapper { diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index 824f5cd21b..c07b2753f4 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -28,6 +28,7 @@ header { height: $header-height; background-color: $background-color; border: none; + border-bottom: 1px solid $border-color; @media (max-width: $screen-xs-min) { padding: 0 16px; diff --git a/app/assets/stylesheets/framework/nav.scss b/app/assets/stylesheets/framework/nav.scss index 793d4e0479..ffdd8e7e0d 100644 --- a/app/assets/stylesheets/framework/nav.scss +++ b/app/assets/stylesheets/framework/nav.scss @@ -172,7 +172,6 @@ > form { display: inline-block; margin-top: -1px; - margin-bottom: 12px; } .icon-label { diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss index a96ce02230..b7ec3f70bf 100644 --- a/app/assets/stylesheets/framework/sidebar.scss +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -115,6 +115,12 @@ } } } + + .count { + float: right; + padding: 0 8px; + @include border-radius(6px); + } } .sidebar-subnav { @@ -131,9 +137,10 @@ position: fixed; top: 0; left: 0; - font-size: 13px; + padding: 5px 0; + font-size: 18px; background: transparent; - height: 40px; + height: 50px; text-align: center; line-height: 40px; transition-duration: .3s; @@ -157,7 +164,7 @@ width: 0; .nav-sidebar { - width: $sidebar_collapsed_width; + width: 0; li { width: auto; @@ -172,6 +179,10 @@ .collapse-nav a { width: 0; + + i { + display: none; + } } .sidebar-user { diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index 39831ce2e4..469accf314 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -36,13 +36,7 @@ module NavHelper end def nav_header_class - class_name = - if nav_menu_collapsed? - "header-collapsed" - else - "header-expanded" - end - class_name += " with-horizontal-nav" if defined?(nav) && nav + class_name = " with-horizontal-nav" if defined?(nav) && nav class_name end diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index c08aec959f..1a721b0c29 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -11,8 +11,10 @@ .collapse-nav = render partial: 'layouts/collapse_button' - if current_user - = link_to current_user, class: 'sidebar-user', title: "Profile", data: {user: current_user.username} do - = image_tag avatar_icon(current_user, 60), alt: 'Profile', class: 'avatar avatar s46' + = link_to current_user, class: 'sidebar-user', title: "Profile" do + = image_tag avatar_icon(current_user, 60), alt: 'Profile', class: 'avatar avatar s36' + .username + = current_user.username - if defined?(nav) && nav .layout-nav %div{ class: (container_class) } diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 184dac32e5..ad30a367fc 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -1,4 +1,4 @@ -%header.navbar.navbar-fixed-top.navbar-gitlab.header-collapsed +%header.navbar.navbar-fixed-top.navbar-gitlab.header-collapsed{ class: nav_header_class } %div{ class: fluid_layout ? "container-fluid" : "container-fluid" } .header-content %button.side-nav-toggle{type: 'button'} diff --git a/app/views/layouts/nav/_admin.html.haml b/app/views/layouts/nav/_admin.html.haml index 40c47487fa..f292730fe4 100644 --- a/app/views/layouts/nav/_admin.html.haml +++ b/app/views/layouts/nav/_admin.html.haml @@ -29,11 +29,13 @@ = icon('cog fw') %span Runners + %span.count= number_with_delimiter(Ci::Runner.count(:all)) = nav_link path: 'builds#index' do = link_to admin_builds_path, title: 'Builds' do = icon('link fw') %span Builds + %span.count= number_with_delimiter(Ci::Build.count(:all)) = nav_link(controller: :logs) do = link_to admin_logs_path, title: 'Logs' do = icon('file-text fw') @@ -88,6 +90,7 @@ = icon('exclamation-circle fw') %span Abuse Reports + %span.count= number_with_delimiter(AbuseReport.count(:all)) - if askimet_enabled? = nav_link(controller: :spam_logs) do @@ -95,6 +98,7 @@ = icon('exclamation-triangle fw') %span Spam Logs + %span.count= number_with_delimiter(SpamLog.count(:all)) = nav_link(controller: :application_settings, html_options: { class: 'separate-item'}) do = link_to admin_application_settings_path, title: 'Settings' do diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml index 5dc85ef0d9..18cae5bf87 100644 --- a/app/views/layouts/nav/_dashboard.html.haml +++ b/app/views/layouts/nav/_dashboard.html.haml @@ -9,6 +9,7 @@ = icon('bell fw') %span Todos + %span.count= number_with_delimiter(todos_pending_count) = nav_link(path: 'dashboard#activity') do = link_to activity_dashboard_path, class: 'dashboard-shortcuts-activity', title: 'Activity' do = navbar_icon('activity') @@ -29,11 +30,13 @@ = navbar_icon('issues') %span Issues + %span.count= number_with_delimiter(current_user.assigned_issues.opened.count) = nav_link(path: 'dashboard#merge_requests') do = link_to assigned_mrs_dashboard_path, title: 'Merge Requests', class: 'dashboard-shortcuts-merge_requests' do = navbar_icon('mr') %span Merge Requests + %span.count= number_with_delimiter(current_user.assigned_merge_requests.opened.count) = nav_link(controller: :snippets) do = link_to dashboard_snippets_path, title: 'Snippets' do = icon('clipboard fw') From 3e28d04cced2c417ee9144a17866e0cc2c910a6c Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Fri, 10 Jun 2016 15:08:13 -0500 Subject: [PATCH 8/8] Fix preferences_spec test --- app/assets/stylesheets/framework/header.scss | 4 ---- app/views/layouts/_page.html.haml | 2 +- spec/features/profiles/preferences_spec.rb | 8 +++++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index c07b2753f4..63996ea44f 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -116,10 +116,6 @@ header { padding-right: 0; } - @media (max-width: $screen-sm-max) { - padding-right: 30px; - } - .dropdown-menu { margin-top: -5px; } diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index 1a721b0c29..dbf425d46c 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -11,7 +11,7 @@ .collapse-nav = render partial: 'layouts/collapse_button' - if current_user - = link_to current_user, class: 'sidebar-user', title: "Profile" do + = link_to current_user, class: 'sidebar-user', title: "Profile", data: {user: current_user.username} do = image_tag avatar_icon(current_user, 60), alt: 'Profile', class: 'avatar avatar s36' .username = current_user.username diff --git a/spec/features/profiles/preferences_spec.rb b/spec/features/profiles/preferences_spec.rb index 8f645438cf..787bf42d04 100644 --- a/spec/features/profiles/preferences_spec.rb +++ b/spec/features/profiles/preferences_spec.rb @@ -54,7 +54,7 @@ describe 'Profile > Preferences', feature: true do end end - describe 'User changes their default dashboard' do + describe 'User changes their default dashboard', js: true do it 'creates a flash message' do select 'Starred Projects', from: 'user_dashboard' click_button 'Save' @@ -66,8 +66,10 @@ describe 'Profile > Preferences', feature: true do select 'Starred Projects', from: 'user_dashboard' click_button 'Save' - click_link 'Dashboard' - expect(page.current_path).to eq starred_dashboard_projects_path + allowing_for_delay do + find('#logo').click + expect(page.current_path).to eq starred_dashboard_projects_path + end click_link 'Your Projects' expect(page.current_path).to eq dashboard_projects_path