mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 13:38:20 +01:00
Move HumanStatus to Presenter
This commit is contained in:
parent
d5a71976d2
commit
8a47dd873f
@ -157,16 +157,6 @@ class Component extends Model implements HasPresenter
|
||||
return $query->where('enabled', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Looks up the human readable version of the status.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHumanStatusAttribute()
|
||||
{
|
||||
return trans('cachet.components.status.'.$this->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all of the tags on this component.
|
||||
*
|
||||
|
@ -32,6 +32,16 @@ class ComponentPresenter extends AbstractPresenter
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Looks up the human readable version of the status.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function human_status()
|
||||
{
|
||||
return trans('cachet.components.status.'.$this->wrappedObject->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the presenter instance to an array.
|
||||
*
|
||||
@ -42,7 +52,7 @@ class ComponentPresenter extends AbstractPresenter
|
||||
return array_merge($this->wrappedObject->toArray(), [
|
||||
'created_at' => $this->created_at(),
|
||||
'updated_at' => $this->updated_at(),
|
||||
'status_name' => $this->wrappedObject->humanStatus,
|
||||
'status_name' => $this->human_status(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
@if($components->count() > 1)
|
||||
<span class="drag-handle"><i class="ion-drag"></i></span>
|
||||
@endif
|
||||
{{ $component->name }} <small>{{ $component->humanStatus }}</small>
|
||||
{{ $component->name }} <small>{{ $component->human_status }}</small>
|
||||
</h4>
|
||||
@if($component->group)
|
||||
<p><small>{{ trans('dashboard.components.listed_group', ['name' => $component->group->name]) }}</small></p>
|
||||
|
@ -14,7 +14,7 @@
|
||||
<div class="moment first">
|
||||
<div class="row event clearfix">
|
||||
<div class="col-sm-1">
|
||||
<div class="status-icon status-{{ $incident->status }}" data-toggle="tooltip" title="{{ $incident->humanStatus }}" data-placement="left">
|
||||
<div class="status-icon status-{{ $incident->status }}" data-toggle="tooltip" title="{{ $incident->human_status }}" data-placement="left">
|
||||
<i class="{{ $incident->icon }}"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -10,6 +10,6 @@
|
||||
@endif
|
||||
|
||||
<div class="pull-right">
|
||||
<small class="text-component-{{ $component->status }} {{ $component->status_color }}">{{ $component->humanStatus }}</small>
|
||||
<small class="text-component-{{ $component->status }} {{ $component->status_color }}">{{ $component->human_status }}</small>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="moment {{ $incidentID === 0 ? 'first' : null }}">
|
||||
<div class="row event clearfix">
|
||||
<div class="col-sm-1">
|
||||
<div class="status-icon status-{{ $incident->status }}" data-toggle="tooltip" title="{{ $incident->humanStatus }}" data-placement="left">
|
||||
<div class="status-icon status-{{ $incident->status }}" data-toggle="tooltip" title="{{ $incident->human_status }}" data-placement="left">
|
||||
<i class="{{ $incident->icon }}"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user