diff --git a/app/Mention.php b/app/Mention.php index 9600c32b0..3473c2924 100644 --- a/app/Mention.php +++ b/app/Mention.php @@ -14,7 +14,7 @@ class Mention extends Model public function status() { - return $this->belongsTo(Status::class); + return $this->belongsTo(Status::class, 'status_id', 'id'); } public function toText() diff --git a/resources/views/account/activity.blade.php b/resources/views/account/activity.blade.php index d2fb9b426..dec6e16a8 100644 --- a/resources/views/account/activity.blade.php +++ b/resources/views/account/activity.blade.php @@ -19,7 +19,7 @@ {{$notification->created_at->diffForHumans(null, true, true, true)}} - @if($notification->item_id) + @if($notification->item_id && $notification->item_type == 'App\Status') @endif @@ -70,10 +70,16 @@ {{$notification->created_at->diffForHumans(null, true, true, true)}} - @if($notification->item_id) + @if($notification->item_id && $notification->item_type === 'App\Status') + @if(is_null($notification->status->in_reply_to_id))
+ @else + +
+
+ @endif @endif
@break @@ -81,12 +87,20 @@ @endswitch @endforeach + + +
+ {{$notifications->links()}} +
@else
No unread notifications found.
@endif - @endsection + +@push('scripts') + +@endpush diff --git a/webpack.mix.js b/webpack.mix.js index 27959585c..b99329cd3 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -12,6 +12,7 @@ let mix = require('laravel-mix'); */ mix.js('resources/assets/js/app.js', 'public/js') + .js('resources/assets/js/activity.js', 'public/js') .js('resources/assets/js/timeline.js', 'public/js') .sass('resources/assets/sass/app.scss', 'public/css') .version();