Showing
9 changed files
with
87 additions
and
21 deletions
| ... | @@ -32,4 +32,16 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon | ... | @@ -32,4 +32,16 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon |
| 32 | * @var array | 32 | * @var array |
| 33 | */ | 33 | */ |
| 34 | protected $hidden = ['password', 'remember_token']; | 34 | protected $hidden = ['password', 'remember_token']; |
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * Returns the user's avatar, | ||
| 38 | + * Uses Gravatar as the avatar service. | ||
| 39 | + * @param int $size | ||
| 40 | + * @return string | ||
| 41 | + */ | ||
| 42 | + public function getAvatar($size = 50) | ||
| 43 | + { | ||
| 44 | + $emailHash = md5(strtolower(trim($this->email))); | ||
| 45 | + return '//www.gravatar.com/avatar/' . $emailHash . '?s=' . $size . '&d=identicon'; | ||
| 46 | + } | ||
| 35 | } | 47 | } | ... | ... |
| ... | @@ -46,7 +46,7 @@ header { | ... | @@ -46,7 +46,7 @@ header { |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | .logo-container { | 48 | .logo-container { |
| 49 | - padding: $-l $-s; | 49 | + padding: $-l $-s 0 $-s; |
| 50 | color: #CCC; | 50 | color: #CCC; |
| 51 | .logo { | 51 | .logo { |
| 52 | display: block; | 52 | display: block; |
| ... | @@ -59,6 +59,15 @@ header { | ... | @@ -59,6 +59,15 @@ header { |
| 59 | } | 59 | } |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | +.user-overview { | ||
| 63 | + margin-top: $-m; | ||
| 64 | + .user-name { | ||
| 65 | + display: inline-block; | ||
| 66 | + vertical-align: top; | ||
| 67 | + padding: $-m $-s; | ||
| 68 | + } | ||
| 69 | +} | ||
| 70 | + | ||
| 62 | 71 | ||
| 63 | .search-box { | 72 | .search-box { |
| 64 | input { | 73 | input { |
| ... | @@ -432,4 +441,15 @@ body.dragging, body.dragging * { | ... | @@ -432,4 +441,15 @@ body.dragging, body.dragging * { |
| 432 | padding: $-s 0; | 441 | padding: $-s 0; |
| 433 | color: #888; | 442 | color: #888; |
| 434 | border-bottom: 1px solid #EEE; | 443 | border-bottom: 1px solid #EEE; |
| 444 | + font-size: 0.9em; | ||
| 445 | + .left { | ||
| 446 | + float: left; | ||
| 447 | + } | ||
| 448 | + .left + .right { | ||
| 449 | + margin-left: 30px + $-s; | ||
| 450 | + } | ||
| 451 | +} | ||
| 452 | + | ||
| 453 | +.avatar { | ||
| 454 | + border-radius: 100%; | ||
| 435 | } | 455 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -37,7 +37,12 @@ | ... | @@ -37,7 +37,12 @@ |
| 37 | <div class="padded row clearfix"> | 37 | <div class="padded row clearfix"> |
| 38 | <div class="col-md-12 logo-container"> | 38 | <div class="col-md-12 logo-container"> |
| 39 | <a href="/" class="logo">BookStack</a> | 39 | <a href="/" class="logo">BookStack</a> |
| 40 | - <div><i class="zmdi zmdi-account"></i> {{ Auth::user()->name }}</div> | 40 | + <div class="user-overview"> |
| 41 | + <img class="avatar" src="{{Auth::user()->getAvatar(50)}}" alt="{{ Auth::user()->name }}"> | ||
| 42 | + <span class="user-name"> | ||
| 43 | + {{ Auth::user()->name }} | ||
| 44 | + </span> | ||
| 45 | + </div> | ||
| 41 | </div> | 46 | </div> |
| 42 | </div> | 47 | </div> |
| 43 | </header> | 48 | </header> | ... | ... |
| ... | @@ -20,14 +20,15 @@ | ... | @@ -20,14 +20,15 @@ |
| 20 | <table class="table"> | 20 | <table class="table"> |
| 21 | <tr> | 21 | <tr> |
| 22 | <th>Name</th> | 22 | <th>Name</th> |
| 23 | - <th>Created By</th> | 23 | + <th colspan="2">Created By</th> |
| 24 | <th>Revision Date</th> | 24 | <th>Revision Date</th> |
| 25 | <th>Actions</th> | 25 | <th>Actions</th> |
| 26 | </tr> | 26 | </tr> |
| 27 | @foreach($page->revisions as $revision) | 27 | @foreach($page->revisions as $revision) |
| 28 | <tr> | 28 | <tr> |
| 29 | <td>{{$revision->name}}</td> | 29 | <td>{{$revision->name}}</td> |
| 30 | - <td>{{$revision->createdBy->name}}</td> | 30 | + <td style="line-height: 0;"><img class="avatar" src="{{ $revision->createdBy->getAvatar(30) }}" alt="{{$revision->createdBy->name}}"></td> |
| 31 | + <td> {{$revision->createdBy->name}}</td> | ||
| 31 | <td><small>{{$revision->created_at->format('jS F, Y H:i:s')}} ({{$revision->created_at->diffForHumans()}})</small></td> | 32 | <td><small>{{$revision->created_at->format('jS F, Y H:i:s')}} ({{$revision->created_at->diffForHumans()}})</small></td> |
| 32 | <td> | 33 | <td> |
| 33 | <a href="{{$revision->getUrl()}}" target="_blank">Preview</a> | 34 | <a href="{{$revision->getUrl()}}" target="_blank">Preview</a> | ... | ... |
| 1 | 1 | ||
| 2 | {{--Requires an Activity item with the name $activity passed in--}} | 2 | {{--Requires an Activity item with the name $activity passed in--}} |
| 3 | 3 | ||
| 4 | -@if($activity->user) {{$activity->user->name}} @endif | 4 | +@if($activity->user) |
| 5 | + <div class="left"> | ||
| 6 | + <img class="avatar" src="{{ $activity->user->getAvatar(30) }}" alt="{{$activity->user->name}}"> | ||
| 7 | + </div> | ||
| 8 | +@endif | ||
| 5 | 9 | ||
| 6 | -{{ $activity->getText() }} | 10 | +<div class="right"> |
| 11 | + @if($activity->user) | ||
| 12 | + {{$activity->user->name}} | ||
| 13 | + @endif | ||
| 7 | 14 | ||
| 8 | -@if($activity->entity()) | 15 | + {{ $activity->getText() }} |
| 9 | - <a href="{{ $activity->entity()->getUrl() }}">{{ $activity->entity()->name }}</a> | 16 | + |
| 10 | -@endif | 17 | + @if($activity->entity()) |
| 18 | + <a href="{{ $activity->entity()->getUrl() }}">{{ $activity->entity()->name }}</a> | ||
| 19 | + @endif | ||
| 11 | 20 | ||
| 12 | -@if($activity->extra) "{{$activity->extra}}" @endif | 21 | + @if($activity->extra) "{{$activity->extra}}" @endif |
| 13 | 22 | ||
| 14 | -<br> | 23 | + <br> |
| 15 | 24 | ||
| 16 | -<span class="text-muted"><small><i class="zmdi zmdi-time"></i>{{ $activity->created_at->diffForHumans() }}</small></span> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 25 | + <span class="text-muted"><small><i class="zmdi zmdi-time"></i>{{ $activity->created_at->diffForHumans() }}</small></span> | ||
| 26 | +</div> | ... | ... |
| ... | @@ -10,7 +10,7 @@ | ... | @@ -10,7 +10,7 @@ |
| 10 | <form action="/users/{{$user->id}}" method="POST"> | 10 | <form action="/users/{{$user->id}}" method="POST"> |
| 11 | {!! csrf_field() !!} | 11 | {!! csrf_field() !!} |
| 12 | <input type="hidden" name="_method" value="DELETE"> | 12 | <input type="hidden" name="_method" value="DELETE"> |
| 13 | - <a href="/user/{{$user->id}}" class="button muted">Cancel</a> | 13 | + <a href="/users/{{$user->id}}" class="button muted">Cancel</a> |
| 14 | <button type="submit" class="button neg">Confirm</button> | 14 | <button type="submit" class="button neg">Confirm</button> |
| 15 | </form> | 15 | </form> |
| 16 | </div> | 16 | </div> | ... | ... |
| ... | @@ -12,14 +12,29 @@ | ... | @@ -12,14 +12,29 @@ |
| 12 | </div> | 12 | </div> |
| 13 | </div> | 13 | </div> |
| 14 | 14 | ||
| 15 | - <div class="page-content"> | 15 | + <div class="row"> |
| 16 | - <h1>Edit User</h1> | 16 | + <div class="page-content"> |
| 17 | - | 17 | + <div class="row"> |
| 18 | - <form action="/users/{{$user->id}}" method="post"> | 18 | + <div class="col-md-6"> |
| 19 | - {!! csrf_field() !!} | 19 | + <h1>Edit User</h1> |
| 20 | - <input type="hidden" name="_method" value="put"> | 20 | + <form action="/users/{{$user->id}}" method="post"> |
| 21 | - @include('users/form', ['model' => $user]) | 21 | + {!! csrf_field() !!} |
| 22 | - </form> | 22 | + <input type="hidden" name="_method" value="put"> |
| 23 | + @include('users/form', ['model' => $user]) | ||
| 24 | + </form> | ||
| 25 | + </div> | ||
| 26 | + <div class="col-md-6"> | ||
| 27 | + <h1> </h1> | ||
| 28 | + <div class="shaded padded margin-top"> | ||
| 29 | + <p> | ||
| 30 | + <img class="avatar" src="{{ $user->getAvatar(80) }}" alt="{{ $user->name }}"> | ||
| 31 | + </p> | ||
| 32 | + <p class="text-muted">You can change your profile picture at <a href="http://en.gravatar.com/">Gravatar</a>.</p> | ||
| 33 | + </div> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 23 | </div> | 37 | </div> |
| 24 | 38 | ||
| 39 | + | ||
| 25 | @stop | 40 | @stop | ... | ... |
| ... | @@ -18,11 +18,13 @@ | ... | @@ -18,11 +18,13 @@ |
| 18 | <h1>Users</h1> | 18 | <h1>Users</h1> |
| 19 | <table class="table"> | 19 | <table class="table"> |
| 20 | <tr> | 20 | <tr> |
| 21 | + <th></th> | ||
| 21 | <th>Name</th> | 22 | <th>Name</th> |
| 22 | <th>Email</th> | 23 | <th>Email</th> |
| 23 | </tr> | 24 | </tr> |
| 24 | @foreach($users as $user) | 25 | @foreach($users as $user) |
| 25 | <tr> | 26 | <tr> |
| 27 | + <td style="line-height: 0;"><img class="avatar" src="{{$user->getAvatar(40)}}" alt="{{$user->name}}"></td> | ||
| 26 | <td><a href="/users/{{$user->id}}">{{$user->name}}</a></td> | 28 | <td><a href="/users/{{$user->id}}">{{$user->name}}</a></td> |
| 27 | <td>{{$user->email}}</td> | 29 | <td>{{$user->email}}</td> |
| 28 | </tr> | 30 | </tr> | ... | ... |
-
Please register or sign in to post a comment