{% extends "base.html" %} {% block title %}{{ title }}{% endblock %} {% block content %}
{# ── Account Status card (edit mode only, not own account) ── #} {% if user and user.id != current_user.id %}
Account Status: {{ 'Active' if user.active else 'Disabled' }}
{% if user.active %} Disabling this account will immediately prevent the user from logging in. {% else %} This account is currently disabled — the user cannot log in. {% endif %}
{% endif %} {# ── Edit form ── #}

{{ title }}

{{ form.hidden_tag() }}
{{ form.username.label(class="form-label") }} {{ form.username(class="form-control") }} {% if form.username.errors %}
{% for error in form.username.errors %}{{ error }}{% endfor %}
{% endif %}
{{ form.email.label(class="form-label") }} {{ form.email(class="form-control") }} {% if form.email.errors %}
{% for error in form.email.errors %}{{ error }}{% endfor %}
{% endif %}
{{ form.password.label(class="form-label") }} {{ form.password(class="form-control", placeholder="Leave blank to keep current" if user else "") }} {% if form.password.errors %}
{% for error in form.password.errors %}{{ error }}{% endfor %}
{% endif %}
{{ form.confirm_password.label(class="form-label") }} {{ form.confirm_password(class="form-control") }} {% if form.confirm_password.errors %}
{% for error in form.confirm_password.errors %}{{ error }}{% endfor %}
{% endif %}
{{ form.role.label(class="form-label") }} {{ form.role(class="form-select") }}
Cancel
{% endblock %}