Skip to content

Commit

Permalink
webui: introduce formatEnabledDisabledStatus function
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed Mar 11, 2020
1 parent 6b56b2c commit bb0b9c4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions webui/module/Client/view/client/client/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos for the canonical source repository
* @copyright Copyright (c) 2013-2017 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @copyright Copyright (c) 2013-2020 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -103,6 +103,14 @@ $this->headTitle($title);
window.open(url, '_blank');
}

function formatEnabledDisabledStatus(value) {
if(value) {
return '<span class="label label-success"><?php echo $this->translate("Enabled"); ?></span>';
} else {
return '<span class="label label-danger"><?php echo $this->translate("Disabled"); ?></span>';
}
}

function getClients() {
clients = $('#clients').bootstrapTable({
locale: '<?php echo str_replace('_','-', $_SESSION['bareos']['locale']); ?>',
Expand Down Expand Up @@ -202,12 +210,7 @@ $this->headTitle($title);
field: 'enabled',
sortable: true,
formatter: function(value) {
if(value) {
return '<span class="label label-success"><?php echo $this->translate("Enabled"); ?></span>';
}
else {
return '<span class="label label-danger"><?php echo $this->translate("Disabled"); ?></span>';
}
return formatEnabledDisabledStatus(value);
}
},
{
Expand Down

0 comments on commit bb0b9c4

Please sign in to comment.