{% extends "base.html" %}
{% load i18n %}

{% block content %}
  <div class="heading">
    <h1 class="heading__profiles">{% trans "Change Pin" %}</h1>
  </div>
<div class="profiles">
  <form method="post" action="" class="profiles__form">
  {% csrf_token %}
    {% if form.errors or form.non_field_errors %}
      {% if form.non_field_errors %}
          {% for error in form.non_field_errors %}
              <span class="error">{{ error }}</span>
          {% endfor %}
      {% endif %}
    {% endif %}

    {% if messages %}
      <ul class="error-list">
        {% for message in messages %}
        <li class="error-list__item error">{{ message }}</li>
        {% endfor %}
      </ul>
    {% endif %}

    <fieldset>
      <label for="id_old_pin">{% trans "Old pin" %}</label>
      {{form.old_password}}
      <span class="input-hint">{% trans "(e.g. 2086)" %}</span>
      {{form.old_password.errors}}
    </fieldset>

    <fieldset>
      <label for="id_new_password">{% trans "New pin" %}</label>
      {{form.new_password}}
      {{form.new_password.errors}}
    </fieldset>

    <fieldset>
      <label for="id_confirm_password">{% trans "Confirm New pin" %}</label>
      {{form.confirm_password}}
      {{form.confirm_password.errors}}
    </fieldset>
    <input type="submit" value="{% trans "Save" %}" class="call-to-action__button call-to-action__button--primary">
  </form>
</div>
{% endblock %}
