mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: better layout for domain_group
This commit is contained in:
1 parent
ca55695498
commit
133afd2296
7 files changed
+27
-13
No files matched your search
@@ -38,7 +38,7 @@ export default class UserSelectAutoComplete<Multi extends boolean> extends AutoC
|
|||||||
<QueryClientProvider client={this.client}>
|
<QueryClientProvider client={this.client}>
|
||||||
<UserSelectAutoCompleteFC
|
<UserSelectAutoCompleteFC
|
||||||
ref={(ref) => { this.ref = ref; }}
|
ref={(ref) => { this.ref = ref; }}
|
||||||
height="34px"
|
height={this.options.height || "34px"}
|
||||||
defaultItems={value}
|
defaultItems={value}
|
||||||
onChange={this.onChange}
|
onChange={this.onChange}
|
||||||
multi={this.options.multi}
|
multi={this.options.multi}
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ export default class Editor extends DOMAttachedObject {
|
|||||||
if (!editorElement) return;
|
if (!editorElement) return;
|
||||||
const lineHeight = this.editor.getOption(monaco.editor.EditorOption.lineHeight);
|
const lineHeight = this.editor.getOption(monaco.editor.EditorOption.lineHeight);
|
||||||
const lineCount = this.editor.getModel()?.getLineCount() || 1;
|
const lineCount = this.editor.getModel()?.getLineCount() || 1;
|
||||||
const height = this.editor.getTopForLineNumber(lineCount + 1) + lineHeight;
|
let height = this.editor.getTopForLineNumber(lineCount + 1) + lineHeight;
|
||||||
|
if (window.innerHeight < height) height = window.innerHeight;
|
||||||
if (prevHeight !== height) {
|
if (prevHeight !== height) {
|
||||||
prevHeight = height;
|
prevHeight = height;
|
||||||
editorElement.style.height = `${height}px`;
|
editorElement.style.height = `${height}px`;
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ Create Discussion: 创建讨论
|
|||||||
Create discussions: 创建讨论
|
Create discussions: 创建讨论
|
||||||
Create Domain: 创建域
|
Create Domain: 创建域
|
||||||
Create File: 创建文件
|
Create File: 创建文件
|
||||||
|
Create Group: 创建小组
|
||||||
Create homework: 创建作业
|
Create homework: 创建作业
|
||||||
Create Homework: 创建作业
|
Create Homework: 创建作业
|
||||||
Create Link: 创建链接
|
Create Link: 创建链接
|
||||||
@@ -328,6 +329,7 @@ fs_upload: 上传文件
|
|||||||
Gender Visibility: 性别可见性
|
Gender Visibility: 性别可见性
|
||||||
Gender: 性别
|
Gender: 性别
|
||||||
Gravatar URL Prefix: Gravatar地址前缀
|
Gravatar URL Prefix: Gravatar地址前缀
|
||||||
|
Group Name: 名称
|
||||||
Hard Deadline: 最终截止时间
|
Hard Deadline: 最终截止时间
|
||||||
Hash: 散列
|
Hash: 散列
|
||||||
Have ALL PERMISSIONS in this domain: 在此域中拥有全部权限
|
Have ALL PERMISSIONS in this domain: 在此域中拥有全部权限
|
||||||
@@ -624,6 +626,7 @@ Rejudge: 重测
|
|||||||
Related Discussions: 相关讨论
|
Related Discussions: 相关讨论
|
||||||
Related: 相关
|
Related: 相关
|
||||||
Remember me: 记住我
|
Remember me: 记住我
|
||||||
|
Remove Selected Group: 移除所选小组
|
||||||
Remove Selected User: 将所选用户移出
|
Remove Selected User: 将所选用户移出
|
||||||
Remove Selected: 移除选中
|
Remove Selected: 移除选中
|
||||||
Remove this data: 移除这组数据
|
Remove this data: 移除这组数据
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.29.6",
|
"version": "4.29.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",
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
.page--domain_group
|
||||||
|
.col--checkbox
|
||||||
|
width: 60px
|
||||||
|
|
||||||
|
.col--group
|
||||||
|
width: 150px
|
||||||
@@ -48,14 +48,14 @@ const page = new NamedPage('domain_group', () => {
|
|||||||
createGroupDialogContent.appendTo(document.body);
|
createGroupDialogContent.appendTo(document.body);
|
||||||
const userSelect = UserSelectAutoComplete.getOrConstruct<UserSelectAutoComplete<true>>(
|
const userSelect = UserSelectAutoComplete.getOrConstruct<UserSelectAutoComplete<true>>(
|
||||||
createGroupDialogContent.find('[name="create_group_users"]'),
|
createGroupDialogContent.find('[name="create_group_users"]'),
|
||||||
{ multi: true },
|
{ multi: true, height: 'auto' },
|
||||||
);
|
);
|
||||||
$('input[data-gid]').get().forEach((ele) => {
|
$('input[data-gid]').get().forEach((ele) => {
|
||||||
const input = UserSelectAutoComplete.getOrConstruct<UserSelectAutoComplete<true>>($(ele), { multi: true });
|
const input = UserSelectAutoComplete.getOrConstruct<UserSelectAutoComplete<true>>($(ele), { multi: true, height: 'auto' });
|
||||||
const gid = ele.getAttribute('data-gid');
|
const gid = ele.getAttribute('data-gid');
|
||||||
let loaded = false;
|
let loaded = false;
|
||||||
input.onChange(() => {
|
input.onChange(() => {
|
||||||
if (input.value.length) {
|
if (input.value().length && !loaded) {
|
||||||
loaded = true;
|
loaded = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -110,11 +110,7 @@ const page = new NamedPage('domain_group', () => {
|
|||||||
const selectedGroups = ensureAndGetSelectedGroups();
|
const selectedGroups = ensureAndGetSelectedGroups();
|
||||||
if (selectedGroups === null) return;
|
if (selectedGroups === null) return;
|
||||||
const action = await new ConfirmDialog({
|
const action = await new ConfirmDialog({
|
||||||
$body: tpl`
|
$body: tpl.typoMsg(i18n('Confirm deleting the selected groups?')),
|
||||||
<div class="typo">
|
|
||||||
<p>${i18n('Confirm deleting the selected groups?')}</p>
|
|
||||||
<p>${i18n('Users with those roles will be removed from the domain.')}</p>
|
|
||||||
</div>`,
|
|
||||||
}).open();
|
}).open();
|
||||||
if (action !== 'yes') return;
|
if (action !== 'yes') return;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
{{ form.form_text({
|
{{ form.form_text({
|
||||||
row:false,
|
row:false,
|
||||||
columns:8,
|
columns:6,
|
||||||
label:'Tags',
|
label:'Tags',
|
||||||
help_text:'Split by \', \'.',
|
help_text:'Split by \', \'.',
|
||||||
name:'tag',
|
name:'tag',
|
||||||
@@ -41,7 +41,15 @@
|
|||||||
}) }}
|
}) }}
|
||||||
{{ form.form_text({
|
{{ form.form_text({
|
||||||
row:false,
|
row:false,
|
||||||
columns:4,
|
columns:3,
|
||||||
|
label:'Assign',
|
||||||
|
help_text:'Assigned groups',
|
||||||
|
name:'assign',
|
||||||
|
value:pdoc.assign|default([])|join(', ')
|
||||||
|
}) }}
|
||||||
|
{{ form.form_text({
|
||||||
|
row:false,
|
||||||
|
columns:3,
|
||||||
label:'Difficulty',
|
label:'Difficulty',
|
||||||
help_text:'From 1-10',
|
help_text:'From 1-10',
|
||||||
name:'difficulty',
|
name:'difficulty',
|
||||||
|
|||||||
Reference in new issue
Block a user