Move component/incident color lookups into actual CSS.
This commit is contained in:
@@ -22,19 +22,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Color of the label for each status.
|
||||
* @return string HTML class name
|
||||
*/
|
||||
public function getColorAttribute() {
|
||||
switch ($this->status) {
|
||||
case 1: return 'text-success';
|
||||
case 2: return 'text-info';
|
||||
case 3: return 'text-alert';
|
||||
case 4: return 'text-danger';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the transformer instance.
|
||||
*
|
||||
|
||||
@@ -22,19 +22,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Looks up the class name for the status.
|
||||
* @return string
|
||||
*/
|
||||
public function getColorAttribute() {
|
||||
switch ($this->status) {
|
||||
case 1: return 'warning';
|
||||
case 2: return 'alert';
|
||||
case 3: return 'info';
|
||||
case 4: return 'success';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the icon to use for each status.
|
||||
* @return string
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<ul class='list-group components'>
|
||||
@foreach($components as $component)
|
||||
<li class='list-group-item component '>
|
||||
<h4>{{ $component->name }} <small class='{{ $component->color }}'>{{ $component->humanStatus }}</small></h4>
|
||||
<h4>{{ $component->name }} <small class='text-component-{{ $component->status }}'>{{ $component->humanStatus }}</small></h4>
|
||||
<p>{{ $component->description }}</p>
|
||||
</li>
|
||||
@endforeach
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
@foreach($incidents as $incidentID => $incident)
|
||||
<li class='list-group-item'>
|
||||
<span class='badge badge-{{ $incident->color }}'><i class='glyphicon {{ $incident->icon }}'></i></span>
|
||||
<span class='badge badge-incident-{{ $incident->status }}'><i class='glyphicon {{ $incident->icon }}'></i></span>
|
||||
<h4>{{ $incident->name }} <small><time>{{ $incident->created_at->format('H:i:s A') }}</time></small></h4>
|
||||
{{ $incident->message }}
|
||||
@if($incidentID < ($incident->count() - 1))
|
||||
|
||||
Reference in New Issue
Block a user