diff --git a/modules/contest.js b/modules/contest.js index 1b36266..611ce07 100644 --- a/modules/contest.js +++ b/modules/contest.js @@ -271,7 +271,8 @@ function getDisplayConfig(contest) { showOthers: contest.allowedSeeingOthers(), showDetailResult: contest.allowedSeeingTestcase(), showTestdata: false, - inContest: true + inContest: true, + showRejudge: false }; } @@ -408,7 +409,7 @@ app.get('/contest/submission/:id', async (req, res) => { type: 'detail' }, syzoj.config.judge_token) : null, displayConfig: displayConfig, - contest: contest + contest: contest, }); } catch (e) { syzoj.log(e); diff --git a/modules/submission.js b/modules/submission.js index 4b38cfc..83bed92 100644 --- a/modules/submission.js +++ b/modules/submission.js @@ -35,6 +35,7 @@ const displayConfig = { showTestdata: true, showDetailResult: true, inContest: false, + showRejudge: false }; // s is JudgeState @@ -153,9 +154,7 @@ app.get('/submission/:id', async (req, res) => { judge.code = await syzoj.utils.highlight(judge.code, syzoj.config.languages[judge.language].highlight); } - judge.allowedRejudge = await judge.problem.isAllowedEditBy(res.locals.user); - judge.allowedManage = await judge.problem.isAllowedManageBy(res.locals.user); - + displayConfig.showRejudge = await judge.problem.isAllowedEditBy(res.locals.user); res.render('submission', { info: getSubmissionInfo(judge, displayConfig), roughResult: getRoughResult(judge, displayConfig), @@ -166,7 +165,7 @@ app.get('/submission/:id', async (req, res) => { type: 'detail', displayConfig: displayConfig }, syzoj.config.judge_token) : null, - displayConfig: displayConfig + displayConfig: displayConfig, }); } catch (e) { syzoj.log(e); diff --git a/views/submission.ejs b/views/submission.ejs index bb4976d..c27f905 100644 --- a/views/submission.ejs +++ b/views/submission.ejs @@ -16,10 +16,11 @@