Skip to content

Commit

Permalink
Use dynamic action variable to template
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Feb 8, 2022
1 parent 8d0a25d commit a5c3365
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/Resources/views/CRUD/base_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ file that was distributed with this source code.

{% apply spaceless %}
<th class="sonata-ba-list-field-header-{{ field_description.type }}{% if sortable %} sonata-ba-list-field-header-order-{{ sort_by|lower }} {{ sort_active_class }}{% endif %}{% if field_description.option('header_class') %} {{ field_description.option('header_class') }}{% endif %}"{% if field_description.option('header_style') %} style="{{ field_description.option('header_style') }}"{% endif %}>
{% if sortable %}<a href="{{ admin.generateUrl('list', sort_parameters|merge({_list_mode: admin.getListMode()})) }}">{% endif %}
{% if sortable %}<a href="{{ admin.generateUrl(action|default('list'), sort_parameters|merge({_list_mode: admin.getListMode()})) }}">{% endif %}
{% if field_description.getOption('label_icon') %}
<span class="sonata-ba-list-field-header-label-icon">
{{ field_description.getOption('label_icon')|parse_icon }}
Expand Down Expand Up @@ -125,7 +125,7 @@ file that was distributed with this source code.
<ul class="list-inline">
{%- if admin.datagrid.pager.countResults() > 0 -%}
<li>
<a href="{{ admin.generateUrl('list', admin.datagrid.getPaginationParameters(1)) }}">
<a href="{{ admin.generateUrl(action|default('list'), admin.datagrid.getPaginationParameters(1)) }}">
{{- 'go_to_the_first_page'|trans({}, 'SonataAdminBundle') -}}
</a>
</li>
Expand Down Expand Up @@ -297,7 +297,7 @@ file that was distributed with this source code.
<div class="box-body">
<form
class="sonata-filter-form form-horizontal {{ admin.isChild and 1 == admin.datagrid.filters|length ? 'hide' : '' }}"
action="{{ admin.generateUrl('list') }}"
action="{{ admin.generateUrl(action|default('list')) }}"
method="GET"
role="form"
data-default-values="{{ admin.defaultFilterParameters|json_encode }}"
Expand Down Expand Up @@ -357,7 +357,7 @@ file that was distributed with this source code.
<i class="fas fa-filter" aria-hidden="true"></i> {{ 'btn_filter'|trans({}, 'SonataAdminBundle') }}
</button>

<a class="btn btn-default" href="{{ admin.generateUrl('list', {filters: 'reset'}) }}">
<a class="btn btn-default" href="{{ admin.generateUrl(action|default('list'), {filters: 'reset'}) }}">
{{ 'link_reset_filter'|trans({}, 'SonataAdminBundle') }}
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/CRUD/list__select.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ file that was distributed with this source code.
{% extends get_admin_template('base_list_field', admin.code) %}

{% block field %}
<a class="btn btn-primary" href="{{ admin.generateUrl('list') }}">
<a class="btn btn-primary" href="{{ admin.generateUrl(action|default('list')) }}">
<i class="fas fa-check" aria-hidden="true"></i>
{{ 'list_select'|trans({}, 'SonataAdminBundle') }}
</a>
Expand Down
6 changes: 2 additions & 4 deletions src/Resources/views/CRUD/tree.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ file that was distributed with this source code.
#}

{#
This template is not used at all, it is just a template that you can use to create
your own custom tree view.
#}
{% deprecated 'The "tree.html.twig" template is deprecated since sonata-project/admin-bundle version 4.x and will be removed in 5.0.' %}

{% extends '@SonataAdmin/CRUD/base_list.html.twig' %}

{% import _self as tree %}
Expand Down

0 comments on commit a5c3365

Please sign in to comment.