{% extends 'base.html' %}
{% load i18n %}
{% load account allauth %}

{% block head_title %}{% trans "Confirm Email Address" %}{% endblock head_title %}

{% block content %}
<div class="container mx-auto max-w-md mt-6">
  <h1 class="text-3xl font-bold text-center mb-6">{% trans "Confirm Email Address" %}</h1>
  {% if confirmation %}
    {% user_display confirmation.email_address.user as user_display %}
    {% if can_confirm %}
      <p class="mb-4">
        {% blocktrans with confirmation.email_address.email as email %}
          Please confirm that <a class="text-primary underline" href="mailto:{{ email }}">{{ email }}</a> is an email address for user {{ user_display }}.
        {% endblocktrans %}
      </p>
      {% url 'account_confirm_email' confirmation.key as action_url %}
      <form method="post" action="{{ action_url }}" class="space-y-4">
        {% csrf_token %}
        {{ redirect_field }}
        <button type="submit" class="btn btn-primary w-full">{% trans "Confirm" %}</button>
      </form>
    {% else %}
      <p>
        {% blocktrans %}Unable to confirm {{ confirmation.email_address.email }} because it is already confirmed by a different account.{% endblocktrans %}
      </p>
    {% endif %}
  {% else %}
    {% url 'account_email' as email_url %}
    <p>
      {% blocktrans %}This email confirmation link expired or is invalid. Please <a class="text-primary underline" href="{{ email_url }}">issue a new email confirmation request</a>.{% endblocktrans %}
    </p>
  {% endif %}
</div>
{% endblock content %}
