{% extends "user-settings.html" %}

{% import '_form_macros.html' as macros %}
{% block settings_content %}
<form action="{{ url_for('.user_settings_password', username=current_user.username) }}" method="post">
  <div class="card-body">
    <h5 id="pageheading">{{ _("Change Password") }}</h5>
    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
    <div class="form-group" id="currentpasswordinput">{{ macros.with_errors(password_reset_form.current_password, tabindex="2")}}</div>
    <div class="form-group">{{ macros.with_errors(password_reset_form.password, tabindex="3")}}</div>
    <div class="form-group">{{ macros.with_errors(password_reset_form.password_confirm, tabindex="4")}}</div>
    {% if using_otp %}
    <div class="form-group" id="otpinput">{{ macros.with_errors(password_reset_form.otp, tabindex="5")}}</div>
    {% endif %}
  </div>
  <div class="card-footer d-flex justify-content-between">
    <div>{{ macros.non_field_errors(password_reset_form) }}</div>
    <button class="btn btn-primary" id="submit" type="submit" tabindex="6">{{_("Change Password")}}</button>
  </div>
</form>
{% endblock %}
