ui: add warning for domain_role

This commit is contained in:
undefined committed 2022-02-24 22:36:49 +08:00
1 parent 70e011105a
commit a1d1aa40ba
6 files changed
+29 -11

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "3.4.30", "version": "3.4.31",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",
+1 -1
View File
@@ -231,7 +231,7 @@ class DomainJoinApplicationsHandler extends ManageHandler {
async get() { async get() {
const r = await domain.getRoles(this.domain); const r = await domain.getRoles(this.domain);
const roles = r.map((role) => role._id).sort(); 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.joinSettings = domain.getJoinSettings(this.domain, roles);
this.response.body.expirations = { ...domain.JOIN_EXPIRATION_RANGE }; this.response.body.expirations = { ...domain.JOIN_EXPIRATION_RANGE };
if (!this.response.body.joinSettings) { if (!this.response.body.joinSettings) {
+2
View File
@@ -753,6 +753,7 @@ Test data comes from: 测试数据来自
Testdata Config: 测试数据配置 Testdata Config: 测试数据配置
Testdata: 测试数据 Testdata: 测试数据
Text: 文本 Text: 文本
The 'default' role applies to ALL REGISTERED USER.: default 角色作用于<b>所有已注册用户</b>
The homework's deadline is due but in extension. You can still submit for this problem but your score will be penalized.: 作业已超过截止时间,但仍在延期时间内。您递交题目将无法获得全部分数。 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 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.: 您提供的邀请码无效。 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 have uncompleted domain creation operation. You can click "Continue" to finish the creation.: 您有未完成的创建域操作。您可以点击“继续”来完成创建。
You haven't attended this contest yet.: 您还没有参加本次比赛。 You haven't attended this contest yet.: 您还没有参加本次比赛。
You haven't claimed this homework 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 need to enter the invitation code to join the domain.: 您需要输入邀请码来加入此域。
You received a system message, click here to view.: 您收到一条系统通知,点击查看。 You received a system message, click here to view.: 您收到一条系统通知,点击查看。
You're not logged in.: 您没有登录。 You're not logged in.: 您没有登录。
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.32.6", "version": "4.32.7",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",
@@ -2,29 +2,37 @@
{% block domain_content %} {% block domain_content %}
{% if joinSettings %} {% if joinSettings %}
<div class="section"> <div class="section">
<div class="section__header"> <div class="section__header">
<h1 class="section__title">{{ _('Information') }}</h1> <h1 class="section__title">{{ _('Information') }}</h1>
</div> </div>
<div class="section__body typo"> <div class="section__body typo">
<p>{{ _('User can join this domain by visiting the following URL') }}:</p> <p>{{ _('User can join this domain by visiting the following URL') }}:</p>
<pre><code class="language-data">{{ url_prefix|safe }}domain/join?domainId={{ handler.args.domainId }}</code></pre> <pre><code class="language-data">{{ url_prefix|safe }}domain/join?domainId={{ handler.args.domainId }}</code></pre>
{% if joinSettings['method'] == model.domain.JOIN_METHOD_CODE %} {% if joinSettings['method'] == model.domain.JOIN_METHOD_CODE %}
<p>{{ _('Or, with automatically filled invitation code') }}:</p> <p>{{ _('Or, with automatically filled invitation code') }}:</p>
<pre><code class="language-data">{{ url_prefix|safe }}domain/join?domainId={{ handler.args.domainId }}&code={{ joinSettings.code|urlencode }}</code></pre> <pre><code class="language-data">{{ url_prefix|safe }}domain/join?domainId={{ handler.args.domainId }}&code={{ joinSettings.code|urlencode }}</code></pre>
{% endif %} {% endif %}
{% if not joinSettings['expire'] %} {% if joinSettings.expire %}
<br/> <br/>
<blockquote class="note"> <blockquote class="note">
{{ (_('The link will be expired at {0}').format(datetimeSpan(joinSettings.expire, relative=false)))|safe }} {{ (_('The link will be expired at {0}').format(datetimeSpan(joinSettings.expire, relative=false)))|safe }}
</blockquote> </blockquote>
{% endif %} {% endif %}
</div>
</div> </div>
</div>
{% endif %} {% endif %}
<div class="section"> <div class="section">
<div class="section__header"> <div class="section__header">
<h1 class="section__title">{{ _('Settings') }}</h1> <h1 class="section__title">{{ _('Settings') }}</h1>
</div> </div>
{% if rolesWithText.length == 1 %}
<div class="section__body typo">
<blockquote class="warn">
<p>{{ _("The 'default' role applies to ALL REGISTERED USER.")|safe }}</p>
<p>{{ _("You may want to create a new role in 'Manage Role' page.")|safe }}</p>
</blockquote>
</div>
{% endif %}
<div class="section__body"> <div class="section__body">
<form method="POST"> <form method="POST">
{{ form.form_select({ {{ form.form_select({
@@ -5,6 +5,14 @@
<div class="section__header"> <div class="section__header">
<h1 class="section__title">{{ _('{0}: Permissions').format(domain.name) }}</h1> <h1 class="section__title">{{ _('{0}: Permissions').format(domain.name) }}</h1>
</div> </div>
{% if roles.length == 3 %}
<div class="section__body typo">
<blockquote class="warn">
<p>{{ _("The 'default' role applies to ALL REGISTERED USER.")|safe }}</p>
<p>{{ _("You may want to create a new role in 'Manage Role' page.")|safe }}</p>
</blockquote>
</div>
{% endif %}
<div class="section__body no-padding domain-users"> <div class="section__body no-padding domain-users">
<table class="data-table"> <table class="data-table">
<colgroup> <colgroup>