diff rhodecode/lib/helpers.py @ 712:131c1e335fa7 beta

Added ldap info on admin users, added bool2icon helper for nicer representation of True/False values. Fixed lock open icon to be more readable
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 18 Nov 2010 03:05:29 +0100
parents 4cd0709b6d4b
children e002951ba66d
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py	Thu Nov 18 02:48:04 2010 +0100
+++ b/rhodecode/lib/helpers.py	Thu Nov 18 03:05:29 2010 +0100
@@ -371,6 +371,22 @@
 short_id = lambda x: x[:12]
 
 
+def bool2icon(value):
+    """
+    Returns True/False values represented as small html image of true/false
+    icons
+    :param value: bool value
+    """
+
+    if value is True:
+        return HTML.tag('img', src="/images/icons/accept.png")
+
+    if value is False:
+        return HTML.tag('img', src="/images/icons/cancel.png")
+
+    return value
+
+
 def action_parser(user_log):
     """
     This helper will map the specified string action into translated