Include changes required within View Composers

This commit is contained in:
James Brooks
2014-11-17 00:10:02 +00:00
parent 57c64f6fbe
commit 7ef95ca3aa
3 changed files with 32 additions and 24 deletions

View File

@@ -79,3 +79,5 @@ App::down(function()
*/ */
require app_path().'/filters.php'; require app_path().'/filters.php';
require app_path().'/view-composers.php';

View File

@@ -1,15 +1,15 @@
<?php <?php
$incidentDate = Carbon::now()->subDays($i); $incidentDate = Carbon::now()->subDays($i);
$incidents = Incident::whereRaw('DATE(created_at) = "' . $incidentDate->format('Y-m-d') . '"')->get(); $incidents = Incident::whereRaw('DATE(created_at) = "' . $incidentDate->format('Y-m-d') . '"')->orderBy('created_at', 'desc')->get();
?> ?>
<li> <li class='list-group-item'>
<h1>{{ $incidentDate->format('jS M, Y') }}</h1> <h1>{{ $incidentDate->format('jS M, Y') }}</h1>
<ul> <ul class='list-group'>
@if($incidents->count() === 0) @if($incidents->count() === 0)
<li>No incidents reported.</li> <li class='list-group-item'>No incidents reported.</li>
@else @else
@foreach($incidents as $incident) @foreach($incidents as $incident)
<li> <li class='list-group-item'>
<h2>{{ $incident->name }}, <small>{{ $incident->humanStatus }}</small></h2> <h2>{{ $incident->name }}, <small>{{ $incident->humanStatus }}</small></h2>
<h3><time>{{ $incident->created_at->format('H:i:s A') }}</time></h3> <h3><time>{{ $incident->created_at->format('H:i:s A') }}</time></h3>
<p>{{ $incident->message }}</p> <p>{{ $incident->message }}</p>

View File

@@ -1,25 +1,31 @@
@extends('layout.master') @extends('layout.master')
@section('content') @section('content')
<ul> <div class='row'>
@foreach(Component::get() as $component) <div class='alert alert-{{ $systemStatus }}'>{{ $systemMessage }}</div>
<li> </div>
{{ $component->name }}
@if($component->description)
<small>{{ $component->description }}</small>
@endif
<span class='pull-right'> <div class='row'>
{{ $component->humanStatus }} <ul class='list-group'>
</span> @foreach(Component::get() as $component)
</li> <li class='list-group-item'>
@endforeach {{ $component->name }}
</ul> @if($component->description)
<small>{{ $component->description }}</small>
@endif
<h1>Past Incidents</h1> <span class='pull-right'>{{ $component->humanStatus }}</span>
<ul> </li>
@for($i=0; $i <= 7; $i++) @endforeach
@include('incident', array('i', $i)) </ul>
@endfor </div>
</ul>
<div class='row'>
<h1>Past Incidents</h1>
<ul class='list-group'>
@for($i=0; $i <= 7; $i++)
@include('incident', array('i', $i))
@endfor
</ul>
</div>
@stop @stop