Showing
3 changed files
with
18 additions
and
7 deletions
| ... | @@ -162,4 +162,19 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon | ... | @@ -162,4 +162,19 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon |
| 162 | { | 162 | { |
| 163 | return '/settings/users/' . $this->id; | 163 | return '/settings/users/' . $this->id; |
| 164 | } | 164 | } |
| 165 | + | ||
| 166 | + /** | ||
| 167 | + * Get a shortened version of the user's name. | ||
| 168 | + * @param int $chars | ||
| 169 | + * @return string | ||
| 170 | + */ | ||
| 171 | + public function getShortName($chars = 8) | ||
| 172 | + { | ||
| 173 | + if (strlen($this->name) <= $chars) return $this->name; | ||
| 174 | + | ||
| 175 | + $splitName = explode(' ', $this->name); | ||
| 176 | + if (strlen($splitName[0]) <= $chars) return $splitName[0]; | ||
| 177 | + | ||
| 178 | + return ''; | ||
| 179 | + } | ||
| 165 | } | 180 | } | ... | ... |
| ... | @@ -56,18 +56,14 @@ header { | ... | @@ -56,18 +56,14 @@ header { |
| 56 | padding-top: $-xxs; | 56 | padding-top: $-xxs; |
| 57 | } | 57 | } |
| 58 | > i { | 58 | > i { |
| 59 | - padding-top: $-xs*1.2; | 59 | + padding-top: 4px; |
| 60 | + font-size: 18px; | ||
| 60 | } | 61 | } |
| 61 | @include smaller-than($screen-md) { | 62 | @include smaller-than($screen-md) { |
| 62 | padding-left: $-xs; | 63 | padding-left: $-xs; |
| 63 | .name { | 64 | .name { |
| 64 | display: none; | 65 | display: none; |
| 65 | } | 66 | } |
| 66 | - i { | ||
| 67 | - font-size: 2em; | ||
| 68 | - padding-left: 0; | ||
| 69 | - padding-top: 0; | ||
| 70 | - } | ||
| 71 | } | 67 | } |
| 72 | } | 68 | } |
| 73 | @include smaller-than($screen-md) { | 69 | @include smaller-than($screen-md) { | ... | ... |
| ... | @@ -56,7 +56,7 @@ | ... | @@ -56,7 +56,7 @@ |
| 56 | <div class="dropdown-container" dropdown> | 56 | <div class="dropdown-container" dropdown> |
| 57 | <span class="user-name" dropdown-toggle> | 57 | <span class="user-name" dropdown-toggle> |
| 58 | <img class="avatar" src="{{$currentUser->getAvatar(30)}}" alt="{{ $currentUser->name }}"> | 58 | <img class="avatar" src="{{$currentUser->getAvatar(30)}}" alt="{{ $currentUser->name }}"> |
| 59 | - <span class="name" ng-non-bindable>{{ $currentUser->name }}</span> <i class="zmdi zmdi-caret-down"></i> | 59 | + <span class="name" ng-non-bindable>{{ $currentUser->getShortName(9) }}</span> <i class="zmdi zmdi-caret-down"></i> |
| 60 | </span> | 60 | </span> |
| 61 | <ul> | 61 | <ul> |
| 62 | <li> | 62 | <li> | ... | ... |
-
Please register or sign in to post a comment