|
1 | | -{% import _self as action_macros %} |
2 | | - |
3 | 1 | {% for action in actions %} |
4 | 2 | {% if 'list' == action.name %} |
5 | 3 | {% set action_href = request_parameters.referer|default('') ? request_parameters.referer|easyadmin_urldecode : path('easyadmin', request_parameters|merge({ action: 'list' })) %} |
|
14 | 12 | {% set confirm = (action.confirm|trans({}, translation_domain))|default('confirm_modal.content'|trans({}, 'EasyAdminBundle')) %} |
15 | 13 | {% endif %} |
16 | 14 |
|
17 | | - {{ action_macros.action_tpl(action, item_id, action_href, confirm, trans_parameters, translation_domain) }} |
18 | | -{% endfor %} |
19 | 15 |
|
20 | | -{% macro action_tpl(action, item_id, action_href, confirm, trans_parameters, translation_domain) %} |
21 | | - <a name="{{ action.name }}" class="{{ action.css_class|default('') }}" title="{{ action.title|default('') is empty ? '' : action.title|trans(trans_parameters, translation_domain) }}" {% if not confirm %}href="{{ action_href }}" target="{{ action.target }}"{% else %}href="#" data-href="{{ action_href }}" data-confirm="{{ confirm }}"{% endif %}> |
22 | | - {%- if action.icon %}<i class="fa fa-{{ action.icon }}"></i> {% endif -%} |
23 | | - {%- if action.label is defined and not action.label is empty -%} |
24 | | - {{ action.label|trans(trans_parameters|merge({ '%entity_id%': item_id }), translation_domain) }} |
25 | | - {%- endif -%} |
26 | | - </a> |
27 | | -{% endmacro %} |
| 16 | + {{ include(action.template, { |
| 17 | + action: action, |
| 18 | + action_href: action_href, |
| 19 | + is_dropdown: is_dropdown|default(false), |
| 20 | + item: item, |
| 21 | + item_id: item_id, |
| 22 | + request_parameters: request_parameters, |
| 23 | + translation_domain: translation_domain, |
| 24 | + trans_parameters: trans_parameters, |
| 25 | + confirm: confirm |
| 26 | + }, with_context = false) }} |
| 27 | + |
| 28 | +{% endfor %} |
0 commit comments