修复typo,修改rank页面样式
This commit is contained in:
@@ -396,7 +396,6 @@ def _cmp(x, y):
|
||||
def contest_rank_page(request, contest_id):
|
||||
contest = Contest.objects.get(id=contest_id)
|
||||
contest_problems = ContestProblem.objects.filter(contest=contest).order_by("sort_index")
|
||||
|
||||
r = redis.Redis(host=REDIS_CACHE["host"], port=REDIS_CACHE["port"], db=REDIS_CACHE["db"])
|
||||
if contest.real_time_rank:
|
||||
# 更新rank
|
||||
@@ -411,12 +410,12 @@ def contest_rank_page(request, contest_id):
|
||||
try:
|
||||
status = submissions.get(problem=problem)
|
||||
result[i]["problems"].append({
|
||||
"first_achieved":status.first_achivevd,
|
||||
"first_achieved":status.first_achieved,
|
||||
"ac": status.ac,
|
||||
"failed_number": status.total_submission_number,
|
||||
"ac_time": status.ac_time})
|
||||
if status.ac:
|
||||
result[i]["problem"][-1].failed_number -= 1
|
||||
result[i]["problems"][-1]["failed_number"] -= 1
|
||||
except ContestSubmission.DoesNotExist:
|
||||
result[i]["problems"].append({})
|
||||
result[i]["total_ac"] = submissions.filter(ac=True).count()
|
||||
|
||||
@@ -110,16 +110,6 @@ li.list-group-item {
|
||||
}
|
||||
|
||||
.rank .first-achieved{
|
||||
background: #43CD80;
|
||||
color: white;
|
||||
background: #33CC99;
|
||||
}
|
||||
|
||||
.rank .ac{
|
||||
background: #3c763d;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.rank .failed{
|
||||
background: #a94442;
|
||||
color: white;
|
||||
}
|
||||
@@ -25,18 +25,18 @@
|
||||
实时
|
||||
{% else %}
|
||||
已封榜
|
||||
{% endif %})
|
||||
</h2>
|
||||
{% if result %}
|
||||
<table class="table table-bordered">
|
||||
{% endif %})
|
||||
</h2>
|
||||
{% if result %}
|
||||
<table class="table table-bordered text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>用户名</th>
|
||||
<th>AC / 总提交</th>
|
||||
<th>用时 + 罚时</th>
|
||||
<th class="text-center">用户名</th>
|
||||
<th class="text-center">AC / 总提交</th>
|
||||
<th class="text-center">用时 + 罚时</th>
|
||||
{% for item in contest_problems %}
|
||||
<th><a href="/contest/{{ contest.id }}/problem/{{ item.id }}/">{{ item.sort_index }}</a>
|
||||
<th class="text-center"><a href="/contest/{{ contest.id }}/problem/{{ item.id }}/">{{ item.sort_index }}</a>
|
||||
</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
@@ -48,20 +48,8 @@
|
||||
<td>{{ item.username }}</td>
|
||||
<td>{{ item.total_ac }} / {{ item.total_submit }}</td>
|
||||
<td>{% if item.total_time %}{{ item.total_time }} min{% else %}--{% endif %}</td>
|
||||
{% for problem in item.problem %}
|
||||
<td class="
|
||||
{% if problem %}
|
||||
{% if problem.ac %}
|
||||
{% if problem.first_achieve %}
|
||||
first-achieved
|
||||
{% else %}
|
||||
ac
|
||||
{% endif %}
|
||||
{% else %}
|
||||
failed
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
">
|
||||
{% for problem in item.problems %}
|
||||
<td class="{% if problem %}{% if problem.ac %}{% if problem.first_achieve %}first-achieved{% else %}alert-success{% endif %}{% else %}alert-danger{% endif %}{% endif %}">
|
||||
{% if problem.ac %}
|
||||
{{ problem.ac_time }}min
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user