From 8334060fd99bc8980b3e3d3b22a6ed9af4b44a11 Mon Sep 17 00:00:00 2001 From: Michel Weimerskirch Date: Tue, 28 Feb 2012 12:08:39 +0100 Subject: [PATCH] Dashboard: Only show items if either create or list action is available and granted. --- Resources/views/Core/dashboard.html.twig | 40 +++++++++++++----------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/Resources/views/Core/dashboard.html.twig b/Resources/views/Core/dashboard.html.twig index 0a879670f6..cd1bdbe2c4 100644 --- a/Resources/views/Core/dashboard.html.twig +++ b/Resources/views/Core/dashboard.html.twig @@ -26,25 +26,27 @@ file that was distributed with this source code. {% for admin in group.items %} - - {{ admin.label|trans({}, admin.translationdomain) }} - - {% if admin.hasroute('create') and admin.isGranted('CREATE') %} - - {%- trans from 'SonataAdminBundle' %}link_add{% endtrans -%} - {%- trans from 'SonataAdminBundle' %}link_add{% endtrans -%} - - {% endif %} - - - {% if admin.hasroute('list') and admin.isGranted('LIST') %} - - {%- trans from 'SonataAdminBundle' %}link_list{% endtrans -%} - {%- trans from 'SonataAdminBundle' %}link_list{% endtrans -%} - - {% endif %} - - + {% if admin.hasroute('create') and admin.isGranted('CREATE') or admin.hasroute('list') and admin.isGranted('LIST') %} + + {{ admin.label|trans({}, admin.translationdomain) }} + + {% if admin.hasroute('create') and admin.isGranted('CREATE') %} + + {%- trans from 'SonataAdminBundle' %}link_add{% endtrans -%} + {%- trans from 'SonataAdminBundle' %}link_add{% endtrans -%} + + {% endif %} + + + {% if admin.hasroute('list') and admin.isGranted('LIST') %} + + {%- trans from 'SonataAdminBundle' %}link_list{% endtrans -%} + {%- trans from 'SonataAdminBundle' %}link_list{% endtrans -%} + + {% endif %} + + + {% endif %} {% endfor %}