Incident statuses. Show components on the list.
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user