From 93b0d3af13b3e24ac03375f29cc8e3fda18fb99f Mon Sep 17 00:00:00 2001 From: manavo Date: Mon, 24 Nov 2014 17:37:49 +0000 Subject: [PATCH 1/2] Only show components section if we have some --- app/controllers/HomeController.php | 2 +- app/views/index.blade.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php index b09daa15..f325c063 100644 --- a/app/controllers/HomeController.php +++ b/app/controllers/HomeController.php @@ -6,6 +6,6 @@ * @return View */ public function showIndex() { - return View::make('index'); + return View::make('index', ['components' => Component::all()]); } } diff --git a/app/views/index.blade.php b/app/views/index.blade.php index 0e12f0ac..85ab1be3 100644 --- a/app/views/index.blade.php +++ b/app/views/index.blade.php @@ -7,9 +7,10 @@

You're logged in. This will be a link to the Dashboard.

@endif + @if(count($components) > 0) + @endif @for($i=0; $i <= 7; $i++) @include('incident', array('i', $i)) From 301eb264ec5e7dd8ec16f913e0935cfbb3d9eec6 Mon Sep 17 00:00:00 2001 From: manavo Date: Mon, 24 Nov 2014 17:38:35 +0000 Subject: [PATCH 2/2] Better counting of total (don't convert collection to array) --- app/views/index.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/index.blade.php b/app/views/index.blade.php index 85ab1be3..51ff5655 100644 --- a/app/views/index.blade.php +++ b/app/views/index.blade.php @@ -7,7 +7,7 @@

You're logged in. This will be a link to the Dashboard.

@endif - @if(count($components) > 0) + @if($components->count() > 0)