{% extends "base.html" %}

{% block content %}
<table class="table table-striped">
    <thead>
        <tr>
            <th>Username</th>
            <th>User Level</th>
            <th>Peer Groups</th>
            <th></th>
            <th></th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        {% for user_acl in user_acl_list %}
        <tr>
            <td>{{ user_acl.user.username }}</td>
            <td>{{ user_acl.get_user_level_display }}</td>
            <td>
                {% if user_acl.peer_groups.all %}
                    {% for peer_group in user_acl.peer_groups.all %}
                        <a href="/user/peer-group/manage/?uuid={{ peer_group.uuid }}">{{ peer_group.name }}</a>{% if not forloop.last %}, {% endif %}
                    {% endfor %}
                {% else %}
                    Any
                {% endif %}
            </td>
            <td style="width: 1%; white-space: nowrap;">
                {% if user_acl.enable_console %}
                <i class="fas fa-terminal" title="Console Enabled"></i>
                {% endif %}
            </td>
            <td style="width: 1%; white-space: nowrap;">
                {% if user_acl.enable_enhanced_filter %}
                <i class="fas fa-eye-slash" title="Enhanced Filter Enabled"></i>
                {% endif %}
            </td>
            <td style="width: 1%; white-space: nowrap;">
                <a href="/user/manage/?uuid={{ user_acl.uuid }}" ><i class="far fa-edit"></i></a>
            </td>
        </tr>
        {% endfor %}
    </tbody>
    </table>
    {% include "user_manager/list_buttons.html" %}

{% endblock %}
