{% for block in blocks.top %}
{% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
{% endif %}
{% endfor %}
{% endif %}
{% set width_left = 4 %}
{% set width_right = 4 %}
{% set width_center = 4 %}
{# if center block is not present we make left and right ones wider #}
{% if not has_center %}
{% set width_left = 6 %}
{% set width_right = 6 %}
{% endif %}
{# if there is no right and left block present we make center one full width #}
{% if not has_left and not has_right %}
{% set width_center = 12 %}
{% endif %}
{# don't show left column if only center one is present #}
{% if has_left or has_right %}
{% for block in blocks.left %}
{% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
{% endif %}
{% endfor %}
{% endif %}
{% if has_center %}
{% for block in blocks.center %}
{% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
{% endif %}
{% endfor %}
{% endif %}
{# don't show right column if only center one is present #}
{% if has_left or has_right %}
{% for block in blocks.right %}
{% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
{% endif %}
{% endfor %}
{% endif %}
{% if has_bottom %}
{% for block in blocks.bottom %}
{% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
{% endif %}
{% endfor %}
{% endif %}
{{ sonata_block_render_event('sonata.admin.dashboard.bottom', { 'admin_pool': sonata_admin.adminPool }) }}
{% endblock %}