mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
More UI tweaking for meta statuses
This commit is contained in:
parent
2ea91266c0
commit
43ff66e4d9
|
@ -33,7 +33,7 @@ class AssetsTransformer
|
|||
'model_number' => ($asset->model) ? e($asset->model->model_number) : null,
|
||||
'status_label' => ($asset->assetstatus) ? [
|
||||
'id' => (int) $asset->assetstatus->id,
|
||||
'name'=> e($asset->assetstatus->name),
|
||||
'name'=> e($asset->present()->statusText),
|
||||
'status_meta' => e($asset->present()->statusMeta),
|
||||
] : null,
|
||||
'category' => ($asset->model->category) ? [
|
||||
|
|
|
@ -346,7 +346,7 @@ class AssetPresenter extends Presenter
|
|||
public function statusText()
|
||||
{
|
||||
if ($this->model->assignedTo) {
|
||||
return strtolower(trans('general.deployed'));
|
||||
return trans('general.deployed');
|
||||
}
|
||||
return $this->model->assetstatus->name;
|
||||
}
|
||||
|
|
|
@ -140,7 +140,29 @@ $('.snipe-table').bootstrapTable({
|
|||
function genericColumnObjLinkFormatter(destination) {
|
||||
return function (value,row) {
|
||||
if ((value) && (value.status_meta)) {
|
||||
return '<label class="label label-default">'+ value.status_meta + '</label> <a href="{{ url('/') }}/' + destination + '/' + value.id + '"> ' + value.name + '</a> ';
|
||||
|
||||
var text_color;
|
||||
var icon_style;
|
||||
|
||||
switch (value.status_meta) {
|
||||
case 'deployed':
|
||||
text_color = 'blue';
|
||||
icon_style = 'fa-circle';
|
||||
break;
|
||||
case 'deployable':
|
||||
text_color = 'green';
|
||||
icon_style = 'fa-circle';
|
||||
break;
|
||||
case 'pending':
|
||||
text_color = 'orange';
|
||||
icon_style = 'fa-circle';
|
||||
break;
|
||||
default:
|
||||
text_color = 'red';
|
||||
icon_style = 'fa-times';
|
||||
}
|
||||
|
||||
return '<a href="{{ url('/') }}/' + destination + '/' + value.id + '" data-tooltip="true" title="'+ value.status_meta + '"> <i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + value.name + '</a> ';
|
||||
} else if ((value) && (value.name)) {
|
||||
return '<a href="{{ url('/') }}/' + destination + '/' + value.id + '"> ' + value.name + '</a>';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue