diff --git a/CTFd/admin.py b/CTFd/admin.py index 504f232..51f87ba 100644 --- a/CTFd/admin.py +++ b/CTFd/admin.py @@ -546,7 +546,7 @@ def admin_wrong_key(page='1'): wrong_count = db.session.query(db.func.count(WrongKeys.id)).first()[0] pages = int(wrong_count / results_per_page) + (wrong_count % results_per_page > 0) - return render_template('admin/wrong_keys.html', wrong_keys=wrong_keys, pages=pages) + return render_template('admin/wrong_keys.html', wrong_keys=wrong_keys, pages=pages, curr_page=page) @admin.route('/admin/correct_keys/', methods=['GET']) @@ -564,7 +564,7 @@ def admin_correct_key(page='1'): solve_count = db.session.query(db.func.count(Solves.id)).first()[0] pages = int(solve_count / results_per_page) + (solve_count % results_per_page > 0) - return render_template('admin/correct_keys.html', solves=solves, pages=pages) + return render_template('admin/correct_keys.html', solves=solves, pages=pages, curr_page=page) @admin.route('/admin/fails/', methods=['GET']) diff --git a/CTFd/templates/admin/correct_keys.html b/CTFd/templates/admin/correct_keys.html index 9a5a553..212ccd3 100644 --- a/CTFd/templates/admin/correct_keys.html +++ b/CTFd/templates/admin/correct_keys.html @@ -60,9 +60,15 @@ {% if pages > 1 %}
Page
+ {% if curr_page != 1 %}<<<{% endif %} {% for page in range(1, pages + 1) %} - {{ page }} + {% if curr_page != page %} + {{ page }} + {% else %} + {{ page }} + {% endif %} {% endfor %} + {% if curr_page != pages %}>>>{% endif %}
{% endif %} diff --git a/CTFd/templates/admin/wrong_keys.html b/CTFd/templates/admin/wrong_keys.html index 46ca602..a52086d 100644 --- a/CTFd/templates/admin/wrong_keys.html +++ b/CTFd/templates/admin/wrong_keys.html @@ -67,9 +67,15 @@ {% if pages > 1 %}
Page
+ {% if curr_page != 1 %}
<<<{% endif %} {% for page in range(1, pages + 1) %} - {{ page }} + {% if curr_page != page %} + {{ page }} + {% else %} + {{ page }} + {% endif %} {% endfor %} + {% if curr_page != pages %}>>>{% endif %}
{% endif %}