comparison 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
comparison
equal deleted inserted replaced
3626:0a1417ef1a9c 3627:32cb8d45f330
492 '<div class="metatag" tag="\\1">\\1</div>', value) 492 '<div class="metatag" tag="\\1">\\1</div>', value)
493 493
494 return value 494 return value
495 495
496 496
497 def bool2icon(value): 497 def boolicon(value):
498 """Returns True/False values represented as small html image of true/false 498 """Returns boolean value of a value, represented as small html image of true/false
499 icons 499 icons
500 500
501 :param value: bool value 501 :param value: value
502 """ 502 """
503 503
504 if value is True: 504 if value:
505 return HTML.tag('img', src=url("/images/icons/accept.png"), 505 return HTML.tag('img', src=url("/images/icons/accept.png"),
506 alt=_('True')) 506 alt=_('True'))
507 507 else:
508 if value is False:
509 return HTML.tag('img', src=url("/images/icons/cancel.png"), 508 return HTML.tag('img', src=url("/images/icons/cancel.png"),
510 alt=_('False')) 509 alt=_('False'))
511
512 return value
513 510
514 511
515 def action_parser(user_log, feed=False, parse_cs=False): 512 def action_parser(user_log, feed=False, parse_cs=False):
516 """ 513 """
517 This helper will action_map the specified string action into translated 514 This helper will action_map the specified string action into translated