From 6c03599d4473ab84f89f3a509cd9b32666cb0084 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 3 Dec 2018 20:47:57 -0700 Subject: [PATCH 1/3] Fixes #597 --- resources/views/layouts/partial/footer.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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

From 1518cce4fcfaf9b80ff4808f10a787590404e925 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 3 Dec 2018 21:52:01 -0700 Subject: [PATCH 2/3] Update timeline footer, related to #597 --- resources/views/timeline/template.blade.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 From 794cf80c1576572fda7c7f43415e543fb99e8217 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 4 Dec 2018 13:46:07 -0700 Subject: [PATCH 3/3] Update about page with stats and instance admin --- app/Http/Controllers/SiteController.php | 9 +++++++- resources/views/site/about.blade.php | 30 ++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) 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/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 +