base_show_field.html.twig 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {#
  2. This file is part of the Sonata package.
  3. (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  4. For the full copyright and license information, please view the LICENSE
  5. file that was distributed with this source code.
  6. #}
  7. <th{% if(is_diff|default(false)) %} class="diff"{% endif %}>{% block name %}{{ field_description.label|trans({}, field_description.translationDomain ?: admin.translationDomain) }}{% endblock %}</th>
  8. <td>
  9. {%- block field -%}
  10. {% spaceless %}
  11. {% set collapse = field_description.options.collapse|default(false) %}
  12. {% if collapse %}
  13. <div class="sonata-readmore"
  14. data-readmore-height="{{ collapse.height|default(40) }}"
  15. data-readmore-more="{{ collapse.more|default('read_more')|trans({}, 'SonataAdminBundle') }}"
  16. data-readmore-less="{{ collapse.less|default('read_less')|trans({}, 'SonataAdminBundle') }}">
  17. {% block field_value %}
  18. {% if field_description.options.safe %}{{ value|raw }}{% else %}{{ value|nl2br }}{% endif %}
  19. {% endblock %}
  20. </div>
  21. {% else %}
  22. {{ block('field_value') }}
  23. {% endif %}
  24. {% endspaceless %}
  25. {%- endblock -%}
  26. </td>
  27. {% block field_compare %}
  28. {% if(value_compare is defined) %}
  29. <td>
  30. {% set value = value_compare %}
  31. {{ block('field') }}
  32. </td>
  33. {% endif %}
  34. {% endblock %}