Bläddra i källkod

tweak show array (and fix tests)

Thomas Rabaix 10 år sedan
förälder
incheckning
5202f6134a

+ 4 - 1
Resources/views/CRUD/show_array.html.twig

@@ -18,6 +18,9 @@ file that was distributed with this source code.
         {% else %}
             [{{ key }} => {{ val }}]
         {% endif %}
-        {% if field_description.options.inline is not defined or false == field_description.options.inline %}<br>{% endif %}
+
+        {% if not loop.last %}
+            {% if field_description.options.inline is not defined or false == field_description.options.inline %}<br>{% endif %}
+        {% endif %}
     {% endfor %}
 {% endblock %}

+ 2 - 1
Tests/Twig/Extension/SonataAdminExtensionTest.php

@@ -506,7 +506,8 @@ class SonataAdminExtensionTest extends \PHPUnit_Framework_TestCase
             array('<th>Data</th> <td> 1074.6135 % </td>', 'percent', 10.746135, array()),
             array('<th>Data</th> <td> EUR 10.746135 </td>', 'currency', 10.746135, array('currency' => 'EUR')),
             array('<th>Data</th> <td> GBP 51.23456 </td>', 'currency', 51.23456, array('currency' => 'GBP')),
-            array('<th>Data</th> <td> [1 => First] [2 => Second] </td>', 'array', array(1 => 'First', 2 => 'Second'), array('safe' => false)),
+            array('<th>Data</th> <td> [1 => First] <br> [2 => Second] </td>', 'array', array(1 => 'First', 2 => 'Second'), array('safe' => false)),
+            array('<th>Data</th> <td> [1 => First] [2 => Second] </td>', 'array', array(1 => 'First', 2 => 'Second'), array('safe' => false, 'inline' => true)),
             array('<th>Data</th> <td><i class="icon-ok-circle"></i>yes</td>', 'boolean', true, array()),
             array('<th>Data</th> <td><i class="icon-ban-circle"></i>no</td>', 'boolean', false, array()),
             array('<th>Data</th> <td> Delete </td>', 'trans', 'action_delete', array('safe' => false, 'catalogue' => 'SonataAdminBundle')),