Merge pull request #1918 from wallabag/improve-pagination

Improve pagination when user has lot of entries
This commit is contained in:
Jeremy Benoist
2016-04-13 09:42:18 +02:00
9 changed files with 49 additions and 38 deletions

View File

@ -6,16 +6,9 @@
{% block pager %}
<div class="results">
<div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div>
<div class="pagination">
<div class="pagination">
<a href="#" id="filter">{{ 'entry.filters.title'|trans }}</a>
{% if entries is not empty %}
{% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
<li>
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}" class="{{ currentPage == p ? 'current':''}}" >{{ p }}</a>
</li>
{% endfor %}
{% endif %}
{{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
</div>
</div>
{% endblock %}

View File

@ -21,13 +21,7 @@
<div class="nb-results left">
{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
</div>
<ul class="pagination right">
{% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
<li class="{{ currentPage == p ? 'active':'waves-effect'}}">
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}">{{ p }}</a>
</li>
{% endfor %}
</ul>
{{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
</div>
{% endblock %}
<br />