diff rhodecode/lib/helpers.py @ 3627:32cb8d45f330 beta

helpers: show boolean value of value as icon, not just the True and False singletons
author Mads Kiilerich <madski@unity3d.com>
date Thu, 28 Mar 2013 01:10:45 +0100
parents 8087731920d8
children 10b4e34841a4
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py	Thu Mar 28 01:10:45 2013 +0100
+++ b/rhodecode/lib/helpers.py	Thu Mar 28 01:10:45 2013 +0100
@@ -494,23 +494,20 @@
     return value
 
 
-def bool2icon(value):
-    """Returns True/False values represented as small html image of true/false
+def boolicon(value):
+    """Returns boolean value of a value, represented as small html image of true/false
     icons
 
-    :param value: bool value
+    :param value: value
     """
 
-    if value is True:
+    if value:
         return HTML.tag('img', src=url("/images/icons/accept.png"),
                         alt=_('True'))
-
-    if value is False:
+    else:
         return HTML.tag('img', src=url("/images/icons/cancel.png"),
                         alt=_('False'))
 
-    return value
-
 
 def action_parser(user_log, feed=False, parse_cs=False):
     """