{% extends "withoutnav_template.html" %}
{% from "components/page-header.html" import page_header %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/form.html" import form_wrapper %}
{% from "components/components/back-link/macro.njk" import usaBackLink %}

{% block per_page_title %}
  Change your {{ thing }}
{% endblock %}

{% block backLink %}
  {{ usaBackLink({ "href": url_for('.user_profile') }) }}
{% endblock %}

{% block maincolumn_content %}

  {{ page_header('Change your {}'.format(thing)) }}

  <div class="grid-row">
    <div class="grid-col-9">
      {% call form_wrapper() %}
        {{ form_field(error_message_with_html=True) }}
        {% if current_user.auth_type == 'email_auth' and (current_user.mobile_number and thing == "mobile number") %}
          {{ page_footer(
            'Save',
            delete_link=url_for(
              'main.user_profile_mobile_number_delete',
              user_id=current_user.id
            ),
            delete_link_text='Delete your number'
            )
          }}
        {% else %}
          {{ page_footer('Save')}}
        {% endif %}
      {% endcall %}
    </div>
  </div>
{% endblock %}
