diff --git a/rhodecode/controllers/admin/users.py b/rhodecode/controllers/admin/users.py
--- a/rhodecode/controllers/admin/users.py
+++ b/rhodecode/controllers/admin/users.py
@@ -99,9 +99,9 @@ class UsersController(BaseController):
"lastname": user.lastname,
"last_login": h.fmt_date(user.last_login),
"last_login_raw": datetime_to_time(user.last_login),
- "active": h.bool2icon(user.active),
- "admin": h.bool2icon(user.admin),
- "ldap": h.bool2icon(bool(user.ldap_dn)),
+ "active": h.boolicon(user.active),
+ "admin": h.boolicon(user.admin),
+ "ldap": h.boolicon(bool(user.ldap_dn)),
"action": user_actions(user.user_id, user.username),
})
diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py
--- a/rhodecode/lib/helpers.py
+++ b/rhodecode/lib/helpers.py
@@ -494,23 +494,20 @@ def desc_stylize(value):
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):
"""
diff --git a/rhodecode/templates/admin/permissions/permissions.html b/rhodecode/templates/admin/permissions/permissions.html
--- a/rhodecode/templates/admin/permissions/permissions.html
+++ b/rhodecode/templates/admin/permissions/permissions.html
@@ -139,7 +139,7 @@
%if section == 'global':
- ${h.bool2icon(k.split('.')[-1] != 'none')}
+ ${h.boolicon(k.split('.')[-1] != 'none')}
%else:
${section_perm}
%endif
diff --git a/rhodecode/templates/admin/repos/repo_edit.html b/rhodecode/templates/admin/repos/repo_edit.html
--- a/rhodecode/templates/admin/repos/repo_edit.html
+++ b/rhodecode/templates/admin/repos/repo_edit.html
@@ -221,7 +221,7 @@
|
${cache.get_prefix() or '-'} |
${cache.cache_key} |
- ${h.bool2icon(cache.cache_active)} |
+ ${h.boolicon(cache.cache_active)} |
%endfor
diff --git a/rhodecode/templates/admin/users/user_edit.html b/rhodecode/templates/admin/users/user_edit.html
--- a/rhodecode/templates/admin/users/user_edit.html
+++ b/rhodecode/templates/admin/users/user_edit.html
@@ -225,7 +225,7 @@
%if section == 'global':
- ${h.bool2icon(k.split('.')[-1] != 'none')}
+ ${h.boolicon(k.split('.')[-1] != 'none')}
%else:
${section_perm}
%endif
diff --git a/rhodecode/templates/admin/users/user_edit_my_account.html b/rhodecode/templates/admin/users/user_edit_my_account.html
--- a/rhodecode/templates/admin/users/user_edit_my_account.html
+++ b/rhodecode/templates/admin/users/user_edit_my_account.html
@@ -77,7 +77,7 @@
|
%if section == 'global':
- ${h.bool2icon(True)}
+ ${h.boolicon(True)}
%else:
${section_perm}
%endif
diff --git a/rhodecode/templates/admin/users_groups/users_groups.html b/rhodecode/templates/admin/users_groups/users_groups.html
--- a/rhodecode/templates/admin/users_groups/users_groups.html
+++ b/rhodecode/templates/admin/users_groups/users_groups.html
@@ -40,7 +40,7 @@
|
${h.link_to(u_group.users_group_name,h.url('edit_users_group', id=u_group.users_group_id))} |
${len(u_group.members)} |
- ${h.bool2icon(u_group.users_group_active)} |
+ ${h.boolicon(u_group.users_group_active)} |
${h.form(url('users_group', id=u_group.users_group_id),method='delete')}
${h.submit('remove_',_('delete'),id="remove_group_%s" % u_group.users_group_id,
|