{% extends 'layouts/app.html' %}
{% import 'macros/form.html' as f with context %}

{% block title %}Update your sign in information{% endblock %}

{% block body %}
  <div class="container">
    <div class="row">
      <div class="col-md-6 offset-md-3 card bg-light">
        {% call f.form_tag('user.update_credentials') %}
          <h2 class="mt-2 mb-4">Update your sign in information</h2>
          <p class="mb-0">Supply your current password to make any changes.</p>

          {% call f.form_group(form.current_password, css_class='mb-4',
                               autofocus='autofocus') %}
          {% endcall %}

          {% call f.form_group(form.email) %}{% endcall %}
          {% call f.form_group(form.password,
                               placeholder='New password (optional)') %}
          {% endcall %}

          <div class="row mb-3">
            <div class="col-md-6">
              <button type="submit" class="btn btn-primary btn-block">
                Save
              </button>
            </div>
            <div class="col-md-6">
              <a href="{{ url_for('user.settings') }}"
                 class="btn btn-outline-secondary btn-block">
                Nevermind
              </a>
            </div>
          </div>
      {% endcall %}
      </div>
    </div>
  </div>
{% endblock %}
