block_admin_list.html.twig 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 sonata_block.templates.block_base %}
  8. {% block block %}
  9. {% for group in groups %}
  10. {% set display = (group.roles is empty or is_granted('ROLE_SUPER_ADMIN') ) %}
  11. {% for role in group.roles if not display %}
  12. {% set display = is_granted(role)%}
  13. {% endfor %}
  14. {% if display %}
  15. <div class="box">
  16. <div class="box-header">
  17. <h3 class="box-title">{{ group.label|trans({}, group.label_catalogue) }}</h3>
  18. </div>
  19. <div class="box-body">
  20. <table class="table table-hover">
  21. <tbody>
  22. {% for admin in group.items %}
  23. {% if admin.dashboardActions|length > 0 %}
  24. <tr>
  25. <td class="sonata-ba-list-label" width="40%">
  26. {{ label|trans({}, admin.translationdomain) }}
  27. </td>
  28. <td>
  29. <div class="btn-group">
  30. {% for action in admin.dashboardActions %}
  31. {% include action.template|default('SonataAdminBundle:CRUD:dashboard__action.html.twig') with {'action': action} %}
  32. {% endfor %}
  33. </div>
  34. </td>
  35. </tr>
  36. {% endif %}
  37. {% endfor %}
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. {% endif %}
  43. {% endfor %}
  44. {% endblock %}