{% extends "dcbase/profile_edit.html" %}
{% load i18n %}

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

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

            <fieldset>
                {% if form.non_field_errors %}
                    <div id="errorMsg" class="alert alert-danger">{{ form.non_field_errors }}</div>
                {% endif %}

                {% for base_account in form.accounts %}
                    {% with base_account.get_provider_account as account %}
                        <div class="radio">
                            <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>
                                <span class="text-muted"> {{ account }}</span>
                            </label>
                        </div>
                    {% endwith %}
                {% endfor %}

                <div>
                    <button class="btn btn-danger" type="submit">{% trans 'Remove' %}</button>
                </div>
            </fieldset>
        </form>
    {% else %}
        <p>{% trans 'You currently have no social network accounts connected to this account.' %}</p>
    {% endif %}

    <hr />

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

    <ul class="list-group">
        {% include "socialaccount/snippets/provider_list.html" with process="connect" %}
    </ul>

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

{% endblock %}
