mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Adds more consistent visual display of status label types
This commit is contained in:
parent
2e11a983c8
commit
b379656d55
|
@ -31,7 +31,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
|
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
|
||||||
<th data-sortable="true" data-field="name" data-formatter="statuslabelsAssetLinkFormatter">{{ trans('admin/statuslabels/table.name') }}</th>
|
<th data-sortable="true" data-field="name" data-formatter="statuslabelsAssetLinkFormatter">{{ trans('admin/statuslabels/table.name') }}</th>
|
||||||
<th data-sortable="false" data-field="type" data-formatter="undeployableFormatter">{{ trans('admin/statuslabels/table.status_type') }}</th>
|
<th data-sortable="false" data-field="type" data-formatter="statusLabelTypeFormatter">{{ trans('admin/statuslabels/table.status_type') }}</th>
|
||||||
<th data-sortable="true" data-field="assets_count">{{ trans('general.assets') }}</th>
|
<th data-sortable="true" data-field="assets_count">{{ trans('general.assets') }}</th>
|
||||||
<th data-sortable="false" data-field="color" data-formatter="colorSqFormatter">{{ trans('admin/statuslabels/table.color') }}</th>
|
<th data-sortable="false" data-field="color" data-formatter="colorSqFormatter">{{ trans('admin/statuslabels/table.color') }}</th>
|
||||||
<th class="text-center" data-sortable="true" data-field="show_in_nav" data-formatter="trueFalseFormatter">{{ trans('admin/statuslabels/table.show_in_nav') }}</th>
|
<th class="text-center" data-sortable="true" data-field="show_in_nav" data-formatter="trueFalseFormatter">{{ trans('admin/statuslabels/table.show_in_nav') }}</th>
|
||||||
|
@ -92,12 +92,30 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function undeployableFormatter(value, row) {
|
function statusLabelTypeFormatter (row, value) {
|
||||||
if ((value) && (value!='deployable')) {
|
switch (value.type) {
|
||||||
return '<span class="text-danger">' + value + '</span> ';
|
case 'deployed':
|
||||||
} else {
|
text_color = 'blue';
|
||||||
return '<span class="text-success">' + value + '</span> ';
|
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';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var typename_lower = value.type;
|
||||||
|
var typename = typename_lower.charAt(0).toUpperCase() + typename_lower.slice(1);
|
||||||
|
return '<i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + typename;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@stop
|
@stop
|
||||||
|
|
Loading…
Reference in a new issue