<commit_before>{#

This file is part of the Sonata package.

(c) <NAME> <<EMAIL>>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.

#}

{% extends base_template %}

{% block title %}{{ 'title_dashboard'|trans({}, 'SonataAdminBundle') }}{% endblock%}
{% block breadcrumb %}{% endblock %}
{% block content %}

    {% set has_left = false %}
    {% for block in blocks.left %}
        {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
            {% set has_left = true %}
        {% endif %}
    {% endfor %}

    {% set has_center = false %}
    {% for block in blocks.center %}
        {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
            {% set has_center = true %}
        {% endif %}
    {% endfor %}

    {% set has_right = false %}
    {% for block in blocks.right %}
        {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
            {% set has_right = true %}
        {% endif %}
    {% endfor %}

    {% set has_top = false %}
    {% for block in blocks.top %}
        {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
            {% set has_top = true %}
        {% endif %}
    {% endfor %}

    {% set has_bottom = false %}
    {% for block in blocks.bottom %}
        {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
            {% set has_bottom = true %}
        {% endif %}
    {% endfor %}

    {{ sonata_block_render_event('sonata.admin.dashboard.top', { 'admin_pool': sonata_admin.adminPool }) }}

    {% if has_top %}
        <div class="row">
            {% for block in blocks.top %}
                {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
                    <div class="{{ block.class }}">
                        {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
                    </div><commit_msg>[Dashboard] Don't iterate over blocks if wanted condition is already reached (#5475)<commit_after>{#

This file is part of the Sonata package.

(c) <NAME> <<EMAIL>>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.

#}

{% extends base_template %}

{% block title %}{{ 'title_dashboard'|trans({}, 'SonataAdminBundle') }}{% endblock%}
{% block breadcrumb %}{% endblock %}
{% block content %}

    {% set has_left = false %}
    {% for block in blocks.left if not has_left %}
        {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
            {% set has_left = true %}
        {% endif %}
    {% endfor %}

    {% set has_center = false %}
    {% for block in blocks.center if not has_center %}
        {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
            {% set has_center = true %}
        {% endif %}
    {% endfor %}

    {% set has_right = false %}
    {% for block in blocks.right if not has_right %}
        {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
            {% set has_right = true %}
        {% endif %}
    {% endfor %}

    {% set has_top = false %}
    {% for block in blocks.top if not has_top %}
        {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
            {% set has_top = true %}
        {% endif %}
    {% endfor %}

    {% set has_bottom = false %}
    {% for block in blocks.bottom if not has_bottom %}
        {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
            {% set has_bottom = true %}
        {% endif %}
    {% endfor %}

    {{ sonata_block_render_event('sonata.admin.dashboard.top', { 'admin_pool': sonata_admin.adminPool }) }}

    {% if has_top %}
        <div class="row">
            {% for block in blocks.top %}
                {% if block.roles|length == 0 or is_granted_affirmative(block.roles) %}
                    <div class="{{ block.class }}">
                        {{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
                    </div>
{'fraction_non_alphanumeric': 0.1467800729040097, 'fraction_numerical': 0.003888213851761847, 'mean_word_length': 2.3490642799023598, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5619170', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1217, 'n_words': 331}