|
@@ -12,62 +12,64 @@ file that was distributed with this source code.
|
|
|
{% extends sonata_block.templates.block_base %}
|
|
|
|
|
|
{% block block %}
|
|
|
-
|
|
|
- <table class="table table-condensed sonata-ba-list">
|
|
|
-
|
|
|
- {% for group in groups %}
|
|
|
- {% set display = (group.roles is empty or is_granted('ROLE_SUPER_ADMIN') ) %}
|
|
|
- {% for role in group.roles if not display %}
|
|
|
- {% set display = is_granted(role)%}
|
|
|
- {% endfor %}
|
|
|
-
|
|
|
- {% if display %}
|
|
|
- <tr>
|
|
|
- <td colspan="3" style="background: none repeat scroll 0 0 #F7F7F7;"><strong>{{ group.label|trans({}, group.label_catalogue) }}</strong></td>
|
|
|
- </tr>
|
|
|
-
|
|
|
- {% for admin in group.items %}
|
|
|
- {% 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>
|
|
|
- <div class="btn-group">
|
|
|
- {% if admin.hasroute('create') and admin.isGranted('CREATE') %}
|
|
|
- {% if admin.subClasses is empty %}
|
|
|
- <a class="btn btn-link" href="{{ admin.generateUrl('create')}}">
|
|
|
- <i class="fa fa-plus-circle"></i>
|
|
|
- {% trans from 'SonataAdminBundle' %}link_add{% endtrans %}
|
|
|
- </a>
|
|
|
- {% else %}
|
|
|
- <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="#">
|
|
|
- <i class="fa fa-plus-circle"></i>
|
|
|
- {% trans from 'SonataAdminBundle' %}link_add{% endtrans %}
|
|
|
- <span class="caret"></span>
|
|
|
- </a>
|
|
|
- <ul class="dropdown-menu">
|
|
|
- {% for subclass in admin.subclasses|keys %}
|
|
|
- <li>
|
|
|
- <a href="{{ admin.generateUrl('create', {'subclass': subclass}) }}">{{ subclass }}</a>
|
|
|
- </li>
|
|
|
- {% endfor %}
|
|
|
- </ul>
|
|
|
- {% endif %}
|
|
|
- {% endif %}
|
|
|
- {% if admin.hasroute('list') and admin.isGranted('LIST') %}
|
|
|
- <a class="btn btn-link" href="{{ admin.generateUrl('list')}}">
|
|
|
- <i class="glyphicon glyphicon-list"></i>
|
|
|
- {% trans from 'SonataAdminBundle' %}link_list{% endtrans -%}
|
|
|
- </a>
|
|
|
- {% endif %}
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- {% endif %}
|
|
|
- {% endfor %}
|
|
|
-
|
|
|
- {% endif %}
|
|
|
+ {% for group in groups %}
|
|
|
+ {% set display = (group.roles is empty or is_granted('ROLE_SUPER_ADMIN') ) %}
|
|
|
+ {% for role in group.roles if not display %}
|
|
|
+ {% set display = is_granted(role)%}
|
|
|
{% endfor %}
|
|
|
- </table>
|
|
|
+
|
|
|
+ {% if display %}
|
|
|
+ <div class="box">
|
|
|
+ <div class="box-header">
|
|
|
+ <h3 class="box-title">{{ group.label|trans({}, group.label_catalogue) }}</h3>
|
|
|
+ </div>
|
|
|
+ <div class="box-body">
|
|
|
+ <table class="table table-hover">
|
|
|
+ <tbody>
|
|
|
+ {% for admin in group.items %}
|
|
|
+ {% 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>
|
|
|
+ <div class="btn-group">
|
|
|
+ {% if admin.hasroute('create') and admin.isGranted('CREATE') %}
|
|
|
+ {% if admin.subClasses is empty %}
|
|
|
+ <a class="btn btn-link" href="{{ admin.generateUrl('create')}}">
|
|
|
+ <i class="fa fa-plus-circle"></i>
|
|
|
+ {% trans from 'SonataAdminBundle' %}link_add{% endtrans %}
|
|
|
+ </a>
|
|
|
+ {% else %}
|
|
|
+ <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="#">
|
|
|
+ <i class="fa fa-plus-circle"></i>
|
|
|
+ {% trans from 'SonataAdminBundle' %}link_add{% endtrans %}
|
|
|
+ <span class="caret"></span>
|
|
|
+ </a>
|
|
|
+ <ul class="dropdown-menu">
|
|
|
+ {% for subclass in admin.subclasses|keys %}
|
|
|
+ <li>
|
|
|
+ <a href="{{ admin.generateUrl('create', {'subclass': subclass}) }}">{{ subclass }}</a>
|
|
|
+ </li>
|
|
|
+ {% endfor %}
|
|
|
+ </ul>
|
|
|
+ {% endif %}
|
|
|
+ {% endif %}
|
|
|
+ {% if admin.hasroute('list') and admin.isGranted('LIST') %}
|
|
|
+ <a class="btn btn-link" href="{{ admin.generateUrl('list')}}">
|
|
|
+ <i class="glyphicon glyphicon-list"></i>
|
|
|
+ {% trans from 'SonataAdminBundle' %}link_list{% endtrans -%}
|
|
|
+ </a>
|
|
|
+ {% endif %}
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ {% endif %}
|
|
|
+ {% endfor %}
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ {% endif %}
|
|
|
+ {% endfor %}
|
|
|
{% endblock %}
|