Refactoring pagination

This commit is contained in:
Denis-Cosmin Nutiu 2017-04-20 01:13:21 +03:00
parent 568ba89894
commit 973b2496ce

View file

@ -48,9 +48,9 @@
</li>
{% endif %}
{# Things are kinda messy here #}
{% for i in range(pagination[2] - pagination[3] - 1, pagination[2] - 1) %}
<li><a href="{{ url_for('scoreboard.index', page=i + 1,
result_name=request.args.get('result_name')) }}">{{ i + 1 }}</a></li>
{% for i in range(pagination[2] - pagination[3], pagination[2]) %}
<li><a href="{{ url_for('scoreboard.index', page=i,
result_name=request.args.get('result_name')) }}">{{ i }}</a></li>
{% endfor %}
<li class="active"><a href="{{ url_for('scoreboard.index', page=pagination[2],
result_name=request.args.get('result_name')) }}">{{ pagination[2] }}</a></li>