算法评测平台前端。
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.
 
 
 
 

59 lines
2.2 KiB

<% this.title = '题库' %>
<% include header %>
<div class="padding">
<div class="ui grid">
<div class="row">
<div class="column">
<a href="<%= syzoj.utils.makeUrl(['problem', 0, 'edit']) %>" class="ui mini right floated button">添加题目</a>
</div>
</div>
</div>
<table class="ui very basic center aligned table">
<thead>
<tr>
<% if (user) { %>
<th class="one wide">提交状态</th>
<% } %>
<th class="one wide">编号</th>
<th class="left aligned">题目名称</th>
<th class="one wide">通过</th>
<th class="one wide">提交</th>
<th class="one wide">通过率</th>
</tr>
</thead>
<tbody>
<% for (let problem of problems) { %>
<% if (problem.is_public || problem.allowedEdit) { %>
<tr>
<% if (user) { %>
<td>
<% if (problem.judge_state) { %>
<a href="<%= syzoj.utils.makeUrl(['submission', problem.judge_state.id]) %>">
<span class="status <%= problem.judge_state.status.toLowerCase().split(' ').join('_') %>">
<i class="<%= icon[problem.judge_state.status] || 'remove' %> icon"></i>
</span>
</a>
<% } %>
</td>
<% } %>
<td><%= problem.id %></td>
<td class="left aligned"><a href="<%= syzoj.utils.makeUrl(['problem', problem.id]) %>"><%= problem.title %>
<% if (!problem.is_public) { %><span class="ui header"><span class="ui tiny red label">未公开</span></span><% } %>
</a></td>
<td><%= problem.ac_num %></td>
<td><%= problem.submit_num %></td>
<td><%= ((problem.ac_num / problem.submit_num * 100) || 0).toFixed(2) %>%</td>
</tr>
<% } %>
<% } %>
</tbody>
</table><br>
<% include page %>
<script>
document.addEventListener('keydown', function (event) {
if (event.keyCode === 39) document.getElementById('page_next').click();
else if (event.keyCode === 37) document.getElementById('page_prev').click();
});
</script>
</div>
<% include footer %>