mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: fix bugs and add hint (#635)
Co-authored-by: panda <panda_dtdyy@outlook.com>
This commit is contained in:
1 parent
e02d8b5d43
commit
7687b99f07
13 files changed
+47
-15
No files matched your search
@@ -42,11 +42,13 @@ homework_main: Homework
|
|||||||
homework_scoreboard: Scoreboard
|
homework_scoreboard: Scoreboard
|
||||||
judge_playground: Judge Playground
|
judge_playground: Judge Playground
|
||||||
main: Home
|
main: Home
|
||||||
|
manage_config: System Configurations
|
||||||
manage_dashboard: System
|
manage_dashboard: System
|
||||||
manage_module: Module Management
|
manage_module: Module Management
|
||||||
manage_script: Scripts
|
manage_script: Scripts
|
||||||
manage_setting: System Settings
|
manage_setting: System Settings
|
||||||
manage_user_import: Import Users
|
manage_user_import: Import Users
|
||||||
|
manage_user_priv: User Privilege
|
||||||
manage: System Manage
|
manage: System Manage
|
||||||
no_translation_warn: <blockquote class="warn">This part of content is under translation.</blockquote>
|
no_translation_warn: <blockquote class="warn">This part of content is under translation.</blockquote>
|
||||||
page.problem_detail.sidebar.show_category: Click to Show
|
page.problem_detail.sidebar.show_category: Click to Show
|
||||||
|
|||||||
@@ -322,7 +322,10 @@ class DiscussionDetailHandler extends DiscussionHandler {
|
|||||||
@param('drrid', Types.ObjectId)
|
@param('drrid', Types.ObjectId)
|
||||||
async postDeleteTailReply(domainId: string, drid: ObjectId, drrid: ObjectId) {
|
async postDeleteTailReply(domainId: string, drid: ObjectId, drrid: ObjectId) {
|
||||||
const deleteBy = this.user.own(this.drrdoc) ? 'self' : 'Admin';
|
const deleteBy = this.user.own(this.drrdoc) ? 'self' : 'Admin';
|
||||||
if (!this.user.own(this.drrdoc)) this.checkPerm(PERM.PERM_DELETE_DISCUSSION_REPLY);
|
if (!(this.user.own(this.drrdoc)
|
||||||
|
&& this.user.hasPerm(PERM.PERM_DELETE_DISCUSSION_REPLY_SELF))) {
|
||||||
|
this.checkPerm(PERM.PERM_DELETE_DISCUSSION_REPLY);
|
||||||
|
}
|
||||||
const msg = JSON.stringify({
|
const msg = JSON.stringify({
|
||||||
message: 'Admin {0} delete your discussion tail reply {1} in "{2}"({3:link}).',
|
message: 'Admin {0} delete your discussion tail reply {1} in "{2}"({3:link}).',
|
||||||
params: [
|
params: [
|
||||||
|
|||||||
@@ -40,8 +40,9 @@ $font-size-icon = 16px
|
|||||||
$font-size-title = 20px
|
$font-size-title = 20px
|
||||||
|
|
||||||
// components
|
// components
|
||||||
$section-gap-v = 25px
|
$section-gap-v = 15px
|
||||||
$section-gap-h = $grid-padding
|
$section-gap-h = $grid-padding
|
||||||
|
$section-list-v = 25px
|
||||||
$section-margin = 30px
|
$section-margin = 30px
|
||||||
$section-shadow = rem(0 6px 22px) rgba(#AFC2C9, 0.5)
|
$section-shadow = rem(0 6px 22px) rgba(#AFC2C9, 0.5)
|
||||||
$section-bg-color = $content-bg-color
|
$section-bg-color = $content-bg-color
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
.hint
|
||||||
|
font-size: $font-size-small
|
||||||
|
position: relative
|
||||||
|
top: $nav-item-height
|
||||||
|
z-index: 99
|
||||||
|
left: 0
|
||||||
|
width: 100%
|
||||||
|
color: #e58900
|
||||||
|
background: #fff0e3;
|
||||||
@@ -59,8 +59,10 @@ class LegacyModeHandler extends Handler {
|
|||||||
noCheckPermView = true;
|
noCheckPermView = true;
|
||||||
|
|
||||||
@param('legacy', Types.Boolean)
|
@param('legacy', Types.Boolean)
|
||||||
async get(domainId: string, legacy = false) {
|
@param('nohint', Types.Boolean)
|
||||||
|
async get(domainId: string, legacy = false, nohint = false) {
|
||||||
this.session.legacy = legacy;
|
this.session.legacy = legacy;
|
||||||
|
this.session.nohint = nohint;
|
||||||
this.back();
|
this.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -484,6 +484,7 @@ Learn More: 了解更多
|
|||||||
Leave blank to use numeric pid.: 留空来使用数字题号。
|
Leave blank to use numeric pid.: 留空来使用数字题号。
|
||||||
Leave empty for default: 留空以使用默认
|
Leave empty for default: 留空以使用默认
|
||||||
Ledo: 乐多
|
Ledo: 乐多
|
||||||
|
Legacy mode: 兼容模式
|
||||||
Light: 亮色
|
Light: 亮色
|
||||||
Limit user to finish contest within N hours: 限制用户在N小时内完成比赛
|
Limit user to finish contest within N hours: 限制用户在N小时内完成比赛
|
||||||
Limitations: 限制
|
Limitations: 限制
|
||||||
@@ -817,6 +818,7 @@ Sorry, there are no users in this domain.: 对不起,此域中没有用户。
|
|||||||
Sorry: 对不起
|
Sorry: 对不起
|
||||||
Sort by: 排序
|
Sort by: 排序
|
||||||
Source type: 来源类型
|
Source type: 来源类型
|
||||||
|
Standard mode: 标准模式
|
||||||
Star Topic: 收藏讨论
|
Star Topic: 收藏讨论
|
||||||
Star: 收藏
|
Star: 收藏
|
||||||
Starred Users: 关注用户
|
Starred Users: 关注用户
|
||||||
@@ -1005,6 +1007,7 @@ With this feature, you can copy problems that you can view from a domain to some
|
|||||||
Write Your Comment: 发表您的评论
|
Write Your Comment: 发表您的评论
|
||||||
Write Your Solution: 发表您的题解
|
Write Your Solution: 发表您的题解
|
||||||
Year: 年
|
Year: 年
|
||||||
|
You are currently in legacy mode. Some additional features will be unavailable. We strongly recommend switching to standard mode on a modern browser.: 您当前处于兼容模式。某些功能在此模式下不可用。我们强烈建议在现代浏览器上切换为标准模式以获得更好的体验。
|
||||||
You are not allowed to join the domain. The link is either invalid or expired.: 您无法加入该域,链接无效或已过期。
|
You are not allowed to join the domain. The link is either invalid or expired.: 您无法加入该域,链接无效或已过期。
|
||||||
You can also upload your avatar to Gravatar and it will be automatically updated here.: 你也可以将头像上传到 <a href="https://gravatar.com/">Gravatar</a>,本站的头像将自动更新。
|
You can also upload your avatar to Gravatar and it will be automatically updated here.: 你也可以将头像上传到 <a href="https://gravatar.com/">Gravatar</a>,本站的头像将自动更新。
|
||||||
You can create your own training plans and share them with others.: 您可以创建您自己的训练计划并且与他人分享。
|
You can create your own training plans and share them with others.: 您可以创建您自己的训练计划并且与他人分享。
|
||||||
|
|||||||
@@ -33,6 +33,12 @@
|
|||||||
padding: rem($section-gap-v) rem($section-gap-h) 0
|
padding: rem($section-gap-v) rem($section-gap-h) 0
|
||||||
position: relative
|
position: relative
|
||||||
|
|
||||||
|
&:last-child
|
||||||
|
padding-bottom: rem($section-gap-v)
|
||||||
|
|
||||||
|
+.section__body.no-padding:last-child
|
||||||
|
padding-top: rem($section-gap-v) !important
|
||||||
|
|
||||||
.section__body
|
.section__body
|
||||||
padding: 0.7em rem($section-gap-h)
|
padding: 0.7em rem($section-gap-h)
|
||||||
|
|
||||||
@@ -92,7 +98,7 @@ h3.section__title
|
|||||||
color: $section-toolbtn-color-hover
|
color: $section-toolbtn-color-hover
|
||||||
|
|
||||||
.section__list__item
|
.section__list__item
|
||||||
padding: rem($section-gap-v $section-gap-h)
|
padding: rem($section-list-v $section-gap-h)
|
||||||
border-bottom: 1px solid $table-border-color
|
border-bottom: 1px solid $table-border-color
|
||||||
|
|
||||||
&:last-child
|
&:last-child
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ export default new NamedPage(['problem_create', 'problem_edit'], (pagename) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleClickDownloadAll() {
|
async function handleClickDownloadAll() {
|
||||||
const files = $('.additionalfile-table tr').map(function () { return $(this).attr('data-filename'); }).get();
|
const files = $('.additional_file-table tr').map(function () { return $(this).attr('data-filename'); }).get();
|
||||||
const { links, pdoc } = await request.post('./files', { operation: 'get_links', files, type: 'additional_file' });
|
const { links, pdoc } = await request.post('./files', { operation: 'get_links', files, type: 'additional_file' });
|
||||||
const targets = [];
|
const targets = [];
|
||||||
for (const filename of Object.keys(links)) targets.push({ filename, url: links[filename] });
|
for (const filename of Object.keys(links)) targets.push({ filename, url: links[filename] });
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ function hideTags(target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const categoryDialog: any = new Dialog({
|
const categoryDialog: any = new Dialog({
|
||||||
$body: $('.dialog--category-filter'),
|
$body: $('.dialog--category-filter > div'),
|
||||||
cancelByClickingBack: true,
|
cancelByClickingBack: true,
|
||||||
cancelByEsc: true,
|
cancelByEsc: true,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,12 +14,10 @@
|
|||||||
comment_ref,
|
comment_ref,
|
||||||
reply_ref,
|
reply_ref,
|
||||||
comment_post_perm,
|
comment_post_perm,
|
||||||
comment_edit_perm,
|
|
||||||
comment_edit_self_perm,
|
comment_edit_self_perm,
|
||||||
comment_delete_perm,
|
comment_delete_perm,
|
||||||
comment_delete_self_perm,
|
comment_delete_self_perm,
|
||||||
reply_post_perm,
|
reply_post_perm,
|
||||||
reply_edit_perm,
|
|
||||||
reply_edit_self_perm,
|
reply_edit_self_perm,
|
||||||
reply_delete_perm,
|
reply_delete_perm,
|
||||||
reply_delete_self_perm,
|
reply_delete_self_perm,
|
||||||
@@ -101,7 +99,7 @@
|
|||||||
{% if handler.user.hasPerm(reply_post_perm) %}
|
{% if handler.user.hasPerm(reply_post_perm) %}
|
||||||
{{ action(_('Reply'), 'reply', 'comment', {operation: reply_post_op, drid: doc._id}, 'reply') }}
|
{{ action(_('Reply'), 'reply', 'comment', {operation: reply_post_op, drid: doc._id}, 'reply') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if (handler.user.hasPerm(comment_edit_self_perm) and handler.user.own(doc)) or handler.user.hasPerm(comment_edit_perm) %}
|
{% if handler.user.hasPerm(comment_edit_self_perm) and handler.user.own(doc) %}
|
||||||
{{ action(_('Edit'), 'edit', 'comment', {operation: comment_edit_op, drid: doc._id}, 'edit') }}
|
{{ action(_('Edit'), 'edit', 'comment', {operation: comment_edit_op, drid: doc._id}, 'edit') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if (handler.user.hasPerm(comment_delete_self_perm) and handler.user.own(doc)) or handler.user.hasPerm(comment_delete_perm) %}
|
{% if (handler.user.hasPerm(comment_delete_self_perm) and handler.user.own(doc)) or handler.user.hasPerm(comment_delete_perm) %}
|
||||||
@@ -142,10 +140,10 @@
|
|||||||
{% if handler.user.hasPerm(reply_post_perm) %}
|
{% if handler.user.hasPerm(reply_post_perm) %}
|
||||||
{{ action(_('Reply'), 'reply', 'reply', {}, 'reply') }}
|
{{ action(_('Reply'), 'reply', 'reply', {}, 'reply') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if handler.user.own(doc) or handler.user.hasPerm(reply_edit_perm) %}
|
{% if handler.user.own(rdoc) and handler.user.hasPerm(reply_edit_self_perm) %}
|
||||||
{{ action(_('Edit'), 'edit', 'reply', {operation: reply_edit_op, drid: doc._id, drrid: rdoc._id}, 'edit') }}
|
{{ action(_('Edit'), 'edit', 'reply', {operation: reply_edit_op, drid: doc._id, drrid: rdoc._id}, 'edit') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if handler.user.own(doc) or handler.user.hasPerm(reply_delete_perm) %}
|
{% if (handler.user.own(rdoc) and handler.user.hasPerm(reply_delete_self_perm)) or handler.user.hasPerm(reply_delete_perm) %}
|
||||||
{{ action(_('Delete'), 'delete', 'reply', {operation: reply_delete_op, drid: doc._id, drrid: rdoc._id}, 'delete') }}
|
{{ action(_('Delete'), 'delete', 'reply', {operation: reply_delete_op, drid: doc._id, drrid: rdoc._id}, 'delete') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -91,13 +91,11 @@
|
|||||||
reply_edit_op = 'edit_tail_reply',
|
reply_edit_op = 'edit_tail_reply',
|
||||||
reply_delete_op = 'delete_tail_reply',
|
reply_delete_op = 'delete_tail_reply',
|
||||||
comment_post_perm = perm.PERM_REPLY_DISCUSSION,
|
comment_post_perm = perm.PERM_REPLY_DISCUSSION,
|
||||||
comment_edit_perm = perm.PERM_NEVER,
|
|
||||||
comment_delete_perm = perm.PERM_DELETE_DISCUSSION_REPLY_SELF_DISCUSSION if handler.user.own(ddoc) else perm.PERM_DELETE_DISCUSSION_REPLY,
|
comment_delete_perm = perm.PERM_DELETE_DISCUSSION_REPLY_SELF_DISCUSSION if handler.user.own(ddoc) else perm.PERM_DELETE_DISCUSSION_REPLY,
|
||||||
comment_edit_self_perm = perm.PERM_EDIT_DISCUSSION_REPLY_SELF,
|
comment_edit_self_perm = perm.PERM_EDIT_DISCUSSION_REPLY_SELF,
|
||||||
comment_delete_self_perm = perm.PERM_DELETE_DISCUSSION_REPLY_SELF,
|
comment_delete_self_perm = perm.PERM_DELETE_DISCUSSION_REPLY_SELF,
|
||||||
reply_post_perm = perm.PERM_REPLY_DISCUSSION,
|
reply_post_perm = perm.PERM_REPLY_DISCUSSION,
|
||||||
reply_edit_perm = perm.PERM_NEVER,
|
reply_delete_perm = perm.PERM_DELETE_DISCUSSION_REPLY,
|
||||||
reply_delete_perm = perm.PERM_DELETE_DISCUSSION_REPLY_SELF_DISCUSSION if handler.user.own(ddoc) else perm.PERM_DELETE_DISCUSSION_REPLY,
|
|
||||||
reply_edit_self_perm = perm.PERM_EDIT_DISCUSSION_REPLY_SELF,
|
reply_edit_self_perm = perm.PERM_EDIT_DISCUSSION_REPLY_SELF,
|
||||||
reply_delete_self_perm = perm.PERM_DELETE_DISCUSSION_REPLY_SELF,
|
reply_delete_self_perm = perm.PERM_DELETE_DISCUSSION_REPLY_SELF,
|
||||||
reactions = reactions,
|
reactions = reactions,
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
{% block body %}
|
{% block body %}
|
||||||
{% if UserContext %}{% include "partials/nav.html" %}{% endif %}
|
{% if UserContext %}{% include "partials/nav.html" %}{% endif %}
|
||||||
<div class="slideout-panel" id="panel">
|
<div class="slideout-panel" id="panel">
|
||||||
|
{% if handler.session.legacy and not handler.session.nohint %}
|
||||||
|
<div class="typo hint flex-row flex-main-center flex-cross-center">
|
||||||
|
<p>
|
||||||
|
{{ _('You are currently in legacy mode. Some additional features will be unavailable. We strongly recommend switching to standard mode on a modern browser.') }}
|
||||||
|
<a href="/legacy">{{ _('Standard mode') }}</a> <a href="/legacy?legacy=true&nohint=true">{{ _('Hidden') }}</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="slideout-overlay"></div>
|
<div class="slideout-overlay"></div>
|
||||||
{% if UserContext %}{% include "partials/header_mobile.html" %}{% endif %}
|
{% if UserContext %}{% include "partials/header_mobile.html" %}{% endif %}
|
||||||
<div class="main">
|
<div class="main">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{% set _categories = (handler.domain.problemCategories or model.system.get('problem.categories'))|parseYaml %}
|
{% set _categories = (handler.domain.problemCategories or model.system.get('problem.categories'))|parseYaml %}
|
||||||
<div class="dialog--category-filter">
|
<div class="dialog--category-filter" style="display:none;">
|
||||||
|
<div>
|
||||||
<div class="category-filter__header">
|
<div class="category-filter__header">
|
||||||
<div class="list flex-row flex-cross-center" data-category-container>
|
<div class="list flex-row flex-cross-center" data-category-container>
|
||||||
{%- for category, sub_categories in _categories -%}
|
{%- for category, sub_categories in _categories -%}
|
||||||
@@ -39,3 +40,4 @@
|
|||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
Reference in new issue
Block a user