|
@@ -15,33 +15,84 @@ file that was distributed with this source code.
|
|
|
{% block breadcrumb %}{% endblock %}
|
|
|
{% block content %}
|
|
|
|
|
|
+ {% set has_left = false %}
|
|
|
+ {% for block in blocks.left %}
|
|
|
+ {% if block.roles|length == 0 or is_granted(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(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(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(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(block.roles) %}
|
|
|
+ {% set has_bottom = true %}
|
|
|
+ {% endif %}
|
|
|
+ {% endfor %}
|
|
|
+
|
|
|
{{ sonata_block_render_event('sonata.admin.dashboard.top', { 'admin_pool': admin_pool }) }}
|
|
|
|
|
|
- {% if blocks.top|length > 0 %}
|
|
|
+ {% if has_top %}
|
|
|
<div class="row">
|
|
|
{% for block in blocks.top %}
|
|
|
- <div class="{{ block.class }}">
|
|
|
- {% if block.roles|length == 0 or is_granted(block.roles) %}
|
|
|
+ {% if block.roles|length == 0 or is_granted(block.roles) %}
|
|
|
+ <div class="{{ block.class }}">
|
|
|
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
|
|
|
- {% endif %}
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ {% endif %}
|
|
|
{% endfor %}
|
|
|
</div>
|
|
|
{% endif %}
|
|
|
|
|
|
<div class="row">
|
|
|
- {% set has_center = false %}
|
|
|
+ {% 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 %}
|
|
|
|
|
|
- <div class="{% if blocks.center|length > 0 %}col-md-4{% else %}col-md-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 %}
|
|
|
+ <div class="col-md-{{ width_left }}">
|
|
|
{% for block in blocks.left %}
|
|
|
{% if block.roles|length == 0 or is_granted(block.roles) %}
|
|
|
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
|
|
|
{% endif %}
|
|
|
{% endfor %}
|
|
|
</div>
|
|
|
+ {% endif %}
|
|
|
|
|
|
- {% if blocks.center|length > 0 %}
|
|
|
- <div class="col-md-4">
|
|
|
+ {% if has_center %}
|
|
|
+ <div class="col-md-{{ width_center }}">
|
|
|
{% for block in blocks.center %}
|
|
|
{% if block.roles|length == 0 or is_granted(block.roles) %}
|
|
|
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
|
|
@@ -50,23 +101,26 @@ file that was distributed with this source code.
|
|
|
</div>
|
|
|
{% endif %}
|
|
|
|
|
|
- <div class="{% if blocks.center|length > 0 %}col-md-4{% else %}col-md-6{% endif %}">
|
|
|
+ {# don't show right column if only center one is present #}
|
|
|
+ {% if has_left or has_right %}
|
|
|
+ <div class="col-md-{{ width_right }}">
|
|
|
{% for block in blocks.right %}
|
|
|
{% if block.roles|length == 0 or is_granted(block.roles) %}
|
|
|
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
|
|
|
{% endif %}
|
|
|
{% endfor %}
|
|
|
</div>
|
|
|
+ {% endif %}
|
|
|
</div>
|
|
|
|
|
|
- {% if blocks.bottom|length > 0 %}
|
|
|
+ {% if has_bottom %}
|
|
|
<div class="row">
|
|
|
{% for block in blocks.bottom %}
|
|
|
- <div class="{{ block.class }}">
|
|
|
- {% if block.roles|length == 0 or is_granted(block.roles) %}
|
|
|
+ {% if block.roles|length == 0 or is_granted(block.roles) %}
|
|
|
+ <div class="{{ block.class }}">
|
|
|
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
|
|
|
- {% endif %}
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ {% endif %}
|
|
|
{% endfor %}
|
|
|
</div>
|
|
|
{% endif %}
|