|
33 | 33 | {% endspaceless %} |
34 | 34 | {% endset %} |
35 | 35 |
|
36 | | -{% set _global_actions %} |
37 | | - {% if easyadmin_action_is_enabled_for_list_view('search', _entity_config.name) %} |
38 | | - {% set _action = easyadmin_get_action_for_list_view('search', _entity_config.name) %} |
39 | | - |
40 | | - {% block search_action %} |
41 | | - <div class="form-action {{ _action.css_class|default('') }}"> |
42 | | - <form method="get" action="{{ path('easyadmin') }}"> |
43 | | - {% block search_form %} |
44 | | - <input type="hidden" name="action" value="search"> |
45 | | - <input type="hidden" name="entity" value="{{ _request_parameters.entity }}"> |
46 | | - <input type="hidden" name="sortField" value="{{ _request_parameters.sortField }}"> |
47 | | - <input type="hidden" name="sortDirection" value="{{ _request_parameters.sortDirection }}"> |
48 | | - <input type="hidden" name="menuIndex" value="{{ _request_parameters.menuIndex }}"> |
49 | | - <input type="hidden" name="submenuIndex" value="{{ _request_parameters.submenuIndex }}"> |
50 | | - <div class="input-group"> |
51 | | - <input class="form-control" type="search" name="query" value="{{ app.request.get('query')|default('') }}"> |
52 | | - <span class="input-group-btn"> |
53 | | - <button class="btn" type="submit"> |
54 | | - <i class="fa fa-search"></i> |
55 | | - <span class="hidden-xs hidden-sm">{{ _action.label|default('action.search')|trans(_trans_parameters) }}</span> |
56 | | - </button> |
57 | | - </span> |
58 | | - </div> |
59 | | - {% endblock %} |
60 | | - </form> |
61 | | - </div> |
62 | | - {% endblock search_action %} |
63 | | - {% endif %} |
64 | | - |
65 | | - {% if easyadmin_action_is_enabled_for_list_view('new', _entity_config.name) %} |
66 | | - {% set _action = easyadmin_get_action_for_list_view('new', _entity_config.name) %} |
67 | | - {% block new_action %} |
68 | | - <div class="button-action"> |
69 | | - <a class="{{ _action.css_class|default('') }}" href="{{ path('easyadmin', _request_parameters|merge({ action: _action.name })) }}"> |
70 | | - {% if _action.icon %}<i class="fa fa-{{ _action.icon }}"></i>{% endif %} |
71 | | - {{ _action.label is defined and not _action.label is empty ? _action.label|trans(_trans_parameters) }} |
72 | | - </a> |
73 | | - </div> |
74 | | - {% endblock new_action %} |
75 | | - {% endif %} |
76 | | -{% endset %} |
77 | | - |
78 | 36 | {% block page_title %}{{ _content_title|striptags }}{% endblock %} |
79 | 37 |
|
80 | 38 | {% block content_header %} |
|
85 | 43 |
|
86 | 44 | <div class="col-sm-7"> |
87 | 45 | <div class="global-actions"> |
88 | | - {{ _global_actions }} |
| 46 | + {% block global_actions %} |
| 47 | + {% if easyadmin_action_is_enabled_for_list_view('search', _entity_config.name) %} |
| 48 | + {% set _action = easyadmin_get_action_for_list_view('search', _entity_config.name) %} |
| 49 | + |
| 50 | + {% block search_action %} |
| 51 | + <div class="form-action {{ _action.css_class|default('') }}"> |
| 52 | + <form method="get" action="{{ path('easyadmin') }}"> |
| 53 | + {% block search_form %} |
| 54 | + <input type="hidden" name="action" value="search"> |
| 55 | + <input type="hidden" name="entity" value="{{ _request_parameters.entity }}"> |
| 56 | + <input type="hidden" name="sortField" value="{{ _request_parameters.sortField }}"> |
| 57 | + <input type="hidden" name="sortDirection" value="{{ _request_parameters.sortDirection }}"> |
| 58 | + <input type="hidden" name="menuIndex" value="{{ _request_parameters.menuIndex }}"> |
| 59 | + <input type="hidden" name="submenuIndex" value="{{ _request_parameters.submenuIndex }}"> |
| 60 | + <div class="input-group"> |
| 61 | + <input class="form-control" type="search" name="query" value="{{ app.request.get('query')|default('') }}"> |
| 62 | + <span class="input-group-btn"> |
| 63 | + <button class="btn" type="submit"> |
| 64 | + <i class="fa fa-search"></i> |
| 65 | + <span class="hidden-xs hidden-sm">{{ _action.label|default('action.search')|trans(_trans_parameters) }}</span> |
| 66 | + </button> |
| 67 | + </span> |
| 68 | + </div> |
| 69 | + {% endblock %} |
| 70 | + </form> |
| 71 | + </div> |
| 72 | + {% endblock search_action %} |
| 73 | + {% endif %} |
| 74 | + |
| 75 | + {% if easyadmin_action_is_enabled_for_list_view('new', _entity_config.name) %} |
| 76 | + {% set _action = easyadmin_get_action_for_list_view('new', _entity_config.name) %} |
| 77 | + {% block new_action %} |
| 78 | + <div class="button-action"> |
| 79 | + <a class="{{ _action.css_class|default('') }}" href="{{ path('easyadmin', _request_parameters|merge({ action: _action.name })) }}"> |
| 80 | + {% if _action.icon %}<i class="fa fa-{{ _action.icon }}"></i>{% endif %} |
| 81 | + {{ _action.label is defined and not _action.label is empty ? _action.label|trans(_trans_parameters) }} |
| 82 | + </a> |
| 83 | + </div> |
| 84 | + {% endblock new_action %} |
| 85 | + {% endif %} |
| 86 | + {% endblock global_actions %} |
89 | 87 | </div> |
90 | 88 | </div> |
91 | 89 | </div> |
92 | | -{% endblock %} |
| 90 | +{% endblock content_header %} |
93 | 91 |
|
94 | 92 | {% block main %} |
95 | 93 | {% set _list_item_actions = easyadmin_get_actions_for_list_item(_entity_config.name) %} |
|
0 commit comments