{% extends 'auth/base-site-user.html' %}
{% from 'auth/form.html' import edit_permissions_form %}


{% block content2 %}

    <h1 class="mt-3 mb-4">Edit Permissions</h1>

    <div class="bg-white rounded border p-3 my-3">

        <div class="d-flex">
            <h2 class="flex-fill">{{ selected_user.username }}</h2>
            <div class="flex-shrink-0 dropdown">
                <a class="btn btn-secondary dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                    Select a user
                </a>

                <ul class="dropdown-menu">
                    {% for user in users %}
                        <li><a class="dropdown-item" href="{{ url_for('auth.change_permissions', id_=user.id) }}">
                            {{ user.last_name }}, {{ user.first_name }}
                        </a></li>
                    {% endfor %}
                </ul>
            </div>
        </div>

        <hr>

        {{ edit_permissions_form(form) }}

    </div>

{% endblock %}