core: fix owner display on problem & contest (#614)

pull/621/head^2
panda 1 year ago committed by GitHub
parent f79f3d2d79
commit b73afc7af6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -173,6 +173,7 @@ class DiscussionDetailHandler extends DiscussionHandler {
system.get('pagination.reply'),
);
const uids = [
...this.vnode.owner ? [this.vnode.owner] : [],
this.ddoc.owner,
...drdocs.map((drdoc) => drdoc.owner),
];

@ -376,6 +376,7 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
solutionCount: scnt,
discussionCount: dcnt,
tdoc: this.tdoc,
owner_udoc: (tid && this.tdoc.owner !== this.pdoc.owner) ? await user.getById(domainId, this.tdoc.owner) : null,
};
if (this.tdoc && this.tsdoc) {
const fields = ['attend', 'startAt'];

@ -41,7 +41,7 @@
</div>
<div class="medium-3 columns">
{% set owner_udoc = udict[tdoc.owner] %}
{% include "partials/contest_sidebar.html" %}
{% include "partials/contest_sidebar_management.html" %}
</div>
</div>
{% endblock %}

@ -1,7 +1,7 @@
{% if not owner_udoc %}
{% set owner_udoc = udoc %}
{% endif %}
{% if tdoc %}
{% if not owner_udoc %}
{% set owner_udoc = udoc %}
{% endif %}
{% if tdoc.rule == 'homework' %}
{% include "partials/problem_sidebar_homework.html" %}
{% include "partials/homework_sidebar.html" %}

@ -32,7 +32,6 @@
{% set filetype = "testdata" %}
{% include "partials/problem_files.html" %}
</div>
{% set owner_udoc = udoc %}
{% include "partials/problem_sidebar.html" %}
</div>
</div>

@ -111,7 +111,6 @@
</div>
</div>
<div class="medium-3 columns"><div data-sticky="large">
{% set owner_udoc = udoc %}
{% include "partials/problem_sidebar.html" %}
</div></div>
</div>

@ -110,7 +110,6 @@
{% set filetype = "additional_file" %}
{% include "partials/problem_files.html" %}
</div>
{% set owner_udoc = udoc %}
{% include "partials/problem_sidebar.html" %}
{% else %}
{% include 'components/md_hint.html' %}

@ -48,7 +48,6 @@
</div>
</div>
<div class="medium-3 columns">
{% set owner_udoc = udoc %}
{% include "partials/problem_sidebar.html" %}
</div>
</div>

@ -24,7 +24,6 @@
</div>
</div>
<div class="medium-3 columns">
{% set owner_udoc = udoc %}
{% include "partials/problem_sidebar.html" %}
</div>
</div>

@ -33,7 +33,6 @@
</div>
</div>
<div class="medium-3 columns">
{% set owner_udoc = udoc %}
{% include "partials/problem_sidebar.html" %}
</div>
</div>

Loading…
Cancel
Save