{% load i18n %}
<hr>
<div class="small">

<div id="iam-groups" class="cv-scroll-anchor"></div>
<table class="table table-hover table-bordered table-sm">
    <colgroup><col style="width:30%"><col style="width:12%"><col></colgroup>
    <tr class="table-success">
        <th><strong>{% translate 'Groups' %}</strong></th>
        <th><strong>{% translate 'Type' %}</strong></th>
        <th><strong>{% translate 'Description' %}</strong></th>
    </tr>
    {% for g in iam_groups %}
    <tr>
        <td><a href="{% url 'app_data:instance_detail' g.id %}">{{ g.displayname }}</a></td>
        <td>{{ g.kind }}</td>
        <td>{{ g.description }}</td>
    </tr>
    {% empty %}
    <tr><td colspan="3" class="text-muted">{% translate 'No groups' %}</td></tr>
    {% endfor %}
</table>

<div id="iam-roles" class="cv-scroll-anchor"></div>
<table class="table table-hover table-bordered table-sm">
    <colgroup><col style="width:30%"><col style="width:12%"><col></colgroup>
    <tr class="table-danger">
        <th><strong>{% translate 'Roles' %}</strong></th>
        <th><strong>{% translate 'Type' %}</strong></th>
        <th><strong>{% translate 'Description' %}</strong></th>
    </tr>
    {% for r in iam_roles %}
    <tr>
        <td><a href="{% url 'app_data:instance_detail' r.id %}">{{ r.displayname }}</a></td>
        <td>{{ r.kind }}</td>
        <td>{{ r.description }}</td>
    </tr>
    {% empty %}
    <tr><td colspan="3" class="text-muted">{% translate 'No roles' %}</td></tr>
    {% endfor %}
</table>

<div id="iam-permissions" class="cv-scroll-anchor"></div>
<table class="table table-hover table-bordered table-sm">
    <colgroup><col style="width:30%"><col style="width:12%"><col></colgroup>
    <tr class="table-warning">
        <th><strong>{% translate 'Permissions' %}</strong></th>
        <th><strong>{% translate 'Display name' %}</strong></th>
        <th><strong>{% translate 'Description' %}</strong></th>
    </tr>
    {% for p in iam_permissions %}
    <tr>
        <td>{{ p.keyname }}</td>
        <td>{{ p.displayname|default:'' }}</td>
        <td>{{ p.description|default:'' }}</td>
    </tr>
    {% empty %}
    <tr><td colspan="3" class="text-muted">{% translate 'No permissions' %}</td></tr>
    {% endfor %}
</table>

</div>
