mirror of
https://gitnet.fr/deblan/gist.git
synced 2021-08-14 08:30:49 +02:00
#5 Pagination with the filter
This commit is contained in:
parent
430f364456
commit
4db9b0f62f
@ -28,7 +28,9 @@
|
|||||||
{{ form(deleteForm) }}
|
{{ form(deleteForm) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="" method="GET">
|
{% set params = app.request.attributes.get('_route_params')|merge({page: 1}) %}
|
||||||
|
|
||||||
|
<form action="{{ path('my', params) }}" method="GET">
|
||||||
<div class="btn-toolbar">
|
<div class="btn-toolbar">
|
||||||
<div class="btn-group" id="options">
|
<div class="btn-group" id="options">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@ -94,9 +96,12 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
{% set pager %}
|
{% set pager %}
|
||||||
{% if gists.haveToPaginate %}
|
{% if gists.haveToPaginate %}
|
||||||
|
{% set params = app.request.attributes.get('_route_params')|merge({filter: app.request.query.get('filter', [])}) %}
|
||||||
|
|
||||||
<ul class="pagination">
|
<ul class="pagination">
|
||||||
<li>
|
<li>
|
||||||
{% set params = app.request.attributes.get('_route_params')|merge({page: 1}) %}
|
{% set params = params|merge({page: 1}) %}
|
||||||
|
|
||||||
<a href="{{ path('my', params) }}">
|
<a href="{{ path('my', params) }}">
|
||||||
<span aria-hidden="true">
|
<span aria-hidden="true">
|
||||||
<span class="glyphicon glyphicon-step-backward"></span>
|
<span class="glyphicon glyphicon-step-backward"></span>
|
||||||
@ -105,7 +110,8 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
{% set params = app.request.attributes.get('_route_params')|merge({page: gists.previousPage}) %}
|
{% set params = params|merge({page: gists.previousPage}) %}
|
||||||
|
|
||||||
<a href="{{ path('my', params) }}">
|
<a href="{{ path('my', params) }}">
|
||||||
<span aria-hidden="true">
|
<span aria-hidden="true">
|
||||||
<span class="glyphicon glyphicon glyphicon-chevron-left"></span>
|
<span class="glyphicon glyphicon glyphicon-chevron-left"></span>
|
||||||
@ -115,13 +121,15 @@
|
|||||||
|
|
||||||
{% for p in gists.links(10) %}
|
{% for p in gists.links(10) %}
|
||||||
<li {% if p == page %}class="active"{% endif %}>
|
<li {% if p == page %}class="active"{% endif %}>
|
||||||
{% set params = app.request.attributes.get('_route_params')|merge({page: p}) %}
|
{% set params = params|merge({page: p}) %}
|
||||||
|
|
||||||
<a href="{{ path('my', params) }}">{{ p }}</a>
|
<a href="{{ path('my', params) }}">{{ p }}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
{% set params = app.request.attributes.get('_route_params')|merge({page: gists.nextPage}) %}
|
{% set params = params|merge({page: gists.nextPage}) %}
|
||||||
|
|
||||||
<a href="{{ path('my', params) }}">
|
<a href="{{ path('my', params) }}">
|
||||||
<span aria-hidden="true">
|
<span aria-hidden="true">
|
||||||
<span class="glyphicon glyphicon glyphicon-chevron-right"></span>
|
<span class="glyphicon glyphicon glyphicon-chevron-right"></span>
|
||||||
@ -130,7 +138,8 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
{% set params = app.request.attributes.get('_route_params')|merge({page: gists.lastPage}) %}
|
{% set params = params|merge({page: gists.lastPage}) %}
|
||||||
|
|
||||||
<a href="{{ path('my', params) }}">
|
<a href="{{ path('my', params) }}">
|
||||||
<span aria-hidden="true">
|
<span aria-hidden="true">
|
||||||
<span class="glyphicon glyphicon-step-forward"></span>
|
<span class="glyphicon glyphicon-step-forward"></span>
|
||||||
|
Loading…
Reference in New Issue
Block a user