batch_confirmation.html.twig 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. <h4 class="box-title">{% trans with {'%action%': action_label} from 'SonataAdminBundle' %}title_batch_confirmation{% endtrans %}</h4>
  17. </div>
  18. <div class="box-body">
  19. {% if data.all_elements %}
  20. {{ 'message_batch_all_confirmation'|trans({}, 'SonataAdminBundle') }}
  21. {% else %}
  22. {% transchoice data.idx|length with {'%count%': data.idx|length} from 'SonataAdminBundle' %}message_batch_confirmation{% endtranschoice %}
  23. {% endif %}
  24. </div>
  25. <div class="box-footer clearfix">
  26. <form action="{{ admin.generateUrl('batch', {'filter': admin.filterParameters}) }}" method="POST">
  27. <input type="hidden" name="confirmation" value="ok">
  28. <input type="hidden" name="data" value="{{ data|json_encode }}">
  29. <input type="hidden" name="_sonata_csrf_token" value="{{ csrf_token }}">
  30. <div style="display: none">
  31. {{ form_rest(form) }}
  32. </div>
  33. <button type="submit" class="btn btn-danger">{{ 'btn_execute_batch_action'|trans({}, 'SonataAdminBundle') }}</button>
  34. {% if admin.hasRoute('list') and admin.isGranted('LIST') %}
  35. {{ 'delete_or'|trans({}, 'SonataAdminBundle') }}
  36. <a class="btn btn-success" href="{{ admin.generateUrl('list') }}">
  37. <i class="fa fa-th-list"></i> {{ 'link_action_list'|trans({}, 'SonataAdminBundle') }}
  38. </a>
  39. {% endif %}
  40. </form>
  41. </div>
  42. </div>
  43. </div>
  44. {% endblock %}