瀏覽代碼

Fix one to many errors template

Manuel Kea Baldassarri 13 年之前
父節點
當前提交
017268121c
共有 1 個文件被更改,包括 6 次插入1 次删除
  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() %}
                                 {% for nested_group_field_name, nested_group_field in form.getChildren() %}
                                     <tr>
                                     <tr>
                                         {% for field_name, nested_field in nested_group_field.getChildren() %}
                                         {% 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 %}
                                                 {% if sonata_admin.field_description.associationadmin.formfielddescriptions[field_name] is defined %}
                                                     {{ form_widget(nested_field) }}
                                                     {{ form_widget(nested_field) }}
 
 
@@ -43,6 +43,11 @@ file that was distributed with this source code.
                                                 {% else %}
                                                 {% else %}
                                                     {{ form_widget(nested_field) }}
                                                     {{ form_widget(nested_field) }}
                                                 {% endif %}
                                                 {% endif %}
+                                                {% if nested_field.vars.errors|length > 0 %}
+                                                    <div class="sonata-ba-field-error-messages">
+                                                        {{ form_errors(nested_field) }}
+                                                    </div>
+                                                {% endif %}
                                             </td>
                                             </td>
                                         {% endfor %}
                                         {% endfor %}
                                     </tr>
                                     </tr>