mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
fixes the statuslabeltypeforatter instead of the model
This commit is contained in:
parent
a0d5774635
commit
6b94ef6adc
|
@ -74,14 +74,14 @@ class Statuslabel extends SnipeModel
|
|||
public function getStatuslabelType()
|
||||
{
|
||||
if (($this->pending == '1') && ($this->archived == '0') && ($this->deployable == '0')) {
|
||||
return trans('admin/statuslabels/table.pending');
|
||||
return 'pending';
|
||||
} elseif (($this->pending == '0') && ($this->archived == '1') && ($this->deployable == '0')) {
|
||||
return trans('admin/statuslabels/table.archived');
|
||||
return 'archived';
|
||||
} elseif (($this->pending == '0') && ($this->archived == '0') && ($this->deployable == '0')) {
|
||||
return trans('admin/statuslabels/table.undeployable');
|
||||
return 'undeployable';
|
||||
}
|
||||
|
||||
return trans('admin/statuslabels/table.deployable');
|
||||
return 'deployable';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -17392,7 +17392,7 @@
|
|||
"performance-now": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
|
||||
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==",
|
||||
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
|
||||
"optional": true
|
||||
},
|
||||
"picocolors": {
|
||||
|
@ -18500,7 +18500,7 @@
|
|||
"rgbcolor": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz",
|
||||
"integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==",
|
||||
"integrity": "sha1-1lBezbMEplldom+ktDMHMGd1lF0=",
|
||||
"optional": true
|
||||
},
|
||||
"rimraf": {
|
||||
|
|
|
@ -111,25 +111,39 @@
|
|||
}
|
||||
|
||||
function statusLabelTypeFormatter (row, value) {
|
||||
|
||||
switch (value.type) {
|
||||
case 'deployed':
|
||||
text_color = 'blue';
|
||||
icon_style = 'fa-circle';
|
||||
trans = '{{ strtolower(trans('general.deployed')) }}';
|
||||
break;
|
||||
case 'deployable':
|
||||
text_color = 'green';
|
||||
icon_style = 'fa-circle';
|
||||
trans = '{{ strtolower(trans('admin/hardware/general.deployable')) }}';
|
||||
|
||||
break;
|
||||
case 'pending':
|
||||
text_color = 'orange';
|
||||
icon_style = 'fa-circle';
|
||||
trans = '{{ strtolower(trans('general.deployed')) }}';
|
||||
|
||||
break;
|
||||
case 'undeployable':
|
||||
text_color = 'orange';
|
||||
icon_style = 'fa-circle';
|
||||
trans ='{{ trans('admin/statuslabels/table.undeployable') }}';
|
||||
|
||||
break;
|
||||
default:
|
||||
text_color = 'red';
|
||||
icon_style = 'fa-times';
|
||||
trans = '{{ strtolower(trans('general.archived')) }}';
|
||||
|
||||
}
|
||||
|
||||
var typename_lower = value.type;
|
||||
var typename_lower = trans;
|
||||
var typename = typename_lower.charAt(0).toUpperCase() + typename_lower.slice(1);
|
||||
return '<i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + typename;
|
||||
|
||||
|
|
Loading…
Reference in a new issue