{#
 # For the full copyright and license information, please view the
 # docs/licenses/LICENSE.txt file that was distributed with this source code.
 #}

{% block grid_pagination %}
  {% if grid.data.records_total > 10 or grid.pagination.offset %}
    {% set route_params = {} %}

    {% for param_name, param_value in app.request.attributes.get('_route_params') %}
      {% set route_params = route_params|merge({(param_name): (param_value)}) %}
    {% endfor %}

    {{ render(controller('PrestaShopBundle\\Controller\\Admin\\CommonController::paginationAction', {
      limit: grid.pagination.limit,
      offset: grid.pagination.offset,
      total: grid.data.records_total,
      prefix: grid.form_prefix,
      caller_route: app.request.attributes.get('_route'),
      caller_parameters: route_params,
      view: grid.view_options.pagination_view|default('full'),
    })) }}
  {% endif %}
{% endblock %}
