block_admin_list.html.twig 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {#
  2. This file is part of the Sonata package.
  3. (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  4. For the full copyright and license information, please view the LICENSE
  5. file that was distributed with this source code.
  6. #}
  7. {% extends 'SonataBlockBundle:Block:block_base.html.twig' %}
  8. {% block block %}
  9. {% for group in admin_pool.dashboardGroups %}
  10. <table class="zebra-striped sonata-ba-list bordered-table">
  11. <thead>
  12. <tr>
  13. <th colspan="3">{{ group.label|trans({}, group.label_catalogue) }}</th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. {% for admin in group.items %}
  18. {% if admin.hasroute('create') and admin.isGranted('CREATE') or admin.hasroute('list') and admin.isGranted('LIST') %}
  19. <tr>
  20. <td class="sonata-ba-list-label">{{ admin.label|trans({}, admin.translationdomain) }}</td>
  21. <td>
  22. {% if admin.hasroute('create') and admin.isGranted('CREATE') %}
  23. <a href="{{ admin.generateUrl('create')}}">
  24. <img src="{{ asset('bundles/sonataadmin/famfamfam/add.png') }}" alt="{%- trans from 'SonataAdminBundle' %}link_add{% endtrans -%}" />
  25. {%- trans from 'SonataAdminBundle' %}link_add{% endtrans -%}
  26. </a>
  27. {% endif %}
  28. </td>
  29. <td>
  30. {% if admin.hasroute('list') and admin.isGranted('LIST') %}
  31. <a href="{{ admin.generateUrl('list')}}">
  32. <img src="{{ asset('bundles/sonataadmin/famfamfam/application_view_list.png') }}" alt="{%- trans from 'SonataAdminBundle' %}link_list{% endtrans -%}" />
  33. {%- trans from 'SonataAdminBundle' %}link_list{% endtrans -%}
  34. </a>
  35. {% endif %}
  36. </td>
  37. </tr>
  38. {% endif %}
  39. {% endfor %}
  40. </tbody>
  41. </table>
  42. {% endfor %}
  43. {% endblock %}