{% extends "base.html" %}
{% block content %}

    <div class="card">
        <h2>{{ "Edit User" if user else "New User" }}</h2>

        <form method="post">
            <input name="name" placeholder="Name" value="{{ user.name if user else '' }}" required>
            <input name="email" placeholder="Email" value="{{ user.email if user else '' }}" required>

            <select name="role">
                <option value="user">User</option>
                <option value="admin">Admin</option>
            </select>

            <label>
                <input type="checkbox" name="active" {% if user and user.active %}checked{% endif %}>
                Active
            </label>

            <button class="btn btn-success">Save</button>
        </form>
    </div>

{% endblock %}