{# This file is part of the Sonata package. (c) Thomas Rabaix For the full copyright and license information, please view the LICENSE file that was distributed with this source code. #} {% extends sonata_block.templates.block_base %} {% block block %} {# NEXT_MAJOR: Remove the following line #} {% set show_empty_boxes = show_empty_boxes|default(sonata_admin.adminPool.container.getParameter('sonata.admin.configuration.global_search.empty_boxes')) %} {% set visibility_class = 'sonata-search-result-' ~ show_empty_boxes %} {# NEXT_MAJOR: remove the attribute check and just use .currentPageResults #} {% if pager and (attribute(pager, 'getCurrentPageResults') is defined ? pager.currentPageResults : pager.results)|length %} {% set visibility_class = 'sonata-search-result-show' %} {% endif %}
{% set icon = settings.icon|default('') %} {{ icon|raw }}

{% if admin.label is not empty %} {{ admin.label|trans({}, admin.translationdomain) }} {% endif %}

{# NEXT_MAJOR: remove the attribute check and just use .countResults() #} {% if pager and (attribute(pager, 'countResults') is defined ? pager.countResults() : pager.getNbResults()) > 0 %} {# NEXT_MAJOR: remove the attribute check and just use .countResults() #} {{ (attribute(pager, 'countResults') is defined ? pager.countResults() : pager.getNbResults()) }} {% elseif admin.hasRoute('create') and admin.hasAccess('create') %} {% endif %} {% if admin.hasRoute('list') and admin.hasAccess('list') %} {% endif %}
{# NEXT_MAJOR: remove the attribute check and just use .currentPageResults #} {% if pager and (attribute(pager, 'getCurrentPageResults') is defined ? pager.currentPageResults : pager.results)|length %}
{% else %}

{{ 'no_results_found'|trans({}, 'SonataAdminBundle') }}

{% endif %}
{% endblock %}