{% extends "account/base_entrance.html" %}{% load i18n allauth %}

<!---->
{% block head_title %}{% trans "Change Password" %}{% endblock %}

<!---->
{% block content %}
<div class="container-prose">
  {% if token_fail %}
  <h1>{% trans "Bad Token" %}</h1>

  {% 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 }}">new password reset</a>.{% endblocktrans %}
  </p>
  {% else %}
  <h1>{% trans "Change Password" %}</h1>

  <form action="{{ action_url }}" method="post" class="grid gap-4">
    {% csrf_token %}{{ redirect_field }}

    <!---->
    {% include 'allauth/components/form.html' %}

    <div class="grid gap-4">
      <button
        type="submit"
        name="action"
        class="btn btn-sm btn-primary lg:btn-md 2xl:btn-lg"
      >
        {% trans 'Change Password' %}
      </button>
      <button type="submit" form="logout-from-stage" class="btn btn-secondary">
        {% translate "Cancel" %}
      </button>
    </div>
  </form>
  {% endif %}
</div>

<!---->
{% if not cancel_url %}
<form id="logout-from-stage" method="post" action="{% url 'account_logout' %}">
  <input type="hidden" name="next" value="{% url 'account_login' %}" />
  {% csrf_token %}
</form>
{% endif %}
<!---->
{% endblock %}
