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

<!---->
{% block head_title %}{% trans "Confirm Email Address" %}{% endblock %}

<!---->
{% block content %}
<div class="container-prose">
  <h1>{% trans "Confirm Email Address" %}</h1>

  {% if confirmation %}
  <!---->
  {% user_display confirmation.email_address.user as user_display %}
  <!---->
  {% if can_confirm %}
  <p>
    {% blocktrans with confirmation.email_address.email as email trimmed %}
    Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> is an email
    address for user {{ user_display }}.{% endblocktrans %}
  </p>

  <form
    method="post"
    class="grid gap-4"
    action="{% url 'account_confirm_email' confirmation.key %}"
  >
    {% csrf_token %}{{ redirect_field }}

    <button type="submit" class="btn btn-sm btn-primary lg:btn-md 2xl:btn-lg">
      <i data-lucide="circle-check" class="size-4 lg:size-6"></i>
      {% trans "Confirm" %}
    </button>
  </form>
  {% else %}
  <p>
    {% blocktrans trimmed %}Unable to confirm {{ email }} because it is already
    confirmed by a different account.{% endblocktrans %}
  </p>
  {% endif %}
  <!---->
  {% else %}
  <!---->
  {% url 'account_email' as email_url %}
  <p>
    {% blocktrans trimmed %}This email confirmation link expired or is invalid.
    Please <a href="{{ email_url }}">issue a new email confirmation request</a>.
    {% endblocktrans %}
  </p>
  {% endif %}
</div>
{% endblock %}
