From f9a20716a02040fdd58ce5567293b938f8ebabbe Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 19 Jul 2023 14:18:50 +0200 Subject: [PATCH] add twig block to override defaults actions in crud index template --- .../views/admin/crud/index.html.twig | 50 +++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/src/core/Resources/views/admin/crud/index.html.twig b/src/core/Resources/views/admin/crud/index.html.twig index d989ee3..7a588cc 100644 --- a/src/core/Resources/views/admin/crud/index.html.twig +++ b/src/core/Resources/views/admin/crud/index.html.twig @@ -224,32 +224,40 @@ {% if configuration.showActions %} - {% block list_item_actions_before %}{% endblock %} + {% block list_item_actions %} + {% block list_item_actions_before %}{% endblock %} - {% if configuration.action(context, 'show', true, [item]) %} - - - - {% endif %} + {% block list_item_action_show %} + {% if configuration.action(context, 'show', true, [item]) %} + + + + {% endif %} + {% endblock %} - {% if configuration.action(context, 'edit', true, [item]) %} - - - - {% endif %} + {% block list_item_action_edit %} + {% if configuration.action(context, 'edit', true, [item]) %} + + + + {% endif %} + {% endblock %} - {% if configuration.action(context, 'delete', true, [item]) %} - + {% block list_item_action_delete %} + {% if configuration.action(context, 'delete', true, [item]) %} + -
- - -
- {% endif %} +
+ + +
+ {% endif %} + {% endblock %} - {% block list_item_actions_after %}{% endblock %} + {% block list_item_actions_after %}{% endblock %} + {% endblock %} {% endif %}