-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
base_edit_form_macro.html.twig
45 lines (42 loc) · 2.36 KB
/
base_edit_form_macro.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{% macro render_groups(admin, form, groups, has_tab) %}
<div class="row">
{% for code in groups|filter(code => admin.formgroups[code] is defined) %}
{% set form_group = admin.formgroups[code] %}
<div class="{{ form_group.class|default('col-md-12') }}">
<div class="{{ form_group.box_class }}">
<div class="box-header">
<h4 class="box-title">
{% if form_group.translation_domain is defined and form_group.translation_domain is same as(false) %}
{{ form_group.label }}
{% else %}
{{ form_group.label|trans({}, form_group.translation_domain ?? admin.translationDomain) }}
{% endif %}
</h4>
</div>
<div class="box-body">
<div class="sonata-ba-collapsed-fields">
{% if form_group.description %}
{% if form_group.translation_domain is defined and form_group.translation_domain is same as(false) %}
<p>{{ form_group.description|raw }}</p>
{% else %}
<p>{{ form_group.description|trans({}, form_group.translation_domain ?? admin.translationDomain)|raw }}</p>
{% endif %}
{% endif %}
{% for field_name in form_group.fields|filter(field_name => form[field_name] is defined) %}
{{ form_row(form[field_name]) }}
{% else %}
{% if form_group.empty_message != false %}
{% if form_group.empty_message_translation_domain is defined and form_group.empty_message_translation_domain is same as(false) %}
<em>{{ form_group.empty_message }}</em>
{% else %}
<em>{{ form_group.empty_message|trans({}, form_group.empty_message_translation_domain ?? admin.translationDomain) }}</em>
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endmacro %}