Incident statuses. Show components on the list.
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Incident extends Eloquent {
|
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
|
@else
|
||||||
@foreach($incidents as $incident)
|
@foreach($incidents as $incident)
|
||||||
<li>
|
<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>
|
<h3><time>{{ $incident->created_at->format('H:i:s A') }}</time></h3>
|
||||||
<p>{{ $incident->message }}</p>
|
<p>{{ $incident->message }}</p>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -2,7 +2,23 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<ul>
|
<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))
|
@include('incident', array('i', $i))
|
||||||
@endfor
|
@endfor
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user