{% extends '@SonataAdmin/CRUD/base_list_field.html.twig' %}

{% block field %}
{% if object is defined %}

    <tr class="sonata-ba-view-container">
        <th>Lista</th>
        <td>
            {%  if attribute(object, 'groups') is not empty %}
                {% set groupsList = attribute(object, 'groups') %}
                {% for group in groupsList %}
                    {{ group.group_name }} <br > {{ group.children_no }} dzieci<br ><br >
                {% endfor %}
            {% endif %}
        </td>
    </tr>       
{% endif %}
{% endblock %}