mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 11:27:09 +00:00
[FEAT] Enable django-allauth for enhanced user management & federation
This commit is contained in:
11
breccia_mapper/templates/socialaccount/authentication_error.html
Executable file
11
breccia_mapper/templates/socialaccount/authentication_error.html
Executable file
@@ -0,0 +1,11 @@
|
||||
{% extends "socialaccount/base.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block head_title %}{% trans "Federated Login Failure" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% trans "Federated Login Failure" %}</h1>
|
||||
|
||||
<p>{% trans "An error occurred while attempting to log in via your third party account." %}</p>
|
||||
{% endblock %}
|
||||
1
breccia_mapper/templates/socialaccount/base.html
Executable file
1
breccia_mapper/templates/socialaccount/base.html
Executable file
@@ -0,0 +1 @@
|
||||
{% extends "account/base.html" %}
|
||||
70
breccia_mapper/templates/socialaccount/connections.html
Executable file
70
breccia_mapper/templates/socialaccount/connections.html
Executable file
@@ -0,0 +1,70 @@
|
||||
{% extends "socialaccount/base.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block head_title %}{% trans "Account Connections" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
<a class="btn btn-primary mb-4" href="{% url 'account_email' %}">{% trans "Account Details" %}</a>
|
||||
|
||||
<h2 class="h2" id="head_banner">{% trans "Account Connections" %}</h2>
|
||||
|
||||
{% 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">{{ form.non_field_errors }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% for base_account in form.accounts %}
|
||||
{% with base_account.get_provider_account as 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 }}">
|
||||
{% if account.get_brand.name == "Microsoft Graph" %}
|
||||
Microsoft
|
||||
{% else %}
|
||||
{{ account.get_brand.name }}
|
||||
{% endif %}
|
||||
-
|
||||
</span>
|
||||
{{ account }}
|
||||
</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 third party accounts connected to this account.' %}</p>
|
||||
{% endif %}
|
||||
|
||||
<h3 class="h3" id="head_banner">{% trans 'Add Federated Login Account' %}</h3>
|
||||
|
||||
<p>Adding a third party account allows you to log in to this site with it.</p>
|
||||
|
||||
<div class="social_providers_list">
|
||||
{% include "socialaccount/snippets/provider_list.html" with process="connect" %}
|
||||
</div>
|
||||
|
||||
{% include "socialaccount/snippets/login_extra.html" %}
|
||||
|
||||
{% endblock %}
|
||||
15
breccia_mapper/templates/socialaccount/login_cancelled.html
Executable file
15
breccia_mapper/templates/socialaccount/login_cancelled.html
Executable file
@@ -0,0 +1,15 @@
|
||||
{% extends "socialaccount/base.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block head_title %}{% trans "Login Cancelled" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>{% trans "Login Cancelled" %}</h1>
|
||||
|
||||
{% url 'account_login' as login_url %}
|
||||
|
||||
<p>{% blocktrans %}Login was cancelled. If this was a mistake, please proceed to <a href="{{login_url}}">sign in</a>.{% endblocktrans %}</p>
|
||||
|
||||
{% endblock %}
|
||||
2
breccia_mapper/templates/socialaccount/messages/account_connected.txt
Executable file
2
breccia_mapper/templates/socialaccount/messages/account_connected.txt
Executable file
@@ -0,0 +1,2 @@
|
||||
{% load i18n %}
|
||||
{% blocktrans %}Your third party account has been connected.{% endblocktrans %}
|
||||
@@ -0,0 +1,2 @@
|
||||
{% load i18n %}
|
||||
{% blocktrans %}Your third party account is already connected to a different account on this site.{% endblocktrans %}
|
||||
2
breccia_mapper/templates/socialaccount/messages/account_disconnected.txt
Executable file
2
breccia_mapper/templates/socialaccount/messages/account_disconnected.txt
Executable file
@@ -0,0 +1,2 @@
|
||||
{% load i18n %}
|
||||
{% blocktrans %}Your third party account has been disconnected.{% endblocktrans %}
|
||||
24
breccia_mapper/templates/socialaccount/signup.html
Executable file
24
breccia_mapper/templates/socialaccount/signup.html
Executable file
@@ -0,0 +1,24 @@
|
||||
{% extends "socialaccount/base.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block head_title %}{% trans "Signup" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{% trans "Sign Up" %}</h1>
|
||||
|
||||
<p>{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {% if provider_name == 'Microsoft Graph' %}Microsoft{% else %}{{provider_name}}{% endif %} account to sign up to
|
||||
{{site_name}}.{% endblocktrans %}</p>
|
||||
|
||||
<form class="signup" id="signup_form" method="post" action="{% url 'socialaccount_signup' %}">
|
||||
{% csrf_token %}
|
||||
|
||||
{% load bootstrap4 %}
|
||||
{% bootstrap_form form %}
|
||||
{% if redirect_field_value %}
|
||||
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
|
||||
{% endif %}
|
||||
<button type="submit">{% trans "Sign Up" %} »</button>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
3
breccia_mapper/templates/socialaccount/snippets/login_extra.html
Executable file
3
breccia_mapper/templates/socialaccount/snippets/login_extra.html
Executable file
@@ -0,0 +1,3 @@
|
||||
{% load socialaccount %}
|
||||
|
||||
{% providers_media_js %}
|
||||
22
breccia_mapper/templates/socialaccount/snippets/provider_list.html
Executable file
22
breccia_mapper/templates/socialaccount/snippets/provider_list.html
Executable file
@@ -0,0 +1,22 @@
|
||||
{% load socialaccount %}
|
||||
|
||||
{% get_providers as socialaccount_providers %}
|
||||
|
||||
{% for provider in socialaccount_providers %}
|
||||
{% if provider.id == "openid" %}
|
||||
{% for brand in provider.get_brands %}
|
||||
<form action="{% provider_login_url provider.id openid=brand.openid_url process=process %}" method="post">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-outline-dark" type="submit">
|
||||
{{ brand.name }}
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<form action="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}" method="post">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-outline-dark" type="submit">
|
||||
{% if provider.name == 'Microsoft Graph' %}Microsoft{% else %}{{provider.name}}{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user