authentication: show icons only for activated plugins.

This commit is contained in:
Marcin Kuzminski 2018-12-10 13:47:09 +01:00
parent cbff54d3ed
commit ea9b36c5a0
3 changed files with 6 additions and 7 deletions

View file

@ -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

View file

@ -79,7 +79,7 @@
% endif
</td>
<td>${plugin.get_id()}</td>
<td>${plugin.is_active()}</td>
<td>${h.bool2icon(plugin.is_active(),show_at_false=False)}</td>
</tr>
%endfor
</table>

View file

@ -49,9 +49,7 @@ ${entry}
% for route_name, view_fqn, view_url, active in c.view_data:
<tr>
<td class="td-x">
% if active:
${h.bool2icon(active)}
% endif
${h.bool2icon(active, show_at_false=False)}
</td>
<td class="td-x">${view_fqn}</td>
<td class="td-x" title="${route_name}">${view_url}</td>