From 8e8ab22561ca391561e44a0daac91978436d930f Mon Sep 17 00:00:00 2001 From: undefined Date: Fri, 28 Mar 2025 20:49:47 +0800 Subject: [PATCH] ui: domain_user: add join domain hint --- packages/ui-default/locales/ko.yaml | 5 ++--- packages/ui-default/locales/zh.yaml | 3 +++ packages/ui-default/locales/zh_TW.yaml | 3 +++ packages/ui-default/pages/domain_user.page.js | 16 +++++++++++++++- packages/ui-default/templates/domain_user.html | 2 +- .../templates/partials/contest_sidebar.html | 6 ++++++ .../templates/partials/homework_sidebar.html | 4 ++++ 7 files changed, 34 insertions(+), 5 deletions(-) diff --git a/packages/ui-default/locales/ko.yaml b/packages/ui-default/locales/ko.yaml index 1301dfdc3..6c3c644e2 100644 --- a/packages/ui-default/locales/ko.yaml +++ b/packages/ui-default/locales/ko.yaml @@ -32,6 +32,7 @@ __langname: 한국어 'Join {0}': '참여 {0}' 'No': 아니오 'Note: Problem title may not be hidden.': '주의: 문제 제목은 숨길 수 없습니다.' +'Or use the following link:': '또는 다음 링크를 사용하세요:' 'Role {1} already exists in domain {0}.': '역할 {1}이(가) 이미 {0}에 존재합니다.' 'Solved {0} problems, RP: {1} (No. {2})': '총 {0} 문제 해결.RP: {1} (No. {2})' 'The value `{1}` of {0} already exists.': '{0} 의 값 `{1}` 이 이미 존재합니다.' @@ -42,9 +43,6 @@ __langname: 한국어 (All Problems): (전체 문제) (None): (N/A) (Not changed): 수정되지 않음 -#Sample Input: Sample Input -#Sample Output: Sample Output -#Star: Star Aborted: 중지됨 About {0}: '{0}에 대하여' About Markdown: Markdown에 대하여 @@ -758,6 +756,7 @@ User-defined role: 사용자 지정 역할 User: 사용자 Username / UID: 아이디 Username: 아이디 +Users will have to manually join the domain first before selected roles can be applied.: 사용자는 먼저 도메인에 수동으로 참여해야 선택된 역할을 적용할 수 있습니다. Users with those roles will be removed from the domain.: 이 역할을 가진 사용자들이 그룹에서 제거될 것입니다. Users: 사용자 Using your {0} universal account: '{0} 공용 계정을 사용' diff --git a/packages/ui-default/locales/zh.yaml b/packages/ui-default/locales/zh.yaml index c9aa029f1..470317b2d 100644 --- a/packages/ui-default/locales/zh.yaml +++ b/packages/ui-default/locales/zh.yaml @@ -38,6 +38,7 @@ __langname: 简体中文 'Join {0}': '加入 {0}' 'No': 否 'Note: Problem title may not be hidden.': 注意:题目标题可能不会被隐藏。 +'Or use the following link:': 或使用以下链接: 'Packages have new version: {0}': '以下组件有新版本: {0}' 'Please use your two factor authentication app to scan the qrcode below:': '请使用你的两步验证APP扫描此二维码:' 'Role {1} already exists in domain {0}.': '域 {0} 中已存在角色 {1}。' @@ -943,6 +944,7 @@ Timezone: 时区 title: 标题 Title: 标题 To get a better editing experience, with code highlighting and test runs, please go back to the problem detail page and use 'Open Scratchpad' button.: 为了获得更好的编辑体验,包括代码高亮和测试运行功能,请返回题目详情页面并点击“进入在线编程模式”按钮。 +To join the domain, users can click the "Join Domain" button on "My Domain" page.: 要加入域,用户可以点击“我的域”页面中的“加入域”按钮。 Toggle Pretest Panel: 切换自测面板 Toggle Preview: 切换预览 Toggle Records Panel: 切换评测记录面板 @@ -1009,6 +1011,7 @@ User-defined role: 用户定义的角色 User: 用户 Username / UID: 用户名或 UID Username: 用户名 +Users will have to manually join the domain first before selected roles can be applied.: 用户需要先手动加入域才能应用此角色分配。 Users with those roles will be removed from the domain.: 拥有这些角色的用户将从此域中移除。 Users: 用户 Using your {0} universal account: 使用您的 {0} 通用账户 diff --git a/packages/ui-default/locales/zh_TW.yaml b/packages/ui-default/locales/zh_TW.yaml index f2807bf23..3f63e0b1b 100644 --- a/packages/ui-default/locales/zh_TW.yaml +++ b/packages/ui-default/locales/zh_TW.yaml @@ -21,6 +21,7 @@ __langname: 正體中文 'Hello, {0}! You can click following link to reset the password of your {1} account:': 您好,{0}!您可以點選以下連結來重置您 {1} 賬戶的密碼: 'Hello! You can click following link to sign up your {0} account:': 您好!您可以點選以下連結來註冊您的 {0} 賬戶: 'No': 否 +'Or use the following link:': 或使用以下連結: 'Solved {0} problems, RP: {1} (No. {2})': '解決了 {0} 道題目,RP: {1} (No. {2})' 'Yes': 是 (None): (無) @@ -480,6 +481,7 @@ timeago_locale: zh_TW Timezone: 時區 title: 標題 Title: 標題 +To join the domain, users can click the "Join Domain" button on "My Domain" page.: 要加入域,用戶可以點擊“我的域”頁面中的“加入域”按鈕。 Toggle Pretest Panel: 切換自測面板 Toggle Records Panel: 切換評測記錄面板 Total Score: 總分 @@ -510,6 +512,7 @@ User-defined role: 使用者定義的角色 User: 使用者 Username / UID: 使用者名或 UID Username: 使用者名 +Users will have to manually join the domain first before selected roles can be applied.: 用戶需要先手動加入域才能應用此角色分配。 Users with those roles will be removed from the domain.: 擁有這些角色的使用者將從此域中移除。 Users: 使用者 Using your {0} universal account: 使用您的 {0} 通用賬戶 diff --git a/packages/ui-default/pages/domain_user.page.js b/packages/ui-default/pages/domain_user.page.js index 11c804548..345fa1ea5 100644 --- a/packages/ui-default/pages/domain_user.page.js +++ b/packages/ui-default/pages/domain_user.page.js @@ -1,7 +1,7 @@ import $ from 'jquery'; import _ from 'lodash'; import UserSelectAutoComplete from 'vj/components/autocomplete/UserSelectAutoComplete'; -import { ActionDialog, ConfirmDialog } from 'vj/components/dialog'; +import { ActionDialog, ConfirmDialog, InfoDialog } from 'vj/components/dialog'; import Notification from 'vj/components/notification'; import { NamedPage } from 'vj/misc/Page'; import { @@ -9,6 +9,20 @@ import { } from 'vj/utils'; const page = new NamedPage('domain_user', () => { + $('.not-joined').data('tooltip', i18n('Click to view detailed instructions.')); + $('.not-joined').addClass('text-orange'); + $(document).on('click', '.not-joined', () => { + new InfoDialog({ + $body: tpl` +
+

${i18n('Users will have to manually join the domain first before selected roles can be applied.')}

+

${i18n('To join the domain, users can click the "Join Domain" button on "My Domain" page.')}

+

${i18n('Or use the following link:')}

+

/domain/join?target=${UiContext.domain._id}

+
`, + }).open(); + }); + const addUserSelector = UserSelectAutoComplete.getOrConstruct($('.dialog__body--add-user [name="user"]')); const addUserDialog = new ActionDialog({ $body: $('.dialog__body--add-user > div'), diff --git a/packages/ui-default/templates/domain_user.html b/packages/ui-default/templates/domain_user.html index 090cff332..e45d804d0 100644 --- a/packages/ui-default/templates/domain_user.html +++ b/packages/ui-default/templates/domain_user.html @@ -83,7 +83,7 @@ {% set is_disabled=(rudoc._id == handler.user._id) %} [{{udoc._id}}]{{ user.render_inline(udoc, avatar=false, badge=false) }}{% if not udoc.join %} - ({{ _('Not joined yet') }}) + ({{ _('Not joined yet') }}) {% endif %}    {%- endfor -%} diff --git a/packages/ui-default/templates/partials/contest_sidebar.html b/packages/ui-default/templates/partials/contest_sidebar.html index a052630c6..40d0af245 100644 --- a/packages/ui-default/templates/partials/contest_sidebar.html +++ b/packages/ui-default/templates/partials/contest_sidebar.html @@ -26,6 +26,9 @@ {% if not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %} + {% elif not handler.user._dudoc.join %} + {% else %} @@ -51,6 +54,9 @@ {{ _('Login to Attend Contest') }} + {% elif not handler.user._dudoc.join %} + {% else %} {{ _('No Permission to Attend Contest') }} diff --git a/packages/ui-default/templates/partials/homework_sidebar.html b/packages/ui-default/templates/partials/homework_sidebar.html index bf55b7b62..9e1eaed3b 100644 --- a/packages/ui-default/templates/partials/homework_sidebar.html +++ b/packages/ui-default/templates/partials/homework_sidebar.html @@ -35,6 +35,10 @@ {{ _('Login to Claim Homework') }} + {% elif not handler.user._dudoc.join %} + + {{ _('Join Domain to Claim Homework') }} + {% else %} {{ _('No Permission to Claim Homework') }}