mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
Add pagination to notifications
This commit is contained in:
parent
a39f9600b9
commit
b63b8353ad
3 changed files with 19 additions and 4 deletions
|
@ -14,7 +14,7 @@ class Mention extends Model
|
||||||
|
|
||||||
public function status()
|
public function status()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Status::class);
|
return $this->belongsTo(Status::class, 'status_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toText()
|
public function toText()
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<span class="text-muted notification-timestamp pl-1">{{$notification->created_at->diffForHumans(null, true, true, true)}}</span>
|
<span class="text-muted notification-timestamp pl-1">{{$notification->created_at->diffForHumans(null, true, true, true)}}</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="float-right notification-action">
|
<span class="float-right notification-action">
|
||||||
@if($notification->item_id)
|
@if($notification->item_id && $notification->item_type == 'App\Status')
|
||||||
<a href="{{$notification->status->url()}}"><img src="{{$notification->status->thumb()}}" width="32px" height="32px"></a>
|
<a href="{{$notification->status->url()}}"><img src="{{$notification->status->thumb()}}" width="32px" height="32px"></a>
|
||||||
@endif
|
@endif
|
||||||
</span>
|
</span>
|
||||||
|
@ -70,10 +70,16 @@
|
||||||
<span class="text-muted notification-timestamp pl-1">{{$notification->created_at->diffForHumans(null, true, true, true)}}</span>
|
<span class="text-muted notification-timestamp pl-1">{{$notification->created_at->diffForHumans(null, true, true, true)}}</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="float-right notification-action">
|
<span class="float-right notification-action">
|
||||||
@if($notification->item_id)
|
@if($notification->item_id && $notification->item_type === 'App\Status')
|
||||||
|
@if(is_null($notification->status->in_reply_to_id))
|
||||||
<a href="{{$notification->status->url()}}">
|
<a href="{{$notification->status->url()}}">
|
||||||
<div class="notification-image" style="background-image: url('{{$notification->status->thumb()}}')"></div>
|
<div class="notification-image" style="background-image: url('{{$notification->status->thumb()}}')"></div>
|
||||||
</a>
|
</a>
|
||||||
|
@else
|
||||||
|
<a href="{{$notification->status->parent()->url()}}">
|
||||||
|
<div class="notification-image" style="background-image: url('{{$notification->status->parent()->thumb()}}')"></div>
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
@endif
|
@endif
|
||||||
</span>
|
</span>
|
||||||
@break
|
@break
|
||||||
|
@ -81,12 +87,20 @@
|
||||||
@endswitch
|
@endswitch
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-center my-4">
|
||||||
|
{{$notifications->links()}}
|
||||||
|
</div>
|
||||||
@else
|
@else
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<div class="alert alert-info font-weight-bold">No unread notifications found.</div>
|
<div class="alert alert-info font-weight-bold">No unread notifications found.</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script type="text/javascript" src="{{mix('js/activity.js')}}"></script>
|
||||||
|
@endpush
|
||||||
|
|
1
webpack.mix.js
vendored
1
webpack.mix.js
vendored
|
@ -12,6 +12,7 @@ let mix = require('laravel-mix');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
mix.js('resources/assets/js/app.js', 'public/js')
|
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')
|
.js('resources/assets/js/timeline.js', 'public/js')
|
||||||
.sass('resources/assets/sass/app.scss', 'public/css')
|
.sass('resources/assets/sass/app.scss', 'public/css')
|
||||||
.version();
|
.version();
|
||||||
|
|
Loading…
Reference in a new issue