Only show components section if we have some

This commit is contained in:
manavo 2014-11-24 17:37:49 +00:00
parent e82c7d6e57
commit 93b0d3af13
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,6 @@
* @return View
*/
public function showIndex() {
return View::make('index');
return View::make('index', ['components' => Component::all()]);
}
}

View File

@ -7,9 +7,10 @@
<p>You're logged in. This will be a link to the Dashboard.</p>
@endif
@if(count($components) > 0)
<div class='page-header'>
<ul class='list-group components'>
@foreach(Component::get() as $component)
@foreach($components as $component)
<li class='list-group-item component '>
<h4>{{ $component->name }} <small class='{{ $component->color }}'>{{ $component->humanStatus }}</small></h4>
<p>{{ $component->description }}</p>
@ -17,6 +18,7 @@
@endforeach
</ul>
</div>
@endif
@for($i=0; $i <= 7; $i++)
@include('incident', array('i', $i))