Files
OnlineJudge/template/src/oj/contest/contest_rank.html
2015-12-26 22:34:54 +08:00

114 lines
5.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "oj_base.html" %}
{% block title %}
比赛排名
{% endblock %}
{% block body %}
{% load contest %}
<div class="container main">
<ul class="nav nav-tabs nav-tabs-google contest-tab">
<li role="presentation">
<a href="/contest/{{ contest.id }}/">比赛详情</a>
</li>
<li role="presentation">
<a href="/contest/{{ contest.id }}/problems/">题目列表</a>
</li>
<li role="presentation">
<a href="/contest/{{ contest.id }}/submissions/">提交</a>
</li>
<li role="presentation" class="active">
<a href="/contest/{{ contest.id }}/rank/?paging=true&page=1&page_size=40">排名</a>
</li>
</ul>
<div class="row">
<div class="col-lg-12 table-responsive">
<h2 class="text-center">排名(
{% if contest.real_time_rank %}
实时
{% else %}
已封榜
{% endif %})
</h2>
{% if rank %}
<table class="table table-bordered table-condensed text-center">
<thead>
<tr>
<th>#</th>
<th class="text-center">用户名</th>
<th class="text-center">AC / 总提交</th>
<th class="text-center">用时 + 罚时</th>
{% for item in contest_problems %}
<th class="text-center">
<a href="/contest/{{ contest.id }}/submissions/?problem_id={{ item.id }}">{{ item.sort_index }}</a>
</th>
{% endfor %}
</tr>
</thead>
<tbody class="rank">
{% for item in rank %}
<tr>
<th scope="row">{% if item.total_ac_number %}{{ forloop.counter|add:paging_info.offset}}{% else %}-{% endif %}</th>
<td>
<a href="/contest/{{ contest.id }}/submissions/?user_id={{ item.user__id }}">
{{ item.user__username }}
</a>
{% if show_real_name %}
{{ item.user__real_name }}
{% endif %}
</td>
<td>{{ item.total_ac_number }} / {{ item.total_submission_number }}</td>
<td>{% if item.total_time %}{{ item.total_time|format_seconds }}{% else %}--{% endif %}</td>
{% autoescape off %}
{% for problem in contest_problems %}
<td class="{% get_submission_class item problem %}">
{% get_submission_content item problem %}
</td>
{% endfor %}
{% endautoescape %}
</tr>
{% endfor %}
</tbody>
</table>
<input type="checkbox" id="auto-refresh" {% if auto_refresh %}checked{% endif %}
onchange="if(this.checked){location.href=location.href + '&auto_refresh=true'}else{location.href=location.href=location.href.replace('&auto_refresh=true', '')}">
自动刷新
<nav>
<ul class="pager">
{% if paging_info.previous_page %}
<li class="previous">
<a href="/contest/{{ contest.id }}/rank/?paging=true&page={{ paging_info.previous_page }}&page_size={{ paging_info.page_size }}{% if auto_refresh %}&auto_refresh=true{% endif %}">
<span aria-hidden="true">&larr;</span> 上一页
</a></li>
{% endif %}
{% if paging_info.next_page %}
<li class="next">
<a href="/contest/{{ contest.id }}/rank/?paging=true&page={{ paging_info.next_page }}&page_size={{ paging_info.page_size }}{% if auto_refresh %}&auto_refresh=true{% endif %}">
下一页 <span aria-hidden="true">&rarr;</span>
</a></li>
{% endif %}
</ul>
</nav>
{% else %}
<p>还没有结果</p>
<input type="checkbox" id="auto-refresh" {% if auto_refresh %}checked{% endif %}
onchange="if(this.checked){location.href=location.href + '&auto_refresh=true'}else{location.href=location.href=location.href.replace('&auto_refresh=true', '')}">
自动刷新
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% block js_block %}
{% if auto_refresh %}
<script>
setTimeout(function () {
location.reload();
}, 5000);
</script>
{% endif %}
{% endblock %}