From 313091319111a15a583c596aa91921a82b484768 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Wed, 13 Oct 2021 10:49:04 +0200 Subject: [PATCH] Customize account views --- photo21/templates/account/email.html | 79 +++++++++++++++++++ .../templates/socialaccount/connections.html | 66 ++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 photo21/templates/account/email.html create mode 100644 photo21/templates/socialaccount/connections.html diff --git a/photo21/templates/account/email.html b/photo21/templates/account/email.html new file mode 100644 index 0000000..d7c472f --- /dev/null +++ b/photo21/templates/account/email.html @@ -0,0 +1,79 @@ +{% extends "account/base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-2.0-or-later +{% endcomment %} +{% load i18n crispy_forms_tags %} +{% block head_title %}{% trans "E-mail Addresses" %}{% endblock %} + +{% block content %} +

{% trans "Account" %}

+
+ +
+ {% if user.emailaddress_set.all %} +

{% trans 'The following e-mail addresses are associated with your account:' %}

+ + + {% else %} +

{% trans 'Warning:'%} {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}

+ {% endif %} + + {% if can_add_email %} +

{% trans "Add E-mail Address" %}

+ +
+ {% csrf_token %} + {{ form|crispy }} + +
+ {% endif %} +
+
+ + +{% endblock %} diff --git a/photo21/templates/socialaccount/connections.html b/photo21/templates/socialaccount/connections.html new file mode 100644 index 0000000..ff3a221 --- /dev/null +++ b/photo21/templates/socialaccount/connections.html @@ -0,0 +1,66 @@ +{% extends "socialaccount/base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-2.0-or-later +{% endcomment %} +{% load i18n %} +{% block head_title %}{% trans "Account Connections" %}{% endblock %} + +{% block content %} +

{% trans "Account" %}

+
+ +
+ {% if form.accounts %} +

{% blocktrans %}You can sign in to your account using any of the following third party accounts:{% endblocktrans %}

+ +
+ {% csrf_token %} +
+ {% if form.non_field_errors %} +
{{ form.non_field_errors }}
+ {% endif %} + + {% for base_account in form.accounts %} + {% with base_account.get_provider_account as account %} +
+ +
+ {% endwith %} + {% endfor %} + +
+ +
+
+
+ + {% else %} +

{% trans 'You currently have no social network accounts connected to this account.' %}

+ {% endif %} + +

{% trans 'Add a 3rd Party Account' %}

+ +
    + {% include "socialaccount/snippets/provider_list.html" with process="connect" %} +
+ + {% include "socialaccount/snippets/login_extra.html" %} +
+
+ + + +{% endblock %}