Enhanced how activities are shown on items in recycle bin

This commit is contained in:
Dan Brown 2020-11-07 14:28:50 +00:00
parent ec3aeb3315
commit df10b508d8
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 9 additions and 2 deletions

View File

@ -3,6 +3,7 @@
use BookStack\Auth\Permissions\PermissionService;
use BookStack\Auth\User;
use BookStack\Entities\Entity;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
@ -104,7 +105,9 @@ class ActivityService
$activity = $this->permissionService
->filterRestrictedEntityRelations($query, 'activities', 'entity_id', 'entity_type')
->orderBy('created_at', 'desc')
->with(['entity', 'user.avatar'])
->with(['entity' => function (Relation $query) {
$query->withTrashed();
}, 'user.avatar'])
->skip($count * ($page - 1))
->take($count)
->get();

View File

@ -16,10 +16,14 @@
{{ $activity->getText() }}
@if($activity->entity)
@if($activity->entity && is_null($activity->entity->deleted_at))
<a href="{{ $activity->entity->getUrl() }}">{{ $activity->entity->name }}</a>
@endif
@if($activity->entity && !is_null($activity->entity->deleted_at))
"{{ $activity->entity->name }}"
@endif
@if($activity->extra) "{{ $activity->extra }}" @endif
<br>