ui: add superuser

This commit is contained in:
undefined committed 2021-08-01 00:50:51 +08:00
1 parent 5916e4248a
commit 0c3847b756
9 files changed
+21 -8

No files matched your search

@@ -13,9 +13,13 @@
</a>
{% if badge %}
{% set level = udoc.level|default(0) %}
<a class="user-profile-badge v-center badge--lv{{ level }}" href="{{ url('user_detail', uid=udoc._id) }}" title="LV {{ level }}: Top {{ model.builtin.LEVELS[level]|default('N/A') }}%">LV {{ level }}</a>
{% if modbadge and udoc.hasPerm(perm.PERM_MOD_BADGE) %}
<span class="user-profile-badge v-center badge--mod" title="Moderator">MOD</span>
<a class="user-profile-badge v-center badge--lv{{ level }}" href="{{ url('user_detail', uid=udoc._id) }}" data-tooltip="LV {{ level }}: Top {{ model.builtin.LEVELS[level]|default('N/A') }}%">LV {{ level }}</a>
{% if modbadge %}
{% if udoc.hasPriv(PRIV.PRIV_MOD_BADGE) %}
<span class="user-profile-badge v-center badge--su" data-tooltip="{{ _('SuperUser') }}">SU</span>
{% elif udoc.hasPerm(perm.PERM_MOD_BADGE) %}
<span class="user-profile-badge v-center badge--mod" data-tooltip="{{ _('Moderator') }}">MOD</span>
{% endif %}
{% endif %}
{% endif %}
</span>
@@ -30,7 +30,7 @@
{%- for role in roles -%}
<td class="col--p">
<label class="compact checkbox">
<input name="{{ role._id }}" data-checkbox-group="{{ role._id }}" data-checkbox-range value="{{ log2(perm.key) }}" type="checkbox"{% if role.perm|bitand(perm.key) %} checked{% endif %}{% if role._id == 'admin' %} disabled{% endif %}>
<input name="{{ role._id }}" data-checkbox-group="{{ role._id }}" data-checkbox-range value="{{ log2(perm.key) }}" type="checkbox"{% if role.perm|bitand(perm.key) %} checked{% endif %}{% if role._id == 'root' %} disabled{% endif %}>
</label>
</td>
{%- endfor -%}
@@ -47,7 +47,7 @@
</thead>
<tbody>
{%- for role in roles -%}
{% set isBuiltin = role._id in ['default', 'guest', 'admin'] %}
{% set isBuiltin = role._id in ['default', 'guest', 'root'] %}
<tr{% if not isBuiltin %} data-role="{{ role._id }}"{% endif %}>
<td class="col--checkbox">
<label class="compact checkbox">