From 9cf719f74f7a273092f4e6377608ceb37ee0c218 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 13 Mar 2019 20:05:29 -0600 Subject: [PATCH] Update about page --- app/Http/Controllers/SiteController.php | 30 ++++++------------------- resources/views/layouts/anon.blade.php | 1 - resources/views/site/about.blade.php | 2 +- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/app/Http/Controllers/SiteController.php b/app/Http/Controllers/SiteController.php index bfb6f4890..d7f158dca 100644 --- a/app/Http/Controllers/SiteController.php +++ b/app/Http/Controllers/SiteController.php @@ -42,30 +42,14 @@ class SiteController extends Controller public function about() { - $res = Cache::remember('site:about', now()->addMinutes(120), function() { - $custom = Page::whereSlug('/site/about')->whereActive(true)->exists(); - if($custom) { - $stats = Cache::remember('site:about:stats', now()->addMinutes(60), function() { - return [ - 'posts' => Status::whereLocal(true)->count(), - 'users' => User::count(), - 'admin' => User::whereIsAdmin(true)->first() - ]; - }); - return View::make('site.about')->with('stats', $stats)->render(); - } else { - $stats = Cache::remember('site:about:stats', now()->addMinutes(60), function() { - return [ - 'posts' => Status::whereLocal(true)->count(), - 'users' => User::count(), - 'admin' => User::whereIsAdmin(true)->first() - ]; - }); - //return view('site.about', compact('stats')); - return View::make('site.about')->with('stats', $stats)->render(); - } + $stats = Cache::remember('site:about', now()->addMinutes(120), function() { + return [ + 'posts' => Status::whereLocal(true)->count(), + 'users' => User::count(), + 'admin' => User::whereIsAdmin(true)->first() + ]; }); - return $res; + return view('site.about', compact('stats')); } public function language() diff --git a/resources/views/layouts/anon.blade.php b/resources/views/layouts/anon.blade.php index a97bd5da4..e4901f6af 100644 --- a/resources/views/layouts/anon.blade.php +++ b/resources/views/layouts/anon.blade.php @@ -5,7 +5,6 @@ - diff --git a/resources/views/site/about.blade.php b/resources/views/site/about.blade.php index 76b8bd7a4..502e97cfc 100644 --- a/resources/views/site/about.blade.php +++ b/resources/views/site/about.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.app') +@extends('layouts.anon') @section('content')