django-allauth-ens/allauth_ens/templates/socialaccount/connections.html

73 lines
2 KiB
HTML
Raw Normal View History

{% extends "allauth_ens/base.html" %}
2017-08-03 12:40:52 +02:00
{% load i18n %}
2017-09-16 02:32:42 +02:00
{% load socialaccount allauth_ens_social %}
2017-08-03 12:40:52 +02:00
2017-09-16 02:32:42 +02:00
{% block title %}{% trans "Account Connections" %}{% endblock %}
{% block header-title %}{% trans "Account Connections" %}{% endblock %}
2017-08-03 12:40:52 +02:00
{% block content %}
<section>
<p>
{% if form.accounts %}
{% blocktrans %}
You can sign in to your account using any of the following third party accounts:
{% endblocktrans %}
{% else %}
{% blocktrans %}
You currently have no third party accounts connected to this account.
{% endblocktrans %}
{% endif %}
</p>
<ul class="connections-providers-list">
2017-09-16 02:32:42 +02:00
{% get_accounts_by_providers user as accounts_by_providers %}
2017-08-03 12:40:52 +02:00
2017-09-16 02:32:42 +02:00
{% for provider, accounts in accounts_by_providers.items %}
2017-08-03 12:40:52 +02:00
<li>
<div class="heading">
<a class="connect" href="{% provider_login_url provider.id process="connect" scope=scope auth_params=auth_params %}">
<i class="fa fa-plus"></i>
</a>
{{ provider.name }}
</div>
2017-08-03 12:40:52 +02:00
2017-09-16 02:32:42 +02:00
{% if accounts %}
<ul class="connections-list">
2017-09-16 02:32:42 +02:00
{% for account in accounts %}
2017-08-03 12:40:52 +02:00
<li>
<div class="delete">
2017-09-16 02:32:42 +02:00
<form action="{% url "socialaccount_connections" %}" method="post">
{% csrf_token %}
<input type="hidden" name="account" value="{{ account.id }}">
<button type="submit" class="link">
<i class="fa fa-remove"></i>
</button>
2017-09-16 02:32:42 +02:00
</form>
</div>
<i class="fa fa-user"></i>
{% with profile_urlaccount.get_profile_url as profile_url %}
{% firstof account.extra_data.name account.extra_data.username account.uid as account_label %}
{% if profile_url %}
<a href="{{ get_profile_url }}" target="blank">
2017-09-16 02:32:42 +02:00
{{ account_label }}
</a>
{% else %}
{{ account_label }}
{% endif %}
{% endwith %}
2017-08-03 12:40:52 +02:00
</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</ul>
</section>
{% endblock %}