diff --git a/app/Http/Controllers/SiteController.php b/app/Http/Controllers/SiteController.php index d1274b9dc..d7ab96480 100644 --- a/app/Http/Controllers/SiteController.php +++ b/app/Http/Controllers/SiteController.php @@ -68,7 +68,14 @@ class SiteController extends Controller public function about() { - return view('site.about'); + $stats = Cache::remember('site:about:stats', 1440, function() { + return [ + 'posts' => Status::whereLocal(true)->count(), + 'users' => User::count(), + 'admin' => User::whereIsAdmin(true)->first() + ]; + }); + return view('site.about', compact('stats')); } public function language() diff --git a/resources/views/layouts/partial/footer.blade.php b/resources/views/layouts/partial/footer.blade.php index b2a1e6a4c..0dab40fdd 100644 --- a/resources/views/layouts/partial/footer.blade.php +++ b/resources/views/layouts/partial/footer.blade.php @@ -8,7 +8,7 @@ {{__('site.privacy')}} API {{__('site.language')}} - Powered by PixelFed + Powered by PixelFed

diff --git a/resources/views/site/about.blade.php b/resources/views/site/about.blade.php index 765b775b8..76b8bd7a4 100644 --- a/resources/views/site/about.blade.php +++ b/resources/views/site/about.blade.php @@ -9,7 +9,7 @@
-
+
@@ -33,6 +33,34 @@
+
+
+
+

{{$stats['posts']}}

+

Posts

+
+
+ +
+
+

{{$stats['users']}}

+

Users

+
+
+ + @if($stats['admin']) +
+
+

+ + @{{$stats['admin']->username}} + +

+

Instance Admin

+
+
+ @endif +
diff --git a/resources/views/timeline/template.blade.php b/resources/views/timeline/template.blade.php index a7db3e1f8..e57f349f7 100644 --- a/resources/views/timeline/template.blade.php +++ b/resources/views/timeline/template.blade.php @@ -117,7 +117,7 @@ API

- Powered by PixelFed + Powered by PixelFed

@@ -129,5 +129,4 @@ @push('scripts') - @endpush \ No newline at end of file