From 2b8f5c25cb0fface9ca79771b29e9c625e0ad3a1 Mon Sep 17 00:00:00 2001 From: Josh Hofing Date: Fri, 5 Feb 2016 13:00:31 -0500 Subject: [PATCH] Don't make current page id a link on Teams page --- CTFd/templates/teams.html | 6 +++++- CTFd/views.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CTFd/templates/teams.html b/CTFd/templates/teams.html index cd37b9a..a2f50c8 100644 --- a/CTFd/templates/teams.html +++ b/CTFd/templates/teams.html @@ -35,7 +35,11 @@
Page
{% for page in range(1, team_pages + 1) %} - {{ page }} + {% if curr_page != page %} + {{ page }} + {% else %} + {{page}} + {% endif %} {% endfor %}
diff --git a/CTFd/views.py b/CTFd/views.py index 4afbd20..d0be140 100644 --- a/CTFd/views.py +++ b/CTFd/views.py @@ -136,7 +136,7 @@ def teams(page): count = db.session.query(db.func.count(Teams.id)).first()[0] print(count) pages = int(count / results_per_page) + (count % results_per_page > 0) - return render_template('teams.html', teams=teams, team_pages=pages) + return render_template('teams.html', teams=teams, team_pages=pages, curr_page=page) @views.route('/team/', methods=['GET', 'POST']) def team(teamid):