]> BookStack Code Mirror - bookstack/commitdiff
enh(recently updated): show updatedBy and updated_at 3177/head
authorjulesdevops <redacted>
Tue, 18 Jan 2022 21:08:01 +0000 (22:08 +0100)
committerjulesdevops <redacted>
Wed, 19 Jan 2022 20:49:45 +0000 (21:49 +0100)
app/Http/Controllers/PageController.php
resources/views/entities/list-item.blade.php

index fc4b463e15f421fcd386ba054a6ae7919d09cd92..41525ac3022ac453f75c56d04b018062ea7ae38d 100644 (file)
@@ -364,15 +364,17 @@ class PageController extends Controller
      */
     public function showRecentlyUpdated()
     {
-        $pages = Page::visible()->orderBy('updated_at', 'desc')
+        $pages = Page::visible()->with('updatedBy')
+            ->orderBy('updated_at', 'desc')
             ->paginate(20)
             ->setPath(url('/pages/recently-updated'));
 
         $this->setPageTitle(trans('entities.recently_updated_pages'));
 
         return view('common.detailed-listing-paginated', [
-            'title'    => trans('entities.recently_updated_pages'),
-            'entities' => $pages,
+            'title'         => trans('entities.recently_updated_pages'),
+            'entities'      => $pages,
+            'showUpdatedBy' => true,
         ]);
     }
 
index aa4f6c1e8ec76507cd6808393d9fe04d6762ef32..44e06753d507a3df4ff17699b9fb0fda68558af4 100644 (file)
     </div>
 @endif
 
+@if(($showUpdatedBy ?? false) && $entity->relationLoaded('updatedBy') && $entity->updatedBy)
+    <small title="{{ $entity->updated_at->toDayDateTimeString() }}">
+        {!! trans('entities.meta_updated_name', [
+            'timeLength' => $entity->updated_at->diffForHumans(),
+            'user' => e($entity->updatedBy->name)
+        ]) !!}
+    </small>
+@endif
+
 @endcomponent
\ No newline at end of file