{% endif %}
diff --git a/src/templates/ranking.html b/src/templates/ranking.html
index b2a3401..eea4bb3 100644
--- a/src/templates/ranking.html
+++ b/src/templates/ranking.html
@@ -1,10 +1,20 @@
{% extends "layout.html" %}
-{% block title %}Rankings{% endblock %}
-{% block active %}Rankings{% endblock %}
+{% block title %}Practice Leaderboard{% endblock %}
+{% block active %}Practice Leaderboard{% endblock %}
{% block main %}
-
Rankings
+
Practice Leaderboard
+{% if is_ongoing_contest %}
+
+ There is currently an ongoing contest. To view its scoreboard, go to the Contests page, enter the contest, and then click "Contest Leaderboard" at the top of the page.
+ This scoreboard is only for practice problems unrelated to the contest.
+
+
+{% endif %}
diff --git a/src/tests/test_contest.py b/src/tests/test_contest.py
index 0db46af..7ffd7d2 100644
--- a/src/tests/test_contest.py
+++ b/src/tests/test_contest.py
@@ -114,6 +114,7 @@ def test_contest(client, database):
result = client.get('/contest/testingcontest/problem/helloworldtesting')
assert result.status_code == 200
+ assert b'Contest Leaderboard' in result.data
result = client.post('/contest/testingcontest/problem/helloworldtesting/edit', data={
'name': 'hello world 2',
diff --git a/src/tests/test_pages.py b/src/tests/test_pages.py
index 63bd524..848664a 100644
--- a/src/tests/test_pages.py
+++ b/src/tests/test_pages.py
@@ -22,7 +22,8 @@ def test_pages(client, database):
result = client.get('/ranking')
assert result.status_code == 200
- assert b'Rankings' in result.data
+ assert b'Practice Leaderboard' in result.data
+ assert b'Contest Leaderboard' not in result.data
result = client.post('/login', data={
'username': 'normal_user',
diff --git a/src/views/contest.py b/src/views/contest.py
index 43cc235..ea6685a 100644
--- a/src/views/contest.py
+++ b/src/views/contest.py
@@ -31,9 +31,6 @@ def contest(contest_id):
return redirect("/contests")
title = contest_info[0]["name"]
-
- # Check for scoreboard permission
- scoreboard = contest_info[0]["scoreboard_visible"] or check_perm(["ADMIN", "SUPERADMIN"])
scoreboard_key = contest_info[0]["scoreboard_key"]
user_info = db.execute(
@@ -82,7 +79,7 @@ def contest(contest_id):
}
data.append(keys)
- return render_template("contest/contest.html", title=title, scoreboard=scoreboard,
+ return render_template("contest/contest.html", title=title,
scoreboard_key=scoreboard_key, data=data)
@@ -409,7 +406,7 @@ def contest_scoreboard(contest_id):
# Ensure proper permissions
if not (contest_info[0]["scoreboard_visible"] or check_perm(["ADMIN", "SUPERADMIN"])):
flash('You are not allowed to view the scoreboard!', 'danger')
- return redirect("/contest/" + contest_id)
+ return redirect(request.referrer)
data = db.execute(
("SELECT user_id, points, lastAC, username FROM contest_users "