{% extends theme("layout.html") %}
{% import "utils.html" as utils with context %}
{% block content %}
    <h1>{{ _("Groups") }}</h1>
    <table id="moin-group-browser" class="zebra moin-sortable" data-sortlist="[[0,0]]">
        <thead>
            <tr>
                <th>{{ _("Group Names") }}</th>
                <th>{{ _("Member Users") }}</th>
                <th>{{ _("Member Groups") }}</th>
                <th data-sorter="false">{{ _("Group ACL Report") }}</th>
            </tr>
        </thead>
        <tbody>
            {% for group in groups %}
                <tr>
                    <td>
                        {% if group['grouptype'] == 'WikiGroup' %}
                            <a href="{{ url_for('frontend.modify_item', item_name=group['name']) }}">
                                {{ group['name'] }}
                            </a>
                        {% else %}
                            {{ group['name'] }}
                        {% endif %}
                    </td>
                    <td>{{ group['member_users']|sort|join(', ') }}</td>
                    <td>{{ group['member_groups']|sort|join(', ') }}</td>
                    <td><a class="moin-button" href="{{ url_for('admin.group_acl_report', group_name=group['name']) }}">{{ _("ACL Report") }}</a></td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endblock %}
