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