From: Jan Szejko Date: Mon, 9 Apr 2018 14:20:53 +0000 (+0200) Subject: add option to enable openid (disabled by default) X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/04ed822e3985e1565a1d652017be4004b4ddf8f3?hp=45696bbb638e45271f2c108616f7a9427cf87f7d add option to enable openid (disabled by default) --- 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 %}