ui: add warning for domain_role

pull/311/head
undefined 3 years ago
parent 70e011105a
commit a1d1aa40ba

@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.4.30",
"version": "3.4.31",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",

@ -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) {

@ -753,6 +753,7 @@ Test data comes from: 测试数据来自
Testdata Config: 测试数据配置
Testdata: 测试数据
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 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.: 您没有登录。

@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.32.6",
"version": "4.32.7",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",

@ -2,29 +2,37 @@
{% block domain_content %}
{% if joinSettings %}
<div class="section">
<div class="section__header">
<h1 class="section__title">{{ _('Information') }}</h1>
</div>
<div class="section__body typo">
<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>
<div class="section__header">
<h1 class="section__title">{{ _('Information') }}</h1>
</div>
<div class="section__body typo">
<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>
{% if joinSettings['method'] == model.domain.JOIN_METHOD_CODE %}
<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>
{% endif %}
{% if not joinSettings['expire'] %}
{% if joinSettings.expire %}
<br/>
<blockquote class="note">
{{ (_('The link will be expired at {0}').format(datetimeSpan(joinSettings.expire, relative=false)))|safe }}
</blockquote>
{% endif %}
</div>
</div>
</div>
{% endif %}
<div class="section">
<div class="section__header">
<h1 class="section__title">{{ _('Settings') }}</h1>
</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">
<form method="POST">
{{ form.form_select({

@ -5,6 +5,14 @@
<div class="section__header">
<h1 class="section__title">{{ _('{0}: Permissions').format(domain.name) }}</h1>
</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">
<table class="data-table">
<colgroup>

Loading…
Cancel
Save