delete.html.twig 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 base_template %}
  8. {%- block actions -%}
  9. {% include 'SonataAdminBundle:CRUD:action_buttons.html.twig' %}
  10. {%- endblock -%}
  11. {% block tab_menu %}{{ knp_menu_render(admin.sidemenu(action), {'currentClass' : 'active', 'template': sonata_admin.adminPool.getTemplate('tab_menu_template')}, 'twig') }}{% endblock %}
  12. {% block content %}
  13. <div class="sonata-ba-delete">
  14. <div class="box box-danger">
  15. <div class="box-header">
  16. <h3 class="box-title">{{ 'title_delete'|trans({}, 'SonataAdminBundle') }}</h3>
  17. </div>
  18. <div class="box-body">
  19. {{ 'message_delete_confirmation'|trans({'%object%': admin.toString(object)}, 'SonataAdminBundle') }}
  20. </div>
  21. <div class="box-footer clearfix">
  22. <form method="POST" action="{{ admin.generateObjectUrl('delete', object) }}">
  23. <input type="hidden" name="_method" value="DELETE">
  24. <input type="hidden" name="_sonata_csrf_token" value="{{ csrf_token }}">
  25. <button type="submit" class="btn btn-danger"><i class="fa fa-trash" aria-hidden="true"></i> {{ 'btn_delete'|trans({}, 'SonataAdminBundle') }}</button>
  26. {% if admin.hasRoute('edit') and admin.hasAccess('edit', object) %}
  27. {{ 'delete_or'|trans({}, 'SonataAdminBundle') }}
  28. <a class="btn btn-success" href="{{ admin.generateObjectUrl('edit', object) }}">
  29. <i class="fa fa-pencil" aria-hidden="true"></i>
  30. {{ 'link_action_edit'|trans({}, 'SonataAdminBundle') }}</a>
  31. {% endif %}
  32. </form>
  33. </div>
  34. </div>
  35. </div>
  36. {% endblock %}