diff --git a/modules/submission.js b/modules/submission.js index 14dfb20..a2473d0 100644 --- a/modules/submission.js +++ b/modules/submission.js @@ -30,6 +30,22 @@ app.get('/submissions', async (req, res) => { if (user) where.user_id = user.id; else if (req.query.submitter) where.user_id = -1; if (req.query.problem_id) where.problem_id = parseInt(req.query.problem_id) || -1; + + let minScore = parseInt(req.query.min_score); + if (isNaN(minScore)) minScore = 0; + let maxScore = parseInt(req.query.max_score); + if (isNaN(maxScore)) maxScore = 0; + + where.score = { + $and: { + $gte: parseInt(minScore), + $lte: parseInt(maxScore) + } + }; + + if (req.query.language) where.language = req.query.language; + if (req.query.status) where.status = req.query.status; + where.type = { $ne: 1 }; let paginate = syzoj.utils.paginate(await JudgeState.count(where), req.query.page, syzoj.config.page.judge_state); @@ -42,10 +58,7 @@ app.get('/submissions', async (req, res) => { res.render('submissions', { judge_state: judge_state, paginate: paginate, - form: { - submitter: req.query.submitter || '', - problem_id: req.query.problem_id || '' - } + form: req.query }); } catch (e) { syzoj.log(e); diff --git a/views/problems.ejs b/views/problems.ejs index 773df3a..e86f80a 100644 --- a/views/problems.ejs +++ b/views/problems.ejs @@ -6,7 +6,7 @@ if (typeof tags !== 'undefined') tagIDs = tags.map(x => x.id); %>
-
+
<% if (typeof tags !== 'undefined') { %> diff --git a/views/ranklist.ejs b/views/ranklist.ejs index d3c7ec9..16fcbfd 100644 --- a/views/ranklist.ejs +++ b/views/ranklist.ejs @@ -1,8 +1,8 @@ <% this.title = '排名' %> <% include header %>
-
-
+ +
diff --git a/views/submissions.ejs b/views/submissions.ejs index 51ebc22..42518ce 100644 --- a/views/submissions.ejs +++ b/views/submissions.ejs @@ -1,20 +1,65 @@ <% this.title = '评测记录' %> <% include header %> +<% include util %>
-
-
- -
- + +
+ +
+ +
+ +
+ +
+ +
+ - -
- <% if (user) { %> - + +
+ +
+ + <% if (user) { %> + + + 我的提交 + + + <% } %>
- <% } %> -

+ @@ -38,4 +83,10 @@
<% include page %> + <% include footer %>