From f4127a806ae8f14133063b89fcb910b9735c77a5 Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 12 Dec 2022 03:16:08 +0800 Subject: [PATCH] ui: update pid display --- packages/hydrooj/locales/en.yaml | 2 +- packages/hydrooj/src/handler/contest.ts | 3 ++- .../templates/contest_problemlist.html | 16 ++++++++++------ .../ui-default/templates/problem_detail.html | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/hydrooj/locales/en.yaml b/packages/hydrooj/locales/en.yaml index 9620ea65..6c96ad87 100644 --- a/packages/hydrooj/locales/en.yaml +++ b/packages/hydrooj/locales/en.yaml @@ -8,7 +8,7 @@ contest_detail: Contest Detail contest_edit: Contest Edit contest_files: Contest Files contest_main: Contest -contest_problemlist: Proble List +contest_problemlist: Problem List contest_scoreboard: Scoreboard discussion_create: Create Discussion discussion_detail: Discussion Detail diff --git a/packages/hydrooj/src/handler/contest.ts b/packages/hydrooj/src/handler/contest.ts index 615e81cd..2811a121 100644 --- a/packages/hydrooj/src/handler/contest.ts +++ b/packages/hydrooj/src/handler/contest.ts @@ -252,8 +252,9 @@ export class ContestProblemListHandler extends ContestDetailBaseHandler { if (contest.canShowSelfRecord.call(this, this.tdoc)) { [this.response.body.rdict, this.response.body.rdocs] = await Promise.all([ record.getList(domainId, psdocs.map((i: any) => i.rid)), - await record.getMulti(domainId, { tid, uid: this.user._id }).toArray(), + await record.getMulti(domainId, { tid, uid: this.user._id }).sort({ _id: -1 }).toArray(), ]); + this.response.body.canViewRecord = true; } else { for (const i of psdocs) this.response.body.rdict[i.rid] = { _id: i.rid }; } diff --git a/packages/ui-default/templates/contest_problemlist.html b/packages/ui-default/templates/contest_problemlist.html index 11688cdb..742a97e0 100644 --- a/packages/ui-default/templates/contest_problemlist.html +++ b/packages/ui-default/templates/contest_problemlist.html @@ -46,7 +46,9 @@ {% endif %} {% endif %}