preview.html.twig 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. {% extends 'SonataAdminBundle:CRUD:edit.html.twig' %}
  8. {% block actions %}
  9. {% endblock %}
  10. {% block side_menu %}
  11. {% endblock %}
  12. {% block formactions %}
  13. <button class="btn btn-success" type="submit" name="btn_preview_approve">
  14. <i class="fa fa-check" aria-hidden="true"></i>
  15. {{ 'btn_preview_approve'|trans({}, 'SonataAdminBundle') }}
  16. </button>
  17. <button class="btn btn-danger" type="submit" name="btn_preview_decline">
  18. <i class="fa fa-times" aria-hidden="true"></i>
  19. {{ 'btn_preview_decline'|trans({}, 'SonataAdminBundle') }}
  20. </button>
  21. {% endblock %}
  22. {% block preview %}
  23. <div class="sonata-ba-view">
  24. {% for name, view_group in admin.showgroups %}
  25. <table class="table table-bordered">
  26. {% if name %}
  27. <tr class="sonata-ba-view-title">
  28. <td colspan="2">
  29. {{ name|trans({}, admin.translationdomain) }}
  30. </td>
  31. </tr>
  32. {% endif %}
  33. {% for field_name in view_group.fields %}
  34. <tr class="sonata-ba-view-container">
  35. {% if admin.show[field_name] is defined %}
  36. {{ admin.show[field_name]|render_view_element(object) }}
  37. {% endif %}
  38. </tr>
  39. {% endfor %}
  40. </table>
  41. {% endfor %}
  42. </div>
  43. {% endblock %}
  44. {% block form %}
  45. <div class="sonata-preview-form-container">
  46. {{ parent() }}
  47. </div>
  48. {% endblock %}