Skip to content

Commit

Permalink
make sidebar notifcation have a picture, and nicer looking
Browse files Browse the repository at this point in the history
  • Loading branch information
Bottelet committed Jul 9, 2017
1 parent 5bb79db commit a29375c
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 27 deletions.
7 changes: 7 additions & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Cache;
use Zizaco\Entrust\Traits\EntrustUserTrait;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Models\Setting;

class User extends Authenticatable
{
Expand Down Expand Up @@ -92,4 +93,10 @@ public function moveClients($user_id)
$client->save();
}
}

public function getAvatarattribute()
{
$setting = Setting::first();
return $this->image_path ? 'images/' . $setting->company . '/' . $this->image_path : 'images/default_avatar.jpg';
}
}
166 changes: 153 additions & 13 deletions public/css/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/css/app.css.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/views/layouts/master.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<a href="{{ route('notification.read', ['id' => $notification->id]) }}" onClick="postRead({{ $notification->id }})">
<li>
<img src="http://placekitten.com/g/300/300" class="notification-profile-image">
<img src="/{{ auth()->user()->avatar }}" class="notification-profile-image">
<p>{{ $notification->data['message']}}</p></li>
</a>
@endforeach
Expand Down
9 changes: 1 addition & 8 deletions resources/views/partials/userheader.blade.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
<div class="col-lg-6">
<div class="profilepic"><img class="profilepicsize"
@if($contact->image_path != "")
src="../images/{{$companyname}}/{{$contact->image_path}}"
@else
src="../images/default_avatar.jpg"
@endif />
</div>

<div class="profilepic"><img class="profilepicsize" src="../{{ $contact->avatar }}" /></div>
<h1>{{ $contact->nameAndDepartment }} </h1>


<!--MAIL-->
<p><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
<a href="mailto:{{ $contact->email }}">{{ $contact->email }}</a></p>
Expand Down

0 comments on commit a29375c

Please sign in to comment.