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

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

{% block body %}
  <div class="row">
    <div class="col-md-4 col-md-offset-4 well">
      {% call f.form_tag('user.update_credentials') %}
        <legend>Update your sign in information</legend>
        <p class="small help-block sm-margin-bottom">
          Supply your current password to make any changes.
        </p>

        {% call f.form_group(form.current_password, css_class='lg-margin-bottom',
                             autofocus='autofocus') %}
        {% endcall %}

        {% call f.form_group(form.email, css_class='sm-margin-bottom') %}
        {% endcall %}
        {% call f.form_group(form.password, css_class='sm-margin-bottom',
                             placeholder='New password (optional)') %}
        {% endcall %}

        <div class="row">
          <div class="col-md-6">
            <button type="submit" class="btn btn-primary btn-block">
              Save
            </button>
          </div>
          <div class="col-md-6">
            <div class="visible-xs visible-sm sm-margin-top"></div>
            <a href="{{ url_for('user.settings') }}"
               class="btn btn-default btn-block">
              Nevermind
            </a>
          </div>
        </div>
      {% endcall %}
    </div>
  </div>
{% endblock %}
