user-settings template for social accounts

This commit is contained in:
Matthias 2021-08-26 23:17:00 +02:00
parent 118bac0591
commit c34a5967b8
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -2,6 +2,7 @@
{% load i18n %} {% load i18n %}
{% load inventree_extras %} {% load inventree_extras %}
{% load socialaccount %}
{% block label %}account{% endblock %} {% block label %}account{% endblock %}
@ -38,6 +39,54 @@
</tr> </tr>
</table> </table>
<div class='panel-heading'>
<h4>{% trans "Social Accounts" %}</h4>
</div>
<div class='row'>
{% 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 }}">{{account.get_brand.name}}</span>
{{ account }}
</label>
</div>
{% endwith %}
{% endfor %}
<div>
<button type="submit">{% trans 'Remove' %}</button>
</div>
</fieldset>
</form>
{% else %}
<p>{% trans 'You currently have no social network accounts connected to this account.' %}</p>
{% endif %}
<h3>{% trans 'Add a 3rd Party Account' %}</h3>
{% include "socialaccount/snippets/provider_list.html" with process="connect" %}
{% include "socialaccount/snippets/login_extra.html" %}
</div>
<div class='panel-heading'> <div class='panel-heading'>
<h4>{% trans "Theme Settings" %}</h4> <h4>{% trans "Theme Settings" %}</h4>
</div> </div>