Don't make current page id a link on Teams page

selenium-screenshot-testing
Josh Hofing 2016-02-05 13:00:31 -05:00
parent baca032aec
commit 2b8f5c25cb
2 changed files with 6 additions and 2 deletions

View File

@ -35,7 +35,11 @@
<div class="text-center">Page <div class="text-center">Page
<br> <br>
{% for page in range(1, team_pages + 1) %} {% for page in range(1, team_pages + 1) %}
<a href="/teams/{{ page }}">{{ page }}</a> {% if curr_page != page %}
<a href="/teams/{{ page }}">{{ page }}</a>
{% else %}
<b>{{page}}</b>
{% endif %}
{% endfor %} {% endfor %}
<a href=""> <a href="">
</div> </div>

View File

@ -136,7 +136,7 @@ def teams(page):
count = db.session.query(db.func.count(Teams.id)).first()[0] count = db.session.query(db.func.count(Teams.id)).first()[0]
print(count) print(count)
pages = int(count / results_per_page) + (count % results_per_page > 0) 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/<teamid>', methods=['GET', 'POST']) @views.route('/team/<teamid>', methods=['GET', 'POST'])
def team(teamid): def team(teamid):