浏览代码

Merge pull request #584 from mweimerskirch/patch-6

Dashboard tweak
Thomas 13 年之前
父节点
当前提交
cc69753ed6
共有 1 个文件被更改,包括 21 次插入19 次删除
  1. 21 19
      Resources/views/Core/dashboard.html.twig

+ 21 - 19
Resources/views/Core/dashboard.html.twig

@@ -26,25 +26,27 @@ file that was distributed with this source code.
 
                 <tbody>
                     {% for admin in group.items %}
-                        <tr>
-                            <td class="sonata-ba-list-label">{{ admin.label|trans({}, admin.translationdomain) }}</td>
-                            <td>
-                                {% if admin.hasroute('create') and admin.isGranted('CREATE') %}
-                                    <a href="{{ admin.generateUrl('create')}}">
-                                        <img src="{{ asset('bundles/sonataadmin/famfamfam/add.png') }}"  alt="{%- trans from 'SonataAdminBundle' %}link_add{% endtrans -%}" />
-                                        {%- trans from 'SonataAdminBundle' %}link_add{% endtrans -%}
-                                    </a>
-                                {% endif %}
-                            </td>
-                            <td>
-                                {% if admin.hasroute('list') and admin.isGranted('LIST') %}
-                                    <a href="{{ admin.generateUrl('list')}}">
-                                        <img src="{{ asset('bundles/sonataadmin/famfamfam/application_view_list.png') }}" alt="{%- trans from 'SonataAdminBundle' %}link_list{% endtrans -%}" />
-                                        {%- trans from 'SonataAdminBundle' %}link_list{% endtrans -%}
-                                    </a>
-                                {% endif %}
-                            </td>
-                        </tr>
+                        {% if admin.hasroute('create') and admin.isGranted('CREATE') or admin.hasroute('list') and admin.isGranted('LIST') %}
+                            <tr>
+                                <td class="sonata-ba-list-label">{{ admin.label|trans({}, admin.translationdomain) }}</td>
+                                <td>
+                                    {% if admin.hasroute('create') and admin.isGranted('CREATE') %}
+                                        <a href="{{ admin.generateUrl('create')}}">
+                                            <img src="{{ asset('bundles/sonataadmin/famfamfam/add.png') }}"  alt="{%- trans from 'SonataAdminBundle' %}link_add{% endtrans -%}" />
+                                            {%- trans from 'SonataAdminBundle' %}link_add{% endtrans -%}
+                                        </a>
+                                    {% endif %}
+                                </td>
+                                <td>
+                                    {% if admin.hasroute('list') and admin.isGranted('LIST') %}
+                                        <a href="{{ admin.generateUrl('list')}}">
+                                            <img src="{{ asset('bundles/sonataadmin/famfamfam/application_view_list.png') }}" alt="{%- trans from 'SonataAdminBundle' %}link_list{% endtrans -%}" />
+                                            {%- trans from 'SonataAdminBundle' %}link_list{% endtrans -%}
+                                        </a>
+                                    {% endif %}
+                                </td>
+                            </tr>
+                        {% endif %}
                     {% endfor %}
                 </tbody>
             </table>