mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Hopefully clearer status label meta info
This commit is contained in:
parent
b9e79c27a8
commit
fe1975067a
|
@ -34,7 +34,7 @@ class AssetsTransformer
|
|||
'status_label' => ($asset->assetstatus) ? [
|
||||
'id' => (int) $asset->assetstatus->id,
|
||||
'name'=> e($asset->assetstatus->name),
|
||||
'status_type' => e($asset->assetstatus->getStatuslabelType()),
|
||||
'status_meta' => e($asset->present()->statusMeta),
|
||||
] : null,
|
||||
'category' => ($asset->model->category) ? [
|
||||
'id' => (int) $asset->model->category->id,
|
||||
|
|
|
@ -325,13 +325,32 @@ class AssetPresenter extends Presenter
|
|||
return $interval;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* This handles the status label "meta" status of "deployed" if
|
||||
* it's assigned. Should maybe deprecate.
|
||||
*/
|
||||
public function statusMeta()
|
||||
{
|
||||
if ($this->model->assignedTo) {
|
||||
return strtolower(trans('general.deployed'));
|
||||
}
|
||||
return $this->model->assetstatus->getStatuslabelType();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* This handles the status label "meta" status of "deployed" if
|
||||
* it's assigned. Should maybe deprecate.
|
||||
*/
|
||||
public function statusText()
|
||||
{
|
||||
if ($this->model->assignedTo) {
|
||||
return trans('general.deployed');
|
||||
return strtolower(trans('general.deployed'));
|
||||
}
|
||||
return $this->model->assetstatus->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date the warantee expires.
|
||||
* @return false|string
|
||||
|
|
|
@ -87,8 +87,8 @@
|
|||
</span>
|
||||
</span>
|
||||
@endif
|
||||
<a href="{{ route('statuslabels.show', $asset->assetstatus->id) }}">{{ $asset->present()->statusText() }}</a>
|
||||
<label class="label label-default">{{ $asset->assetstatus->getStatuslabelType() }}</label>
|
||||
<a href="{{ route('statuslabels.show', $asset->assetstatus->id) }}">{{ $asset->assetstatus->name }}</a>
|
||||
<label class="label label-default">{{ $asset->present()->statusMeta }}</label>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
|
|
@ -139,8 +139,8 @@ $('.snipe-table').bootstrapTable({
|
|||
// Use this when we're introspecting into a column object and need to link
|
||||
function genericColumnObjLinkFormatter(destination) {
|
||||
return function (value,row) {
|
||||
if ((value) && (value.status_type)) {
|
||||
return '<a href="{{ url('/') }}/' + destination + '/' + value.id + '"> ' + value.name + '</a> ' + '<label class="label label-default">'+ value.status_type + '</label>';
|
||||
if ((value) && (value.status_meta)) {
|
||||
return '<label class="label label-default">'+ value.status_meta + '</label> <a href="{{ url('/') }}/' + destination + '/' + value.id + '"> ' + value.name + '</a> ';
|
||||
} else if ((value) && (value.name)) {
|
||||
return '<a href="{{ url('/') }}/' + destination + '/' + value.id + '"> ' + value.name + '</a>';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue