mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core&ui: fix bugs (#672)
Co-authored-by: panda <panda_dtdyy@outlook.com>
This commit is contained in:
1 parent
afbf3b6174
commit
f305cbfc60
6 files changed
+15
-7
No files matched your search
@@ -162,6 +162,7 @@ export class ContestDetailBaseHandler extends Handler {
|
||||
checker: () => contest.canShowScoreboard.call(this, this.tdoc, true),
|
||||
},
|
||||
{
|
||||
name: 'problem_detail',
|
||||
displayName: `${String.fromCharCode(65 + this.tdoc.pids.indexOf(pdoc.docId))}. ${pdoc.title}`,
|
||||
args: { query: { tid }, pid: pdoc.docId, prefix: 'contest_detail_problem' },
|
||||
checker: () => 'pdoc' in this,
|
||||
|
||||
@@ -344,6 +344,7 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
|
||||
const pdoc = await problem.get(this.pdoc.reference.domainId, this.pdoc.reference.pid);
|
||||
if (!ddoc || !pdoc) throw new ProblemNotFoundError(this.pdoc.reference.domainId, this.pdoc.reference.pid);
|
||||
this.pdoc.config = pdoc.config;
|
||||
this.pdoc.additional_file = pdoc.additional_file;
|
||||
}
|
||||
if (typeof this.pdoc.config !== 'string') {
|
||||
let baseLangs;
|
||||
@@ -384,7 +385,8 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
|
||||
const fields = ['attend', 'startAt'];
|
||||
if (this.tdoc.duration) fields.push('endAt');
|
||||
if (contest.canShowSelfRecord.call(this, this.tdoc, true)) fields.push('detail');
|
||||
this.response.body.tsdoc = pick(this.tsdoc, fields);
|
||||
this.tsdoc = pick(this.tsdoc, fields);
|
||||
this.response.body.tsdoc = this.tsdoc;
|
||||
}
|
||||
this.response.template = 'problem_detail.html';
|
||||
this.UiContext.extraTitleContent = this.pdoc.title;
|
||||
@@ -502,6 +504,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
|
||||
pdoc: this.pdoc,
|
||||
udoc: this.udoc,
|
||||
tdoc: this.tdoc,
|
||||
tsdoc: this.tsdoc,
|
||||
title: this.pdoc.title,
|
||||
page_name: this.tdoc
|
||||
? this.tdoc.rule === 'homework'
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
{% include "partials/problem_sidebar.html" %}
|
||||
{% elif vnode.type == model.document.TYPE_CONTEST %}
|
||||
{% set tdoc = vnode %}
|
||||
{%- if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) -%}
|
||||
{% set tsdoc = { attend: tdoc.attend } %}
|
||||
{%- endif -%}
|
||||
{% set owner_udoc = udict[vnode.owner] %}
|
||||
{% include "partials/contest_sidebar.html" %}
|
||||
{% else %}
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
<blockquote class="note">
|
||||
<p>{{ _('This is a copy of another problem.') }}</p>
|
||||
</blockquote>
|
||||
{% elif _files.length %}
|
||||
{% endif %}
|
||||
{% if _files.length %}
|
||||
<table class="data-table {{ filetype }}-table">
|
||||
<colgroup>
|
||||
{% if not sidebar %}<col class="col--checkbox">{% endif %}
|
||||
@@ -53,7 +54,7 @@
|
||||
{%- endfor -%}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
{% elif not reference %}
|
||||
{{ nothing.render('No {0} at current.', compact=sidebar, args=[_(filetype)]) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _('Files') }}</h1>
|
||||
<div class="section__tools">
|
||||
{% if handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
||||
{% if (handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM)) and not reference %}
|
||||
<button class="primary rounded button" name="create_file">{{ _('Create File') }}</button>
|
||||
<button class="primary rounded button" name="upload_file">{{ _('Upload File') }}</button>
|
||||
{% endif %}
|
||||
@@ -41,7 +41,7 @@
|
||||
{% include "partials/problem_files.html" %}
|
||||
<div class="section__body">
|
||||
<button class="rounded button" name="download_selected_file">{{ _('Download Selected') }}</button>
|
||||
{% if handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
||||
{% if (handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM)) and not reference %}
|
||||
<button class="rounded button" name="remove_selected_file">{{ _('Remove Selected') }}</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
</div>
|
||||
<div class="balancer__body">
|
||||
<div class="numbox">
|
||||
<div class="numbox__num medium">{{ udoc.nLiked or 0 }}</div>
|
||||
<div class="numbox__num medium">{{ udoc.nLike or 0 }}</div>
|
||||
<div class="numbox__text">{{ _('Solutions Liked') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user