diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 00111dfa70662a3fec984118e1b2cc27efe14b51..2a90a1fef370769fc093185c88ca5110f7d87373 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -20,7 +20,8 @@ } .open { - .dropdown-menu { + .dropdown-menu, + .dropdown-menu-nav { display: block; } @@ -66,7 +67,8 @@ } } -.dropdown-menu { +.dropdown-menu, +.dropdown-menu-nav { display: none; position: absolute; top: 100%; @@ -77,7 +79,7 @@ margin-bottom: 0; font-size: 15px; font-weight: normal; - padding: 10px 0; + padding: 8px 0; background-color: $dropdown-bg; border: 1px solid $dropdown-border-color; border-radius: $border-radius-base; @@ -101,12 +103,12 @@ li { text-align: left; list-style: none; - padding: 0 10px; + padding: 0 8px; } .divider { height: 1px; - margin: 8px 10px; + margin: 8px; padding: 0; background-color: $dropdown-divider-color; } @@ -122,7 +124,7 @@ a { display: block; position: relative; - padding: 5px 10px; + padding: 5px 8px; color: $dropdown-link-color; line-height: initial; text-overflow: ellipsis; diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index c32ce5195c6fffdc0e618ecca09deb4c1634ef53..0c607071840d21de2639bf1ad77b8573fe905de8 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -60,7 +60,7 @@ header { margin: ($header-height - 28) / 2 0; margin-left: 10px; height: 28px; - width: 28px; + min-width: 28px; line-height: 28px; text-align: center; @@ -241,14 +241,23 @@ header { .navbar-collapse { padding-left: 5px; - li { + .nav > li { display: table-cell; width: 1%; - - a { - margin-left: 8px !important; - } } } } } + +.header-user { + .dropdown-menu-nav { + width: 140px; + margin-top: -5px; + } +} + +.header-user-avatar { + float: left; + margin-right: 5px; + border-radius: 50%; +} diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 1a39572ac3cf044d17cc9f417bf27d688fc4eeed..d59a93a8fd79dae33336a26164c1e1fe384da219 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -38,9 +38,17 @@ = link_to sherlock_transactions_path, title: 'Sherlock Transactions', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('tachometer fw') - %li - = link_to destroy_user_session_path, class: 'logout', method: :delete, title: 'Sign out', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do - = icon('sign-out') + %li.header-user.dropdown + = link_to current_user, class: "header-user-dropdown-toggle", data: { toggle: "dropdown" } do + = image_tag avatar_icon(current_user, 26), width: 26, height: 26, class: "header-user-avatar" + %span.caret + .dropdown-menu-nav.dropdown-menu-align-right + %ul + %li + = link_to "Profile", current_user + %li.divider + %li + = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link", title: 'Sign out' - else %li %div diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature index 2259b7125c48d58670d7690f16837908d7ec1376..358e622b73686afb5bbba1b560257be4932d67f4 100644 --- a/features/project/issues/issues.feature +++ b/features/project/issues/issues.feature @@ -219,8 +219,8 @@ Feature: Project Issues When I click button "Unsubscribe" Then I should see that I am unsubscribed + @javascript Scenario: I submit new unassigned issue as guest - Given I logout Given public project "Community" When I visit project "Community" page And I visit project "Community" issues page diff --git a/features/search.feature b/features/search.feature index a946a83652540b5aa91104595f50ef62dbac8a74..818ef436db6ac2c083eb3b902876b8f0ddcb6e12 100644 --- a/features/search.feature +++ b/features/search.feature @@ -73,13 +73,15 @@ Feature: Search Scenario: I logout and should see project I am looking for Given project "Shop" is public - And I logout + And I logout directly + And I visit dashboard search page And I search for "Sho" Then I should see "Shop" project link Scenario: I logout and should see issues I am looking for Given project "Shop" is public - And I logout + And I logout directly + And I visit dashboard search page And project has issues When I search for "Foo" And I click "Issues" link @@ -88,7 +90,7 @@ Feature: Search Scenario: I logout and should see project code I am looking for Given project "Shop" is public - And I logout + And I logout directly When I visit project "Shop" page And I search for "rspec" on project page Then I should see code results for project "Shop" diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb index 7a0f078c72b2e2911a39ab2389313f1d3ad61dcc..ffdf2bb0a8ac56c3ae534c43203e0cbd2f871085 100644 --- a/spec/support/login_helpers.rb +++ b/spec/support/login_helpers.rb @@ -39,7 +39,8 @@ module LoginHelpers # Requires Javascript driver. def logout - find(:css, ".fa.fa-sign-out").click + find(".header-user-dropdown-toggle").click + click_link "Sign out" end # Logout without JavaScript driver