{% extends "sentry/bases/account.html" %}

{% load crispy_forms_tags %}
{% load i18n %}
{% load sentry_auth %}
{% load sentry_helpers %}

{% block title %}{% trans "Identities" %} | {{ block.super }}{% endblock %}

{% block main %}
    <fieldset>
        <legend>{% trans "Current Identities" %}</legend>
    </fieldset>
    {% if not identity_list %}
        <div class="well">{% trans "There are no identities associated with this account." %}</div>
    {% else %}
        <table class="table simple-table">
            <thead>
                <tr>
                    <th>{% trans "Identity" %}</th>
                    <th style="width: 100px">&nbsp;</th>
                </tr>
            </thead>
            <tbody>
                {% for identity in identity_list %}
                    <tr>
                        <td>{{ identity.provider|auth_provider_label }}</td>
                        <td style="text-align: center;">
                            <form method="post"
                                  action="{% url 'sentry-account-disconnect-identity' identity.id %}">
                                {% csrf_token %}
                                <button type="submit" class="btn btn-default btn-sm">Disconnect</button>
                            </form>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% endif %}
{% endblock %}
