Procházet zdrojové kódy

set content list to span12 when filter is empty

I forget to do the same thing for the ajax template in this pull request https://github.com/sonata-project/SonataAdminBundle/pull/1917
Lhassan Baazzi před 11 roky
rodič
revize
8410a26ec0
1 změnil soubory, kde provedl 8 přidání a 7 odebrání
  1. 8 7
      Resources/views/ajax_layout.html.twig

+ 8 - 7
Resources/views/ajax_layout.html.twig

@@ -10,8 +10,8 @@ file that was distributed with this source code.
 #}
 
 {% block content %}
-    {% set _list_table   = block('list_table') %}
-    {% set _list_filters = block('list_filters') %}
+    {% set _list_table   = block('list_table')|trim %}
+    {% set _list_filters = block('list_filters')|trim %}
 
     {% block preview %}{% endblock %}
     {% block form %}{% endblock %}
@@ -20,13 +20,14 @@ file that was distributed with this source code.
 
     {% if _list_table|length > 0 or _list_filters|length > 0 %}
         <div class="row-fluid">
-            <div class="sonata-ba-list span10">
+            <div class="sonata-ba-list {% if _list_filters %}span10{% else %}span12{% endif %}">
                 {{ _list_table|raw }}
             </div>
-
-            <div class="sonata-ba-filter span2">
-                {{ _list_filters|raw }}
-            </div>
+            {% if _list_filters %}
+                <div class="sonata-ba-filter span2">
+                    {{ _list_filters|raw }}
+                </div>
+            {% endif %}
         </div>
     {% endif %}