Incident statuses. Show components on the list.

This commit is contained in:
James Brooks
2014-11-16 23:34:46 +00:00
parent 0e2fb29498
commit 7ae7d85e73
3 changed files with 26 additions and 3 deletions

View File

@@ -1,5 +1,12 @@
<?php
class Incident extends Eloquent {
public function getHumanStatusAttribute() {
switch ($this->status) {
case 1: return 'Investigating';
case 2: return 'Identified';
case 3: return 'Watching';
case 4: return 'Fixed';
}
}
}

View File

@@ -10,7 +10,7 @@
@else
@foreach($incidents as $incident)
<li>
<h2>{{ $incident->name }}</h2>
<h2>{{ $incident->name }}, <small>{{ $incident->humanStatus }}</small></h2>
<h3><time>{{ $incident->created_at->format('H:i:s A') }}</time></h3>
<p>{{ $incident->message }}</p>
</li>

View File

@@ -2,7 +2,23 @@
@section('content')
<ul>
@for ($i=0; $i <= 7; $i++)
@foreach(Component::get() as $component)
<li>
{{ $component->name }}
@if($component->description)
<small>{{ $component->description }}</small>
@endif
<span class='pull-right'>
{{ $component->humanStatus }}
</span>
</li>
@endforeach
</ul>
<h1>Past Incidents</h1>
<ul>
@for($i=0; $i <= 7; $i++)
@include('incident', array('i', $i))
@endfor
</ul>