2025.10.06-03:08:05

This commit is contained in:
2025-10-06 03:08:05 +02:00
parent 38a85cb9d5
commit e08b03bb42
57 changed files with 3222 additions and 157 deletions

View File

@@ -0,0 +1,55 @@
{% extends 'base.html' %}
{# {% extends "socialaccount/base_manage.html" %} #}
{% load i18n %}
{% load allauth %}
{% block head_title %}
{% trans "Account Connections" %}
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% trans "Account Connections" %}
{% endelement %}
{% if form.accounts %}
{% element p %}
{% blocktrans %}You can sign in to your account using any of the following third-party accounts:{% endblocktrans %}
{% endelement %}
{% url 'socialaccount_connections' as action_url %}
{% element form form=form method="post" action=action_url %}
{% slot body %}
{% csrf_token %}
{% for acc in form.fields.account.choices %}
{% with account=acc.0.instance.get_provider_account %}
{% setvar radio_id %}
id_account_{{ account.account.pk }}
{% endsetvar %}
{% setvar tags %}
socialaccount,{{ account.account.provider }}
{% endsetvar %}
{% element field id=radio_id type="radio" name="account" value=account.account.pk %}
{% slot label %}
{{ account }}
{% element badge tags=tags %}
{{ account.get_brand.name }}
{% endelement %}
{% endslot %}
{% endelement %}
{% endwith %}
{% endfor %}
{% endslot %}
{% slot actions %}
{% element button tags="delete,danger" class="btn btn-danger" type="submit" %}
{% trans 'Remove' %}
{% endelement %}
{% endslot %}
{% endelement %}
{% else %}
{% element p %}
{% trans 'You currently have no third-party accounts connected to this account.' %}
{% endelement %}
{% endif %}
{% element h2 %}
{% trans 'Add a Third-Party Account' %}
{% endelement %}
{% include "socialaccount/snippets/provider_list.html" with process="connect" %}
{% include "socialaccount/snippets/login_extra.html" %}
{% endblock content %}

View File

@@ -0,0 +1,18 @@
{% load allauth socialaccount %}
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
{% element provider_list %}
{% for provider in socialaccount_providers %}
{% if not provider.name == "OpenID" %}
{% for brand in provider.get_brands %}
{% provider_login_url provider openid=brand.openid_url process=process as href %}
{% element provider name=brand.name provider_id=provider.id href=href %}
{% endelement %}
{% endfor %}
{% endif %}
{% provider_login_url provider process=process scope=scope auth_params=auth_params as href %}
{% element provider name=provider.name provider_id=provider.id href=href %}
{% endelement %}
{% endfor %}
{% endelement %}
{% endif %}