Bläddra i källkod

Fix one to many errors template

Manuel Kea Baldassarri 13 år sedan
förälder
incheckning
017268121c
1 ändrade filer med 6 tillägg och 1 borttagningar
  1. 6 1
      Resources/views/CRUD/edit_orm_one_to_many.html.twig

+ 6 - 1
Resources/views/CRUD/edit_orm_one_to_many.html.twig

@@ -35,7 +35,7 @@ file that was distributed with this source code.
                                 {% for nested_group_field_name, nested_group_field in form.getChildren() %}
                                     <tr>
                                         {% for field_name, nested_field in nested_group_field.getChildren() %}
-                                            <td class="sonata-ba-td-{{ id }}-{{ field_name  }}">
+                                            <td class="sonata-ba-td-{{ id }}-{{ field_name  }}{% if nested_field.vars.errors|length > 0 %} clearfix error{% endif %}">
                                                 {% if sonata_admin.field_description.associationadmin.formfielddescriptions[field_name] is defined %}
                                                     {{ form_widget(nested_field) }}
 
@@ -43,6 +43,11 @@ file that was distributed with this source code.
                                                 {% else %}
                                                     {{ form_widget(nested_field) }}
                                                 {% endif %}
+                                                {% if nested_field.vars.errors|length > 0 %}
+                                                    <div class="sonata-ba-field-error-messages">
+                                                        {{ form_errors(nested_field) }}
+                                                    </div>
+                                                {% endif %}
                                             </td>
                                         {% endfor %}
                                     </tr>