base_show_macro.html.twig 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {# NEXT_MAJOR: remove this template #}
  2. {% macro render_groups(admin, object, elements, groups, has_tab, no_padding = false) %}
  3. <div class="row">
  4. {{ block('field_row') }}
  5. </div>
  6. {% endmacro %}
  7. {% block field_row %}
  8. {% for code in groups %}
  9. {% set show_group = admin.showgroups[code] %}
  10. <div class="{{ show_group.class|default('col-md-12') }} {{ no_padding ? 'nopadding' }}">
  11. <div class="{{ show_group.box_class }}">
  12. <div class="box-header">
  13. <h4 class="box-title">
  14. {% block show_title %}
  15. {{ show_group.label|trans({}, show_group.translation_domain ?: admin.translationDomain) }}
  16. {% endblock %}
  17. </h4>
  18. </div>
  19. <div class="box-body table-responsive no-padding">
  20. <table class="table">
  21. <tbody>
  22. {% for field_name in show_group.fields %}
  23. {% block show_field %}
  24. <tr class="sonata-ba-view-container">
  25. {% if elements[field_name] is defined %}
  26. {{ elements[field_name]|render_view_element(object)}}
  27. {% endif %}
  28. </tr>
  29. {% endblock %}
  30. {% endfor %}
  31. </tbody>
  32. </table>
  33. </div>
  34. </div>
  35. </div>
  36. {% endfor %}
  37. {% endblock %}