{% extends 'account/base.html' %}

{% load i18n %}

{% block head_title %}{% trans 'Change Password' %}{% endblock %}

{% block content %}
{% if token_fail %}
<div class="alert alert-error mb-4">
  <div class="flex-1 items-center">
    <i class="ri-error-warning-line mr-4 text-4xl"></i>
    <label>{% trans 'Bad Token' %}</label>
  </div>
</div>
{% else %}
<h3 class="mb-2">{% trans 'Change Password' %}</h3>
{% endif %}

{% if token_fail %}
{% url 'account_reset_password' as passwd_reset_url %}
<p>
  {% blocktrans trimmed %}
  The password reset link was invalid, possibly because it has already been used.
  Please request a <a href="{{ passwd_reset_url }}" class="link-accent">new password reset</a>.
  {% endblocktrans %}
</p>
{% elif form %}
<form method="POST" action="{{ action_url }}">
  {% csrf_token %}
  {{ form.as_p }}
  <div class="flex justify-end pb-0 pt-5">
    <button class="btn btn-primary" name="action">
      {% trans 'Change Password' %}
    </button>
  </div>
</form>
{% else %}
<p>
  {% blocktrans trimmed %}
  Your password is now changed.
  {% endblocktrans %}
</p>
{% endif %}

{% endblock %}
