-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathbase_show_field.html.twig
53 lines (47 loc) · 1.9 KB
/
base_show_field.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
46
47
48
49
50
51
52
53
{#
This file is part of the Sonata package.
(c) Thomas Rabaix <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
<th{% if(is_diff|default(false)) %} class="diff"{% endif %}>
{%- block name -%}
{% apply spaceless %}
{% if field_description.label is not same as(false) %}
{% if field_description.translationDomain is same as(false) %}
{{ field_description.label }}
{% else %}
{{ field_description.label|trans({}, field_description.translationDomain) }}
{% endif %}
{% endif %}
{% endapply %}
{%- endblock -%}
</th>
<td>
{%- block field -%}
{% apply spaceless %}
{% set collapse = field_description.option('collapse') %}
{% if collapse %}
<div class="sonata-readmore"
data-readmore-height="{{ collapse.height|default(40) }}"
data-readmore-more="{{ collapse.more|default('read_more')|trans({}, 'SonataAdminBundle') }}"
data-readmore-less="{{ collapse.less|default('read_less')|trans({}, 'SonataAdminBundle') }}">
{% block field_value %}
{% if field_description.option('safe', false) %}{{ value|raw }}{% else %}{{ value|default('')|nl2br }}{% endif %}
{% endblock %}
</div>
{% else %}
{{ block('field_value') }}
{% endif %}
{% endapply %}
{%- endblock -%}
</td>
{%- block field_compare -%}
{% apply spaceless %}
{% if value_compare is defined %}
{% set value = value_compare %}
{% set object = object_compare %}
<td>{{ block('field') }}</td>
{% endif %}
{% endapply %}
{%- endblock -%}