Browse Source

Fix contest submission querying.

pull/6/head
t123yh 7 years ago
parent
commit
e2182040d2
  1. 2
      modules/submission.js
  2. 1
      views/submissions.ejs

2
modules/submission.js

@ -47,7 +47,7 @@ app.get('/submissions', async (req, res) => {
if (user) where.user_id = user.id; if (user) where.user_id = user.id;
else if (req.query.submitter) where.user_id = -1; else if (req.query.submitter) where.user_id = -1;
if (req.query.contest == null) { if (!req.query.contest) {
where.type = { $ne: 1 }; where.type = { $ne: 1 };
} else { } else {
const contestId = Number(req.query.contest); const contestId = Number(req.query.contest);

1
views/submissions.ejs

@ -15,6 +15,7 @@
<% } %> <% } %>
<form action="<%= syzoj.utils.makeUrl(displayConfig.inContest ? ['contest', contest.id, 'submissions'] : ['submissions']) %>" class="ui mini form" method="get" role="form" id="form"> <form action="<%= syzoj.utils.makeUrl(displayConfig.inContest ? ['contest', contest.id, 'submissions'] : ['submissions']) %>" class="ui mini form" method="get" role="form" id="form">
<input type="hidden" name="contest" value="<%= form.contest %>" />
<div class="inline fields" style="margin-bottom: 25px; white-space: nowrap; "> <div class="inline fields" style="margin-bottom: 25px; white-space: nowrap; ">
<label style="font-size: 1.2em; margin-right: 1px; ">题目:</label> <label style="font-size: 1.2em; margin-right: 1px; ">题目:</label>
<div class="field"><input name="problem_id" style="width: 50px; " type="text" value="<%= form.problem_id %>"></div> <div class="field"><input name="problem_id" style="width: 50px; " type="text" value="<%= form.problem_id %>"></div>

Loading…
Cancel
Save