{% extends "auth/admin.base.html.j2" %}


{% block appcontent %}
<table class="{{ config['CASUAL_THEME_DEFAULT_TABLE'] }}">
  <thead>
    <tr>
      <th class="loop-index">#</th>
      <th>{{ _('Name') }}</th>
      <th>{{ _('Roles') }}</th>
    </tr>
  </thead>
  <tbody>
    {% for group in permissions | groupby('group') %}
    <tr>
      <th colspan="3">{{ group.grouper }}</th>
    </tr>
    {% for permission in group.list | sort(attribute='name') %}
    <tr>
      <td>{{ loop.index }}</td>
      <td>{{ permission.name }}</td>
      <td>
        {% for role in permission.roles %}
        {{ badge(role.name) }}
        {% endfor %}
      </td>
    </tr>
    {% endfor %}
    {% endfor %}
  </tbody>
</table>
{% endblock appcontent %}