From: Andrey Kutejko Date: Wed, 3 Sep 2014 00:30:37 +0000 (+0300) Subject: show booleans with unicode instead of images X-Git-Tag: 0.6~151 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=ea03cd13b2742d1188bb65210b06d8c6390063c4;p=ipf.git show booleans with unicode instead of images --- diff --git a/ipf/admin/legacymodel.php b/ipf/admin/legacymodel.php index 40572fd..d8baa17 100644 --- a/ipf/admin/legacymodel.php +++ b/ipf/admin/legacymodel.php @@ -100,10 +100,9 @@ class IPF_Admin_Model extends IPF_Admin_Component $value = $object->$column; switch ($object->getTable()->getTypeOf($column)) { case 'boolean': - if ($value) - return 'True'; - else - return 'False'; + return $value + ? '' + : ''; case 'timestamp': return Text::escape(IPF_Utils::formatDate($value)); default: diff --git a/ipf/admin/static/admin/css/changelists.css b/ipf/admin/static/admin/css/changelists.css index eb0106c..542903e 100644 --- a/ipf/admin/static/admin/css/changelists.css +++ b/ipf/admin/static/admin/css/changelists.css @@ -48,3 +48,7 @@ .ItemsDragClass{background-color:#E3F3FE;} + +.positive { color: #44AD41; } +.negative { color: #DE2121; } + diff --git a/ipf/auth/admin.php b/ipf/auth/admin.php index dcf8b37..b80e984 100644 --- a/ipf/auth/admin.php +++ b/ipf/auth/admin.php @@ -156,7 +156,14 @@ class AdminUser extends IPF_Admin_Component public function renderCell($object, $column) { - return $object->$column; + if (substr($column, 0, 3) === 'is_') { + // boolean + return $object->$column + ? '' + : ''; + } else { + return Text::escape($object->$column); + } } public function getObjectByID($id)