# HG changeset patch # User Marcin Kuzminski # Date 2018-12-10 12:47:09 # Node ID a2b3593d6d930348264e9ee8722ae653b61ba9bf # Parent ac4e4e5a54920c42c3cf832004fdb4193a17d487 authentication: show icons only for activated plugins. diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -1018,7 +1018,7 @@ def style_metatag(tag_type, value): return html_value -def bool2icon(value): +def bool2icon(value, show_at_false=True): """ Returns boolean value of a given value, represented as html element with classes that will represent icons @@ -1029,8 +1029,9 @@ def bool2icon(value): if value: # does bool conversion return HTML.tag('i', class_="icon-true") else: # not true as bool - return HTML.tag('i', class_="icon-false") - + if show_at_false: + return HTML.tag('i', class_="icon-false") + return HTML.tag('i') #============================================================================== # PERMS diff --git a/rhodecode/templates/admin/auth/auth_settings.mako b/rhodecode/templates/admin/auth/auth_settings.mako --- a/rhodecode/templates/admin/auth/auth_settings.mako +++ b/rhodecode/templates/admin/auth/auth_settings.mako @@ -79,7 +79,7 @@ % endif ${plugin.get_id()} - ${plugin.is_active()} + ${h.bool2icon(plugin.is_active(),show_at_false=False)} %endfor diff --git a/rhodecode/templates/admin/permissions/permissions_auth_token_access.mako b/rhodecode/templates/admin/permissions/permissions_auth_token_access.mako --- a/rhodecode/templates/admin/permissions/permissions_auth_token_access.mako +++ b/rhodecode/templates/admin/permissions/permissions_auth_token_access.mako @@ -49,9 +49,7 @@ Currently the following views are set: % for route_name, view_fqn, view_url, active in c.view_data: - % if active: - ${h.bool2icon(active)} - % endif + ${h.bool2icon(active, show_at_false=False)} ${view_fqn} ${view_url}