{% extends 'hidp/base_post_login.html' %}
{% load i18n %}

{% block title %}{% translate 'Link account' %}{% endblock %}

{% block main %}
  <h1>{% translate 'Link account' %}</h1>

  <p>
    {% blocktranslate trimmed with provider.name as provider %}
      You are about to link your {{ provider }} account to your existing account.
    {% endblocktranslate %}
  </p>

  <p>
    {% if user_email != provider_email %}
      {% blocktranslate trimmed with provider.name as provider %}
        This will allow you to use your {{ provider }} account ({{ provider_email }}) to sign in to
        your existing account ({{ user_email }}).
      {% endblocktranslate %}

    {% else %}
      {% blocktranslate trimmed with provider.name as provider %}
        This will allow you to use your {{ provider }} account to sign in to your existing account.
      {% endblocktranslate %}

    {% endif %}
  </p>

  <p>
    {% translate 'Are you sure you want to do this?' %}
  </p>

  <form method="post">
    {% csrf_token %}
    {{ form }}
    {% include 'hidp/includes/forms/submit_row.html' with submit_label=form.fields.allow_link.label cancel_url=cancel_url %}
  </form>
{% endblock %}
