{# 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. #} {# NEXT_MAJOR: Remove the NAME_ACTIONS check in version 5 and recommend using the option `ajax_hidden` instead. #}
{% for object in admin.datagrid.results %} {% set meta = admin.getObjectMetadata(object) %} {% set mosaic_content %}
{# This box will be display when the mouse is not on the box #}
{% block sonata_mosaic_background %} {% set metaImage = meta.isImageAvailable is defined and not meta.isImageAvailable ? sonata_config.getOption('mosaic_background') : meta.image %} {% if not (metaImage starts with 'data:') %} {% set metaImage = asset(metaImage) %} {% endif %} {{ meta.title }} {% endblock %} {% block sonata_mosaic_default_view %} #{{ admin.id(object) }} {% endblock %}
{# This box will be display when the mouse is on the box You can add more description #}
{% block sonata_mosaic_hover_view %} #{{ admin.id(object) }} {{ meta.description }} {% endblock %}
{% if (admin.hasRoute('batch') and batchactions|length > 0) or (admin.hasRoute('export') and admin.hasAccess('export') and export_formats|length) %} {% else %}   {% endif %} {% block sonata_mosaic_description %} {{ meta.title|u.truncate(40) }} {% endblock %}
{% endset %}
{% if admin.hasAccess('edit', object) and admin.hasRoute('edit') %} {{ mosaic_content }} {% elseif admin.hasAccess('show', object) and admin.hasRoute('show') %} {{ mosaic_content }} {% else %} {{ mosaic_content }} {% endif %}
{% if loop.index % 4 == 0 %} {% endif %} {% if loop.index % 2 == 0 %}
{% endif %} {% endfor %}