batch_confirmation.html.twig 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. <li>{% include 'SonataAdminBundle:Button:list_button.html.twig' %}</li>
  10. <li>{% include 'SonataAdminBundle:Button:create_button.html.twig' %}</li>
  11. {% endblock %}
  12. {% block tab_menu %}{{ knp_menu_render(admin.sidemenu(action), {'currentClass' : 'active', 'template': 'SonataAdminBundle:Core:tab_menu_template.html.twig'}, 'twig') }}{% endblock %}
  13. {% block content %}
  14. <div class="sonata-ba-delete">
  15. <h1>{% trans with {'%action%': action_label} from 'SonataAdminBundle' %}title_batch_confirmation{% endtrans %}</h1>
  16. {% if data.all_elements %}
  17. {{ 'message_batch_all_confirmation'|trans({}, 'SonataAdminBundle') }}
  18. {% else %}
  19. {% transchoice data.idx|length with {'%count%': data.idx|length} from 'SonataAdminBundle' %}message_batch_confirmation{% endtranschoice %}
  20. {% endif %}
  21. <div class="well well-small form-actions">
  22. <form action="{{ admin.generateUrl('batch', {'filter': admin.filterParameters}) }}" method="POST" >
  23. <input type="hidden" name="confirmation" value="ok">
  24. <input type="hidden" name="data" value="{{ data|json_encode }}">
  25. <input type="hidden" name="_sonata_csrf_token" value="{{ csrf_token }}">
  26. <div style="display: none">
  27. {{ form_rest(form) }}
  28. </div>
  29. <button type="submit" class="btn btn-danger">{{ 'btn_execute_batch_action'|trans({}, 'SonataAdminBundle') }}</button>
  30. {% if admin.hasRoute('list') and admin.isGranted('LIST') %}
  31. {{ 'delete_or'|trans({}, 'SonataAdminBundle') }}
  32. <a class="btn btn-success" href="{{ admin.generateUrl('list') }}">
  33. <i class="glyphicon glyphicon-th-list"></i> {{ 'link_action_list'|trans({}, 'SonataAdminBundle') }}
  34. </a>
  35. {% endif %}
  36. </form>
  37. </div>
  38. </div>
  39. {% endblock %}