Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2016-03-30 21:28:38 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
8b109bac1337a0ce2481275d157db113845c0404
8b109bac
1 parent
097d9c9f
Trimmed long names in header
Fixes #87
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
app/User.php
resources/assets/sass/_header.scss
resources/views/base.blade.php
app/User.php
View file @
8b109ba
...
...
@@ -162,4 +162,19 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
{
return
'/settings/users/'
.
$this
->
id
;
}
/**
* Get a shortened version of the user's name.
* @param int $chars
* @return string
*/
public
function
getShortName
(
$chars
=
8
)
{
if
(
strlen
(
$this
->
name
)
<=
$chars
)
return
$this
->
name
;
$splitName
=
explode
(
' '
,
$this
->
name
);
if
(
strlen
(
$splitName
[
0
])
<=
$chars
)
return
$splitName
[
0
];
return
''
;
}
}
...
...
resources/assets/sass/_header.scss
View file @
8b109ba
...
...
@@ -56,18 +56,14 @@ header {
padding-top
:
$-xxs
;
}
>
i
{
padding-top
:
$-xs
*
1
.2
;
padding-top
:
4px
;
font-size
:
18px
;
}
@include
smaller-than
(
$screen-md
)
{
padding-left
:
$-xs
;
.name
{
display
:
none
;
}
i
{
font-size
:
2em
;
padding-left
:
0
;
padding-top
:
0
;
}
}
}
@include
smaller-than
(
$screen-md
)
{
...
...
resources/views/base.blade.php
View file @
8b109ba
...
...
@@ -56,7 +56,7 @@
<div
class=
"dropdown-container"
dropdown
>
<span
class=
"user-name"
dropdown-toggle
>
<img
class=
"avatar"
src=
"{{$currentUser->getAvatar(30)}}"
alt=
"{{ $currentUser->name }}"
>
<span
class=
"name"
ng-non-bindable
>
{{ $currentUser->
name
}}
</span>
<i
class=
"zmdi zmdi-caret-down"
></i>
<span
class=
"name"
ng-non-bindable
>
{{ $currentUser->
getShortName(9)
}}
</span>
<i
class=
"zmdi zmdi-caret-down"
></i>
</span>
<ul>
<li>
...
...
Please
register
or
sign in
to post a comment