Improve pagination when user has lot of entries

Fix #1905
* Usage of whiteoctober/WhiteOctoberPagerfantaBundle
This commit is contained in:
Nicolas Lœuillet
2016-04-12 16:04:17 +02:00
parent 80bd17f00d
commit 624a7c6df1
9 changed files with 53 additions and 47 deletions

View File

@ -7,16 +7,9 @@
<div class="results">
<div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div>
<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 %}
</div>
<a href="#" id="filter">{{ 'entry.filters.title'|trans }}</a>
{{ pagerfanta(entries, 'wallabag_view') }}
</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, 'wallabag_view') }}
</div>
{% endblock %}
<br />