Ver código fonte

fix list mode with nested admin

Thomas Rabaix 10 anos atrás
pai
commit
21afeb12fe
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      Resources/views/standard_layout.html.twig

+ 2 - 2
Resources/views/standard_layout.html.twig

@@ -271,10 +271,10 @@ file that was distributed with this source code.
                                                     {% endif %}
                                                 </div>
 
-                                                {% if action is defined and action == 'list' and admin.listModes|length > 1 %}
+                                                {% if admin is defined and action is defined and action == 'list' and admin.listModes|length > 1 %}
                                                     <div class="nav navbar-right btn-group">
                                                         {% for mode, settings in admin.listModes %}
-                                                            <a href="{{ url(app.request.attributes.get('_route'), app.request.query.all|merge({_list_mode: mode})) }}" class="btn btn-default navbar-btn btn-sm{% if admin.getListMode() == mode %} active{% endif %}"><i class="{{ settings.class }}"></i></a>
+                                                            <a href="{{ admin.generateUrl('list', app.request.query.all|merge({_list_mode: mode})) }}" class="btn btn-default navbar-btn btn-sm{% if admin.getListMode() == mode %} active{% endif %}"><i class="{{ settings.class }}"></i></a>
                                                         {% endfor %}
                                                     </div>
                                                 {% endif %}