mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
parent
c75a2051ff
commit
f4e9d245d0
|
@ -36,7 +36,7 @@ class AssetsTransformer
|
|||
'id' => (int) $asset->assetstatus->id,
|
||||
'name'=> e($asset->assetstatus->name),
|
||||
'status_type'=> e($asset->assetstatus->getStatuslabelType()),
|
||||
'status_meta' => e($asset->present()->statusMeta),
|
||||
'status_meta' => e($asset->present()->statusMeta),
|
||||
] : null,
|
||||
'category' => ($asset->model->category) ? [
|
||||
'id' => (int) $asset->model->category->id,
|
||||
|
|
|
@ -398,7 +398,7 @@ class AssetPresenter extends Presenter
|
|||
public function statusMeta()
|
||||
{
|
||||
if ($this->model->assigned) {
|
||||
return strtolower(trans('general.deployed'));
|
||||
return 'deployed';
|
||||
}
|
||||
return $this->model->assetstatus->getStatuslabelType();
|
||||
}
|
||||
|
@ -482,4 +482,3 @@ class AssetPresenter extends Presenter
|
|||
return '<i class="fa fa-barcode"></i>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -175,19 +175,24 @@
|
|||
var text_color;
|
||||
var icon_style;
|
||||
var text_help;
|
||||
var status_meta = {
|
||||
'deployed': '{{ strtolower(trans('general.deployed')) }}',
|
||||
'deployable': '{{ strtolower(trans('admin/hardware/general.deployable')) }}',
|
||||
'pending': '{{ strtolower(trans('general.pending')) }}'
|
||||
}
|
||||
|
||||
switch (value.status_meta) {
|
||||
case '{{ strtolower(trans('general.deployed')) }}':
|
||||
case 'deployed':
|
||||
text_color = 'blue';
|
||||
icon_style = 'fa-circle';
|
||||
text_help = '<label class="label label-default">{{ trans('general.deployed') }}</label>';
|
||||
break;
|
||||
case '{{ strtolower(trans('admin/hardware/general.deployable')) }}':
|
||||
case 'deployable':
|
||||
text_color = 'green';
|
||||
icon_style = 'fa-circle';
|
||||
text_help = '';
|
||||
break;
|
||||
case '{{ strtolower(trans('general.pending')) }}':
|
||||
case 'pending':
|
||||
text_color = 'orange';
|
||||
icon_style = 'fa-circle';
|
||||
text_help = '';
|
||||
|
@ -198,7 +203,7 @@
|
|||
text_help = '';
|
||||
}
|
||||
|
||||
return '<nobr><a href="{{ url('/') }}/' + destination + '/' + value.id + '" data-tooltip="true" title="'+ value.status_meta + '"> <i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + value.name + ' ' + text_help + ' </a> </nobr>';
|
||||
return '<nobr><a href="{{ url('/') }}/' + destination + '/' + value.id + '" data-tooltip="true" title="'+ status_meta[value.status_meta] + '"> <i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + value.name + ' ' + text_help + ' </a> </nobr>';
|
||||
} else if ((value) && (value.name)) {
|
||||
return '<nobr><a href="{{ url('/') }}/' + destination + '/' + value.id + '"> ' + value.name + '</a></span>';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue