{% extends "base.html" %}
{% block title %}Manage Users{% endblock %}
{% block content %}
<div class="container mt-4">
    <h1>Manage Users</h1>
    {% if users %}
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>Username</th>
                    <th>Email</th>
                    <th>Admin</th>
                    <th>Force Password Change</th>
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                {% for user in users %}
                    <tr>
                        <td>{{ user.username }}</td>
                        <td>{{ user.email }}</td>
                        <td>{{ 'Yes' if user.is_admin else 'No' }}</td>
                        <td>{{ 'Yes' if user.force_password_change else 'No' }}</td>
                        <td>
                            <a href="{{ url_for('gallery.edit_user', user_id=user.id) }}" class="btn btn-warning btn-sm">Edit</a>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p>No users found.</p>
    {% endif %}
</div>
{% endblock %}