From 04ed822e3985e1565a1d652017be4004b4ddf8f3 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Mon, 9 Apr 2018 16:20:53 +0200 Subject: [PATCH] add option to enable openid (disabled by default) --- src/wolnelektury/context_processors.py | 3 ++- src/wolnelektury/templates/auth/login.html | 2 ++ src/wolnelektury/templates/auth/register.html | 2 ++ src/wolnelektury/templates/socialaccount/connections.html | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/wolnelektury/context_processors.py b/src/wolnelektury/context_processors.py index fb5584e4d..0079ea0df 100644 --- a/src/wolnelektury/context_processors.py +++ b/src/wolnelektury/context_processors.py @@ -8,5 +8,6 @@ from django.conf import settings def extra_settings(request): return { 'STATIC_URL': settings.STATIC_URL, - 'FULL_STATIC_URL': request.build_absolute_uri(settings.STATIC_URL) + 'FULL_STATIC_URL': request.build_absolute_uri(settings.STATIC_URL), + 'USE_OPENID': getattr(settings, 'USE_OPENID', False) } diff --git a/src/wolnelektury/templates/auth/login.html b/src/wolnelektury/templates/auth/login.html index 8509b4cf9..296571348 100644 --- a/src/wolnelektury/templates/auth/login.html +++ b/src/wolnelektury/templates/auth/login.html @@ -14,6 +14,7 @@ +{% if USE_OPENID %}

{% trans "Sign in using:" %}

{% include "socialaccount/snippets/login_extra.html" %} +{% endif %} {% block extra %} {% endblock %} diff --git a/src/wolnelektury/templates/auth/register.html b/src/wolnelektury/templates/auth/register.html index 0650602f2..967fc6fa0 100644 --- a/src/wolnelektury/templates/auth/register.html +++ b/src/wolnelektury/templates/auth/register.html @@ -14,6 +14,7 @@ {% block extra %} +{% if USE_OPENID %}

{% trans "Sign in using:" %}

{% include "socialaccount/snippets/login_extra.html" %} +{% endif %} {% endblock %} diff --git a/src/wolnelektury/templates/socialaccount/connections.html b/src/wolnelektury/templates/socialaccount/connections.html index 0c7316ed4..0f107242a 100644 --- a/src/wolnelektury/templates/socialaccount/connections.html +++ b/src/wolnelektury/templates/socialaccount/connections.html @@ -45,6 +45,7 @@

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

{% endif %} +{% if USE_OPENID %}

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

{% include "socialaccount/snippets/login_extra.html" %} +{% endif %} {% endblock %} -- 2.20.1