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

<div id="iam-users" class="cv-scroll-anchor"></div>
<table class="table table-hover table-bordered table-sm">
    <colgroup><col style="width:20%"><col style="width:25%"><col style="width:25%"><col></colgroup>
    <tr class="table-warning">
        <th><strong>{% translate 'Direct Users' %}</strong></th>
        <th><strong>{% translate 'Display name' %}</strong></th>
        <th><strong>{% translate 'Email' %}</strong></th>
        <th><strong>{% translate 'Mobile' %}</strong></th>
    </tr>
    {% for u in iam_users %}
    <tr>
        <td><a href="{% url 'app_data:instance_detail' u.id %}">{{ u.keyname }}</a></td>
        <td>{{ u.displayname }}</td>
        <td>{{ u.email }}</td>
        <td>{{ u.mobile }}</td>
    </tr>
    {% empty %}
    <tr><td colspan="4" class="text-muted">{% translate 'No users' %}</td></tr>
    {% endfor %}
</table>

<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:30%"><col></colgroup>
    <tr class="table-success">
        <th><strong>{% translate 'Groups' %}</strong></th>
        <th><strong>{% translate 'Display name' %}</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.keyname }}</a></td>
        <td>{{ g.displayname }}</td>
        <td>{{ g.description }}</td>
    </tr>
    {% empty %}
    <tr><td colspan="3" class="text-muted">{% translate 'No groups' %}</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:30%"><col></colgroup>
    <tr class="table-danger">
        <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>
