Added user avatar to header

Closes #18543
This commit is contained in:
Phil Hughes 2016-06-27 12:46:27 +01:00
parent a9dbd394a6
commit e7aa8315af
3 changed files with 30 additions and 11 deletions

View File

@ -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%;

View File

@ -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%;
}

View File

@ -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, title: 'Sign out'
- else
%li
%div