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