{% extends "socialaccount/base.jinja" %}

{% block head_title %}{% trans %}Account Connections{% endtrans %}{% endblock head_title %}

{% block content %}
<h1>{% trans %}Account Connections{% endtrans %}</h1>

{% if form.accounts %}
<p>{% trans %}You can sign in to your account using any of the following third party accounts:{% endtrans %}
</p>


<form method="post" action="{{ url('socialaccount_connections') }}">
    {% csrf_token %}

    <fieldset>
        {% if form.non_field_errors %}
        <div id="errorMsg">{{ form.non_field_errors() }}</div>
        {% endif %}

        {% for base_account in form.accounts %}
        {% with account=base_account.get_provider_account() %}
        <div>
            <label for="id_account_{{ base_account.id }}">
                <input id="id_account_{{ base_account.id }}" type="radio" name="account"
                    value="{{ base_account.id }}" />
                <span
                    class="socialaccount_provider {{ base_account.provider }} {{ account.get_brand().id }}">{{account.get_brand().name}}</span>
                {{ account }}
            </label>
        </div>
        {% endwith %}
        {% endfor %}

        <div>
            <button type="submit">{% trans %}Remove{% endtrans %}</button>
        </div>

    </fieldset>

</form>

{% else %}
<p>{% trans %}You currently have no social network accounts connected to this account.{% endtrans %}</p>
{% endif %}

<h2>{% trans %}Add a 3rd Party Account{% endtrans %}</h2>

<ul class="socialaccount_providers">
    {% with process="connect"%}
    {% include "socialaccount/snippets/provider_list.jinja" %}
    {% endwith %}
</ul>

{% include "socialaccount/snippets/login_extra.jinja" %}

{% endblock content %}