2018-05-27 03:25:04 +00:00
|
|
|
@extends('layouts.app')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="container notification-page" style="min-height: 60vh;">
|
2018-06-05 11:24:22 +00:00
|
|
|
<div class="col-12 col-md-8 offset-md-2">
|
2018-05-27 03:25:04 +00:00
|
|
|
<ul class="list-group">
|
|
|
|
|
2018-06-06 04:17:14 +00:00
|
|
|
@if($notifications->count() > 0)
|
2018-05-27 03:25:04 +00:00
|
|
|
@foreach($notifications as $notification)
|
|
|
|
<li class="list-group-item notification">
|
|
|
|
@switch($notification->action)
|
|
|
|
|
|
|
|
@case('like')
|
|
|
|
<span class="notification-icon pr-3">
|
|
|
|
<img src="{{$notification->actor->avatarUrl()}}" width="32px" class="rounded-circle">
|
|
|
|
</span>
|
|
|
|
<span class="notification-text">
|
|
|
|
{!! $notification->rendered !!}
|
|
|
|
<span class="text-muted notification-timestamp pl-1">{{$notification->created_at->diffForHumans(null, true, true, true)}}</span>
|
|
|
|
</span>
|
|
|
|
<span class="float-right notification-action">
|
2018-06-04 08:16:33 +00:00
|
|
|
@if($notification->item_id)
|
|
|
|
<a href="{{$notification->status->url()}}"><img src="{{$notification->status->thumb()}}" width="32px" height="32px"></a>
|
|
|
|
@endif
|
2018-05-27 03:25:04 +00:00
|
|
|
</span>
|
2018-05-31 21:58:42 +00:00
|
|
|
@break
|
2018-06-04 08:16:33 +00:00
|
|
|
|
2018-05-31 21:58:42 +00:00
|
|
|
@case('follow')
|
|
|
|
<span class="notification-icon pr-3">
|
|
|
|
<img src="{{$notification->actor->avatarUrl()}}" width="32px" class="rounded-circle">
|
|
|
|
</span>
|
|
|
|
<span class="notification-text">
|
|
|
|
{!! $notification->rendered !!}
|
|
|
|
<span class="text-muted notification-timestamp pl-1">{{$notification->created_at->diffForHumans(null, true, true, true)}}</span>
|
|
|
|
</span>
|
2018-06-01 14:12:10 +00:00
|
|
|
@if($notification->actor->followedBy(Auth::user()->profile) == false)
|
2018-05-31 21:58:42 +00:00
|
|
|
<span class="float-right notification-action">
|
|
|
|
<form class="follow-form" method="post" action="/i/follow" style="display: inline;" data-id="{{$notification->actor->id}}" data-action="follow">
|
|
|
|
@csrf
|
|
|
|
<input type="hidden" name="item" value="{{$notification->actor->id}}">
|
|
|
|
<button class="btn btn-primary font-weight-bold px-4 py-0" type="submit">Follow</button>
|
|
|
|
</form>
|
|
|
|
</span>
|
2018-06-01 14:12:10 +00:00
|
|
|
@endif
|
2018-05-31 21:58:42 +00:00
|
|
|
@break
|
2018-06-04 08:16:33 +00:00
|
|
|
|
|
|
|
@case('comment')
|
|
|
|
<span class="notification-icon pr-3">
|
|
|
|
<img src="{{$notification->actor->avatarUrl()}}" width="32px" class="rounded-circle">
|
|
|
|
</span>
|
|
|
|
<span class="notification-text">
|
|
|
|
{!! $notification->rendered !!}
|
|
|
|
<span class="text-muted notification-timestamp pl-1">{{$notification->created_at->diffForHumans(null, true, true, true)}}</span>
|
|
|
|
</span>
|
|
|
|
<span class="float-right notification-action">
|
|
|
|
@if($notification->item_id)
|
2018-06-06 18:42:24 +00:00
|
|
|
<a href="{{$notification->status->parent()->url()}}">
|
|
|
|
<div class="notification-image" style="background-image: url('{{$notification->status->parent()->thumb()}}')"></div>
|
|
|
|
</a>
|
2018-06-04 08:16:33 +00:00
|
|
|
@endif
|
|
|
|
</span>
|
|
|
|
@break
|
|
|
|
|
2018-05-27 03:25:04 +00:00
|
|
|
@endswitch
|
|
|
|
</li>
|
|
|
|
@endforeach
|
2018-06-06 04:17:14 +00:00
|
|
|
@else
|
|
|
|
<div class="mt-4">
|
|
|
|
<div class="alert alert-info font-weight-bold">No unread notifications found.</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
2018-05-27 03:25:04 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-06-01 14:12:10 +00:00
|
|
|
@endsection
|