diff --git a/packages/hydrooj/src/handler/contest.ts b/packages/hydrooj/src/handler/contest.ts index 5b681cb53..23024b145 100644 --- a/packages/hydrooj/src/handler/contest.ts +++ b/packages/hydrooj/src/handler/contest.ts @@ -582,7 +582,7 @@ export class ContestManagementHandler extends ContestManagementBaseHandler { tdoc: this.tdoc, tsdoc: this.tsdoc, owner_udoc: await user.getById(domainId, this.tdoc.owner), - pdict: await problem.getList(domainId, this.tdoc.pids, true, true, problem.PROJECTION_CONTEST_LIST), + pdict: await problem.getList(domainId, this.tdoc.pids, true, true, [...problem.PROJECTION_CONTEST_LIST, 'tag']), files: sortFiles(this.tdoc.files || []), udict: await user.getListForRender(domainId, tcdocs.map((i) => i.owner)), tcdocs, diff --git a/packages/ui-default/templates/components/problem.html b/packages/ui-default/templates/components/problem.html index 864e134f6..b83f4e8a5 100644 --- a/packages/ui-default/templates/components/problem.html +++ b/packages/ui-default/templates/components/problem.html @@ -1,4 +1,4 @@ -{% macro render_problem_title(pdoc, tdoc=none, show_tags=true, show_invisible_flag=true, invalid=false, inline=false, small=false) %} +{% macro render_problem_title(pdoc, tdoc=none, show_tags=true, show_invisible_flag=true, invalid=false, inline=false, small=false, alphabetic=false) %} {%- if not invalid -%} {% set _linkArgs = { pid:pdoc.pid|default(pdoc.docId) } %} {% if tdoc %}{{ set(_linkArgs, 'query', {tid:tdoc.docId}) }}{% endif %} @@ -6,7 +6,7 @@ {%- endif -%} {%- if pdoc.domainId !== handler.args.domainId -%}{{ pdoc.domainId }}#{%- endif -%} -{%- if page_name == 'contest_problemlist' and tdoc -%} +{%- if tdoc and alphabetic -%} {{ String.fromCharCode(65 + tdoc.pids.indexOf(pdoc.docId)) if tdoc.pids.includes(pdoc.docId) else '#' }} {%- else -%} {{ pdoc.pid or ('P'+pdoc.docId if pdoc.domainId === handler.args.domainId else pdoc.docId) }} diff --git a/packages/ui-default/templates/contest_manage.html b/packages/ui-default/templates/contest_manage.html index a330cc626..ad6c47dfc 100644 --- a/packages/ui-default/templates/contest_manage.html +++ b/packages/ui-default/templates/contest_manage.html @@ -1,5 +1,6 @@ {% extends "layout/basic.html" %} {% import "components/contest.html" as contest with context %} +{% import "components/problem.html" as problem with context %} {% block content %}
@@ -21,7 +22,7 @@ - {{ String.fromCharCode(65+loop.index0) }}  {{ pdict[pid].title }} + {{ problem.render_problem_title(pdict[pid], tdoc=tdoc, invalid=true, alphabetic=true) }} diff --git a/packages/ui-default/templates/contest_problemlist.html b/packages/ui-default/templates/contest_problemlist.html index 956e4dd66..a5c7cdb2e 100644 --- a/packages/ui-default/templates/contest_problemlist.html +++ b/packages/ui-default/templates/contest_problemlist.html @@ -47,9 +47,7 @@ {% endif %} {% endif %} - - {{ String.fromCharCode(65+loop.index0) }}  {{ pdict[pid].title }} - + {{ problem.render_problem_title(pdict[pid], tdoc, alphabetic=true) }} {%- endfor -%}