123456789101112131415161718192021222324252627282930313233343536373839 |
- {#
- This file is part of the Sonata package.
- (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
- For the full copyright and license information, please view the LICENSE
- file that was distributed with this source code.
- #}
- <div class="text-center">
- <ul class="pagination">
- {% if admin.datagrid.pager.page > 2 %}
- <li><a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, 1)) }}" title="{{ 'link_first_pager'|trans({}, 'SonataAdminBundle') }}">«</a></li>
- {% endif %}
- {% if admin.datagrid.pager.page != admin.datagrid.pager.previouspage %}
- <li><a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, admin.datagrid.pager.previouspage)) }}" title="{{ 'link_previous_pager'|trans({}, 'SonataAdminBundle') }}">‹</a></li>
- {% endif %}
- {# Set the number of pages to display in the pager #}
- {% for page in admin.datagrid.pager.getLinks(admin_pool.getOption('pager_links')) %}
- {% if page == admin.datagrid.pager.page %}
- <li class="active"><a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, page)) }}">{{ page }}</a></li>
- {% else %}
- <li><a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, page)) }}">{{ page }}</a></li>
- {% endif %}
- {% endfor %}
- {% if admin.datagrid.pager.page != admin.datagrid.pager.nextpage %}
- <li><a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, admin.datagrid.pager.nextpage)) }}" title="{{ 'link_next_pager'|trans({}, 'SonataAdminBundle') }}">›</a></li>
- {% endif %}
- {% if admin.datagrid.pager.page != admin.datagrid.pager.lastpage and admin.datagrid.pager.lastpage != admin.datagrid.pager.nextpage %}
- <li><a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, admin.datagrid.pager.lastpage)) }}" title="{{ 'link_last_pager'|trans({}, 'SonataAdminBundle') }}">»</a></li>
- {% endif %}
- </ul>
- </div>
|