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

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.30.5",
"version": "2.30.6",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+1
View File
@@ -226,6 +226,7 @@ PERM.PERM_ADMIN = PERM.PERM_ALL;
export const PRIV = {
PRIV_NONE: 0,
PRIV_MOD_BADGE: 1 << 25,
PRIV_EDIT_SYSTEM: 1 << 0, // renamed from PRIV_SET_PRIV
PRIV_SET_PERM: 1 << 1,
PRIV_USER_PROFILE: 1 << 2,
@@ -175,6 +175,7 @@ $notification-icon = {
// Badge
$badge-text-color = {
'mod': #FFF,
'su': #FFF,
'lv0': #727171,
'lv1': #FFF,
'lv2': #FFF,
@@ -189,6 +190,7 @@ $badge-text-color = {
}
$badge-bg-color = {
'mod': #cf70ab,
'su': #ff0000,
'lv0': #efefef,
'lv1': #9db4bd,
'lv2': #9db4bd,
+3 -1
View File
@@ -440,6 +440,7 @@ Memory: 内存
Message {0} not found.: 消息 {0} 不存在。
Messages: 消息
Method: 方法
Moderator: 管理员
Month: 月
Monthly Popular: 月度最受欢迎
Most Upvoted Solutions: 最被赞同的题解
@@ -557,8 +558,8 @@ problem_submit: 递交代码
problem_type.default: 传统题
problem_type.fileio: '文件IO ({0})'
problem_type.interactive: 交互题
problem_type.remote_judge: 远端评测题
problem_type.objective: 客观题
problem_type.remote_judge: 远端评测题
problem_type.submit_answer: 提交答案题
problem-category-delim: '|'
problem-subcategory-delim: 、
@@ -710,6 +711,7 @@ Submit to Judge: 递交以评测
Submit Your Code: 递交代码进行正式评测
Submit: 递交
Submitted: 已递交
SuperUser: 超级管理员
Support: 支持
Tags: 标签
tasks_list: 任务列表
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.14.4",
"version": "4.14.5",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",
@@ -59,6 +59,10 @@
color: rgba(#FFF, 1)
text-decoration: none
&.badge--su
background-color: rgba(#FFF, 0.8) !important
color: rgba(#000, 0.8) !important
&.badge--mod
background-color: rgba(#FFF, 0.8) !important
color: rgba(#000, 0.8) !important
@@ -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">