diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 22b648d63..9893b602b 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "3.4.30", + "version": "3.4.31", "bin": "bin/hydrooj.js", "main": "src/loader", "module": "src/loader", diff --git a/packages/hydrooj/src/handler/domain.ts b/packages/hydrooj/src/handler/domain.ts index f78689d75..ee3c20f9d 100644 --- a/packages/hydrooj/src/handler/domain.ts +++ b/packages/hydrooj/src/handler/domain.ts @@ -231,7 +231,7 @@ class DomainJoinApplicationsHandler extends ManageHandler { async get() { const r = await domain.getRoles(this.domain); const roles = r.map((role) => role._id).sort(); - this.response.body.rolesWithText = roles.map((role) => [role, role]); + this.response.body.rolesWithText = roles.filter((i) => !['default', 'guest'].includes(i)).map((role) => [role, role]); this.response.body.joinSettings = domain.getJoinSettings(this.domain, roles); this.response.body.expirations = { ...domain.JOIN_EXPIRATION_RANGE }; if (!this.response.body.joinSettings) { diff --git a/packages/ui-default/locales/zh.yaml b/packages/ui-default/locales/zh.yaml index 7e88c93d4..609392dd6 100644 --- a/packages/ui-default/locales/zh.yaml +++ b/packages/ui-default/locales/zh.yaml @@ -753,6 +753,7 @@ Test data comes from: 测试数据来自 Testdata Config: 测试数据配置 Testdata: 测试数据 Text: 文本 +The 'default' role applies to ALL REGISTERED USER.: default 角色作用于所有已注册用户 The homework's deadline is due but in extension. You can still submit for this problem but your score will be penalized.: 作业已超过截止时间,但仍在延期时间内。您递交题目将无法获得全部分数。 The invitation code to enter to successfully join the domain. You can only use letters and numbers in the code and it should not be longer than 64 characters.: 加入此域的邀请码。您只能使用字母和数字,并且不能长于 64 个字符。 The invitation code you provided is invalid.: 您提供的邀请码无效。 @@ -894,6 +895,7 @@ You have permissions to create problems for this domain.: 您有权限为此域 You have uncompleted domain creation operation. You can click "Continue" to finish the creation.: 您有未完成的创建域操作。您可以点击“继续”来完成创建。 You haven't attended this contest yet.: 您还没有参加本次比赛。 You haven't claimed this homework yet.: 您还未认领过该作业。 +You may want to create a new role in 'Manage Role' page.: 您可能希望在右侧管理角色面板中添加一个新角色。 You need to enter the invitation code to join the domain.: 您需要输入邀请码来加入此域。 You received a system message, click here to view.: 您收到一条系统通知,点击查看。 You're not logged in.: 您没有登录。 diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index 709741c83..fcce512f9 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -1,6 +1,6 @@ { "name": "@hydrooj/ui-default", - "version": "4.32.6", + "version": "4.32.7", "author": "undefined ", "license": "AGPL-3.0", "main": "hydro.js", diff --git a/packages/ui-default/templates/domain_join_applications.html b/packages/ui-default/templates/domain_join_applications.html index 3724562cd..ef504dba1 100644 --- a/packages/ui-default/templates/domain_join_applications.html +++ b/packages/ui-default/templates/domain_join_applications.html @@ -2,29 +2,37 @@ {% block domain_content %} {% if joinSettings %}
-
-

{{ _('Information') }}

-
-
-

{{ _('User can join this domain by visiting the following URL') }}:

-
{{ url_prefix|safe }}domain/join?domainId={{ handler.args.domainId }}
+
+

{{ _('Information') }}

+
+
+

{{ _('User can join this domain by visiting the following URL') }}:

+
{{ url_prefix|safe }}domain/join?domainId={{ handler.args.domainId }}
{% if joinSettings['method'] == model.domain.JOIN_METHOD_CODE %}

{{ _('Or, with automatically filled invitation code') }}:

{{ url_prefix|safe }}domain/join?domainId={{ handler.args.domainId }}&code={{ joinSettings.code|urlencode }}
{% endif %} - {% if not joinSettings['expire'] %} + {% if joinSettings.expire %}
{{ (_('The link will be expired at {0}').format(datetimeSpan(joinSettings.expire, relative=false)))|safe }}
{% endif %} -
+
{% endif %}

{{ _('Settings') }}

+ {% if rolesWithText.length == 1 %} +
+
+

{{ _("The 'default' role applies to ALL REGISTERED USER.")|safe }}

+

{{ _("You may want to create a new role in 'Manage Role' page.")|safe }}

+
+
+ {% endif %}
{{ form.form_select({ diff --git a/packages/ui-default/templates/domain_permission.html b/packages/ui-default/templates/domain_permission.html index 80762c3d2..5e48ee20d 100644 --- a/packages/ui-default/templates/domain_permission.html +++ b/packages/ui-default/templates/domain_permission.html @@ -5,6 +5,14 @@

{{ _('{0}: Permissions').format(domain.name) }}

+ {% if roles.length == 3 %} +
+
+

{{ _("The 'default' role applies to ALL REGISTERED USER.")|safe }}

+

{{ _("You may want to create a new role in 'Manage Role' page.")|safe }}

+
+
+ {% endif %}