Labels are now coloured by their status

This commit is contained in:
James Brooks
2014-11-19 12:02:51 +00:00
parent 68ddefff1f
commit 916110c32c
2 changed files with 13 additions and 1 deletions

View File

@@ -9,4 +9,16 @@
case 4: return 'Fixed';
}
}
public function getLabelColorAttribute() {
switch ($this->status) {
case 1:
return 'label-warning';
case 2:
case 3:
return 'label-info';
case 4:
return 'label-success';
}
}
}

View File

@@ -8,7 +8,7 @@
<p>No incidents reported.</p>
@else
@foreach($incidents as $incident)
<h3>{{ $incident->name }}, <span class='label label-info'>{{ $incident->humanStatus }}</span></h3>
<h3><span class='label {{ $incident->labelColor }}'>{{ $incident->humanStatus }}</span> {{ $incident->name }}</h3>
<p>{{ $incident->message }}</p>
<h4><time>{{ $incident->created_at->format('H:i:s A') }} {{ Config::get('app.timezone') }}</time></h4>
@endforeach