浏览代码

Merge pull request #587 from mweimerskirch/patch-8

Dropdown menu tweak
Thomas 13 年之前
父节点
当前提交
57cf8b2e29
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Resources/views/standard_layout.html.twig

+ 3 - 1
Resources/views/standard_layout.html.twig

@@ -90,7 +90,9 @@ file that was distributed with this source code.
                                             <a href="#" class="dropdown-toggle">{{ group.label|trans({}, 'SonataAdminBundle') }}</a>
                                             <ul class="dropdown-menu">
                                                 {% for admin in group.items %}
-                                                    <li><a href="{{ admin.generateUrl('list')}}">{{ admin.label|trans({}, admin.translationdomain) }}</a></li>
+                                                    {% if admin.hasroute('create') and admin.isGranted('CREATE') or admin.hasroute('list') and admin.isGranted('LIST') %}
+                                                        <li><a href="{{ admin.generateUrl('list')}}">{{ admin.label|trans({}, admin.translationdomain) }}</a></li>
+                                                    {% endif %}
                                                 {% endfor %}
                                             </ul>
                                         </li>