diff --git a/packages/hydrooj/src/handler/discussion.ts b/packages/hydrooj/src/handler/discussion.ts index ad140c8a..213ecbfd 100644 --- a/packages/hydrooj/src/handler/discussion.ts +++ b/packages/hydrooj/src/handler/discussion.ts @@ -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), ]; diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index 0d49eb20..ad724b5f 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -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']; diff --git a/packages/ui-default/templates/contest_user.html b/packages/ui-default/templates/contest_user.html index 5641730d..a538adbc 100644 --- a/packages/ui-default/templates/contest_user.html +++ b/packages/ui-default/templates/contest_user.html @@ -41,7 +41,7 @@
{% set owner_udoc = udict[tdoc.owner] %} - {% include "partials/contest_sidebar.html" %} + {% include "partials/contest_sidebar_management.html" %}
{% endblock %} diff --git a/packages/ui-default/templates/partials/problem_sidebar.html b/packages/ui-default/templates/partials/problem_sidebar.html index 918a6e52..c3d8fc2b 100644 --- a/packages/ui-default/templates/partials/problem_sidebar.html +++ b/packages/ui-default/templates/partials/problem_sidebar.html @@ -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" %} diff --git a/packages/ui-default/templates/problem_config.html b/packages/ui-default/templates/problem_config.html index 611df399..dff8e7ba 100644 --- a/packages/ui-default/templates/problem_config.html +++ b/packages/ui-default/templates/problem_config.html @@ -32,7 +32,6 @@ {% set filetype = "testdata" %} {% include "partials/problem_files.html" %} - {% set owner_udoc = udoc %} {% include "partials/problem_sidebar.html" %} diff --git a/packages/ui-default/templates/problem_detail.html b/packages/ui-default/templates/problem_detail.html index 08a81d90..2e9b93b3 100644 --- a/packages/ui-default/templates/problem_detail.html +++ b/packages/ui-default/templates/problem_detail.html @@ -111,7 +111,6 @@
- {% set owner_udoc = udoc %} {% include "partials/problem_sidebar.html" %}
diff --git a/packages/ui-default/templates/problem_edit.html b/packages/ui-default/templates/problem_edit.html index 8db72bc3..43f95bad 100644 --- a/packages/ui-default/templates/problem_edit.html +++ b/packages/ui-default/templates/problem_edit.html @@ -110,7 +110,6 @@ {% set filetype = "additional_file" %} {% include "partials/problem_files.html" %} - {% set owner_udoc = udoc %} {% include "partials/problem_sidebar.html" %} {% else %} {% include 'components/md_hint.html' %} diff --git a/packages/ui-default/templates/problem_files.html b/packages/ui-default/templates/problem_files.html index ac01788b..c6c4b287 100644 --- a/packages/ui-default/templates/problem_files.html +++ b/packages/ui-default/templates/problem_files.html @@ -48,7 +48,6 @@
- {% set owner_udoc = udoc %} {% include "partials/problem_sidebar.html" %}
diff --git a/packages/ui-default/templates/problem_hack.html b/packages/ui-default/templates/problem_hack.html index 72c3f2bb..65054de9 100644 --- a/packages/ui-default/templates/problem_hack.html +++ b/packages/ui-default/templates/problem_hack.html @@ -24,7 +24,6 @@
- {% set owner_udoc = udoc %} {% include "partials/problem_sidebar.html" %}
diff --git a/packages/ui-default/templates/problem_submit.html b/packages/ui-default/templates/problem_submit.html index b160cdaa..2da9691d 100644 --- a/packages/ui-default/templates/problem_submit.html +++ b/packages/ui-default/templates/problem_submit.html @@ -33,7 +33,6 @@
- {% set owner_udoc = udoc %} {% include "partials/problem_sidebar.html" %}