{% extends "base.html" %}
{% block content %}
<div class="profiles">
    <form method="post" id="frmProfilePasswordChange" action="" class="profiles__form" novalidate>
    {% csrf_token %}
        {% trans "Change Your Pin" as headingtext %}

        {# include template "patterns/basics/headings/sp_variations/heading.html" #}
          {% with type="basic" htmltag="h2" title=headingtext %}
            <div class="heading heading__{{type}} {{extraclass}}">
              <{{htmltag}}>{{title}}</{{htmltag}}>
            </div>
          {% endwith %}
        {# end include template #}

        {% if form.errors or form.non_field_errors %}
            {% if form.non_field_errors %}
                {% for error in form.non_field_errors %}
                    <p class="errors">{{ error }}</p>
                {% endfor %}
            {% endif %}
        {% endif %}
        {% if messages %}
            <ul class="error-list">
                {% for message in messages %}
                    <li class="error-list__item">{{ message }}</li>
                {% endfor %}
            </ul>
        {% endif %}

        <fieldset>
            <div class="input-group{% if form.old_password.errors %} input-error{% endif %}">
                <label>{% trans "Old Pin:" %}</label>
                {{form.old_password}}
                {{form.old_password.errors}}
            </div>
        </fieldset>
        <fieldset>
            <div class="input-group{% if form.new_password.errors %} input-error{% endif %}">
                <label>{% trans "New Pin:" %}</label>
                {{form.new_password}}
                {{form.new_password.errors}}
            </div>
        </fieldset>
        <fieldset>
            <div class="input-group{% if form.confirm_password.errors %} input-error{% endif %}">
                <label>{% trans "Confirm New Pin:" %}</label>
                {{form.confirm_password}}
                {{form.confirm_password.errors}}
            </div>
        </fieldset>
        <button type="submit" class="call-to-action__button call-to-action__button--primary">{% trans "Change Pin" %}</button>
    </form>
    <a href="{{VIEW_PROFILE_URL}}" class="call-to-action__nav-item-text call-to-action__nav-item-text--left">Back to profile</a>
</div>
{% endblock %}
