算法评测平台前端。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
5.6 KiB

<% this.title = '排名 - ' + contest.title %>
8 years ago
<% include header %>
<style>
.submit_time {
font-size: 0.8em;
margin-top: 5px;
color: #000;
}
</style>
8 years ago
<div class="padding">
<table class="ui very basic center aligned table">
<thead>
<tr>
<th>#</th>
<th>用户名</th>
<% if (contest.type === 'acm') { %>
<th>通过数量</th>
<th>罚时</th>
<% } %>
<% for (let i = 0; i < problems.length; i++) { %>
<th>
<a href="<%= syzoj.utils.makeUrl(['contest', contest.id, i + 1]) %>">
<%= syzoj.utils.removeTitleTag(problems[i].title) %>
</a>
</th>
<% } %>
<% if (contest.type === 'noi' || contest.type === 'ioi') { %>
<th>总分</th>
8 years ago
<% } %>
</tr>
</thead>
<tbody>
<%
let i = 0;
8 years ago
for (let item of ranklist) {
i++
let latest = contest.start_time, timeSum = 0, unacceptedCount = 0;
8 years ago
%>
<tr>
<td>
<% if (i == 1) { %>
<div class="ui yellow ribbon label">
<% } else if (i == 2) { %>
<div class="ui ribbon label">
<% } else if (i == 3) { %>
<div class="ui brown ribbon label" style="background-color: #C47222 !important;">
<% } else { %>
<div>
<% } %>
<%= i %>
</div>
</td>
<td><a href="<%= syzoj.utils.makeUrl(['user', item.user.id]) %>"><%= item.user.username %></a><% if (item.user.nameplate) { %><%- item.user.nameplate %><% } %></td>
<%
if (contest.type === 'acm') {
for (let problem of problems) {
if (item.player.score_details[problem.id] && item.player.score_details[problem.id].accepted) {
timeSum += (item.player.score_details[problem.id].acceptedTime - contest.start_time) + (item.player.score_details[problem.id].unacceptedCount * 20 * 60);
unacceptedCount += item.player.score_details[problem.id].unacceptedCount;
}
}
%>
<td>
<span class="score score_<%= parseInt((item.player.score / ranklist[0].player.score * 10) || 0) %>">
<%= item.player.score %>
</span>
</td>
<td>
<%= syzoj.utils.formatTime(timeSum) %>
</td>
<% } %>
8 years ago
<% for (let problem of problems) { %>
<% if (!item.player.score_details[problem.id]) { %>
<td></td>
<% } else if (contest.type === 'acm') { %>
<td>
<a href="<%= syzoj.utils.makeUrl(['submission', item.player.score_details[problem.id].judge_id]) %>">
<% if (item.player.score_details[problem.id].accepted) { %>
<span class="score score_10">
<% if (item.player.score_details[problem.id].unacceptedCount) { %>
+<%= item.player.score_details[problem.id].unacceptedCount %>
<% } else { %>
+
<% } %>
</span>
<div class="submit_time">
<%= syzoj.utils.formatTime(item.player.score_details[problem.id].acceptedTime - contest.start_time) %>
</div>
<% } else if (item.player.score_details[problem.id].unacceptedCount) { %>
<span class="score score_0">
-<%= item.player.score_details[problem.id].unacceptedCount %>
</span>
<% } %>
</a>
</td>
<% } else if (contest.type === 'noi' || contest.type === 'ioi') { %>
<td>
<a href="<%= syzoj.utils.makeUrl(['submission', item.player.score_details[problem.id].judge_id]) %>">
<span class="score score_<%= parseInt((item.player.score_details[problem.id].score / 10) || 0) %>">
<%= item.player.score_details[problem.id].score %>
</span>
</a>
<div class="submit_time">
<%= syzoj.utils.formatTime(item.player.score_details[problem.id].judge_state.submit_time - contest.start_time) %>
<% latest = Math.max(latest, item.player.score_details[problem.id].judge_state.submit_time) %>
</div>
</td>
<% } %>
8 years ago
<% } %>
<% if (contest.type === 'noi' || contest.type === 'ioi') { %>
<td>
<span class="score score_<%= parseInt((item.player.score / ranklist[0].player.score * 10) || 0) %>">
<%= item.player.score %>
</span>
<div class="submit_time">
<%= syzoj.utils.formatTime(latest - contest.start_time) %>
</div>
</td>
8 years ago
<% } %>
</tr>
<% } %>
</tbody>
</table>
</div>
<% include footer %>