mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: add superuser
This commit is contained in:
1 parent
5916e4248a
commit
0c3847b756
9 files changed
+21
-8
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.30.5",
|
"version": "2.30.6",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ PERM.PERM_ADMIN = PERM.PERM_ALL;
|
|||||||
|
|
||||||
export const PRIV = {
|
export const PRIV = {
|
||||||
PRIV_NONE: 0,
|
PRIV_NONE: 0,
|
||||||
|
PRIV_MOD_BADGE: 1 << 25,
|
||||||
PRIV_EDIT_SYSTEM: 1 << 0, // renamed from PRIV_SET_PRIV
|
PRIV_EDIT_SYSTEM: 1 << 0, // renamed from PRIV_SET_PRIV
|
||||||
PRIV_SET_PERM: 1 << 1,
|
PRIV_SET_PERM: 1 << 1,
|
||||||
PRIV_USER_PROFILE: 1 << 2,
|
PRIV_USER_PROFILE: 1 << 2,
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ $notification-icon = {
|
|||||||
// Badge
|
// Badge
|
||||||
$badge-text-color = {
|
$badge-text-color = {
|
||||||
'mod': #FFF,
|
'mod': #FFF,
|
||||||
|
'su': #FFF,
|
||||||
'lv0': #727171,
|
'lv0': #727171,
|
||||||
'lv1': #FFF,
|
'lv1': #FFF,
|
||||||
'lv2': #FFF,
|
'lv2': #FFF,
|
||||||
@@ -189,6 +190,7 @@ $badge-text-color = {
|
|||||||
}
|
}
|
||||||
$badge-bg-color = {
|
$badge-bg-color = {
|
||||||
'mod': #cf70ab,
|
'mod': #cf70ab,
|
||||||
|
'su': #ff0000,
|
||||||
'lv0': #efefef,
|
'lv0': #efefef,
|
||||||
'lv1': #9db4bd,
|
'lv1': #9db4bd,
|
||||||
'lv2': #9db4bd,
|
'lv2': #9db4bd,
|
||||||
|
|||||||
@@ -440,6 +440,7 @@ Memory: 内存
|
|||||||
Message {0} not found.: 消息 {0} 不存在。
|
Message {0} not found.: 消息 {0} 不存在。
|
||||||
Messages: 消息
|
Messages: 消息
|
||||||
Method: 方法
|
Method: 方法
|
||||||
|
Moderator: 管理员
|
||||||
Month: 月
|
Month: 月
|
||||||
Monthly Popular: 月度最受欢迎
|
Monthly Popular: 月度最受欢迎
|
||||||
Most Upvoted Solutions: 最被赞同的题解
|
Most Upvoted Solutions: 最被赞同的题解
|
||||||
@@ -557,8 +558,8 @@ problem_submit: 递交代码
|
|||||||
problem_type.default: 传统题
|
problem_type.default: 传统题
|
||||||
problem_type.fileio: '文件IO ({0})'
|
problem_type.fileio: '文件IO ({0})'
|
||||||
problem_type.interactive: 交互题
|
problem_type.interactive: 交互题
|
||||||
problem_type.remote_judge: 远端评测题
|
|
||||||
problem_type.objective: 客观题
|
problem_type.objective: 客观题
|
||||||
|
problem_type.remote_judge: 远端评测题
|
||||||
problem_type.submit_answer: 提交答案题
|
problem_type.submit_answer: 提交答案题
|
||||||
problem-category-delim: '|'
|
problem-category-delim: '|'
|
||||||
problem-subcategory-delim: 、
|
problem-subcategory-delim: 、
|
||||||
@@ -710,6 +711,7 @@ Submit to Judge: 递交以评测
|
|||||||
Submit Your Code: 递交代码进行正式评测
|
Submit Your Code: 递交代码进行正式评测
|
||||||
Submit: 递交
|
Submit: 递交
|
||||||
Submitted: 已递交
|
Submitted: 已递交
|
||||||
|
SuperUser: 超级管理员
|
||||||
Support: 支持
|
Support: 支持
|
||||||
Tags: 标签
|
Tags: 标签
|
||||||
tasks_list: 任务列表
|
tasks_list: 任务列表
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.14.4",
|
"version": "4.14.5",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
@@ -59,6 +59,10 @@
|
|||||||
color: rgba(#FFF, 1)
|
color: rgba(#FFF, 1)
|
||||||
text-decoration: none
|
text-decoration: none
|
||||||
|
|
||||||
|
&.badge--su
|
||||||
|
background-color: rgba(#FFF, 0.8) !important
|
||||||
|
color: rgba(#000, 0.8) !important
|
||||||
|
|
||||||
&.badge--mod
|
&.badge--mod
|
||||||
background-color: rgba(#FFF, 0.8) !important
|
background-color: rgba(#FFF, 0.8) !important
|
||||||
color: rgba(#000, 0.8) !important
|
color: rgba(#000, 0.8) !important
|
||||||
|
|||||||
@@ -13,9 +13,13 @@
|
|||||||
</a>
|
</a>
|
||||||
{% if badge %}
|
{% if badge %}
|
||||||
{% set level = udoc.level|default(0) %}
|
{% 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>
|
<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 and udoc.hasPerm(perm.PERM_MOD_BADGE) %}
|
{% if modbadge %}
|
||||||
<span class="user-profile-badge v-center badge--mod" title="Moderator">MOD</span>
|
{% 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 %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
{%- for role in roles -%}
|
{%- for role in roles -%}
|
||||||
<td class="col--p">
|
<td class="col--p">
|
||||||
<label class="compact checkbox">
|
<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>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{%- for role in roles -%}
|
{%- 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 %}>
|
<tr{% if not isBuiltin %} data-role="{{ role._id }}"{% endif %}>
|
||||||
<td class="col--checkbox">
|
<td class="col--checkbox">
|
||||||
<label class="compact checkbox">
|
<label class="compact checkbox">
|
||||||
|
|||||||
Reference in new issue
Block a user