diff --git a/backend/src/appenlight/templates/user/register.jinja2 b/backend/src/appenlight/templates/user/register.jinja2 index 14a6271..60fdeb6 100644 --- a/backend/src/appenlight/templates/user/register.jinja2 +++ b/backend/src/appenlight/templates/user/register.jinja2 @@ -13,25 +13,31 @@
{{ widgets.render_flash_messages(flash_msgs) }}
- + {% if social_plugins %}

Log in or register using

- + {% if social_plugins.get('google') %} + {% endif %} + {% if social_plugins.get('twitter') %} + {% endif %} + {% if social_plugins.get('bitbucket') %} + {% endif %} + {% if social_plugins.get('github') %} {{ _('Github') }} + {% endif %}
- -
-
+ {% endif %} + +
diff --git a/backend/src/appenlight/views/index.py b/backend/src/appenlight/views/index.py index 960ce42..b0e1da9 100644 --- a/backend/src/appenlight/views/index.py +++ b/backend/src/appenlight/views/index.py @@ -203,9 +203,21 @@ def register(request): headers = security.remember(request, new_user.id) return HTTPFound(location=request.route_url('/'), headers=headers) + settings = request.registry.settings + social_plugins = {} + if settings.get('authomatic.pr.twitter.key', ''): + social_plugins['twitter'] = True + if settings.get('authomatic.pr.google.key', ''): + social_plugins['google'] = True + if settings.get('authomatic.pr.github.key', ''): + social_plugins['github'] = True + if settings.get('authomatic.pr.bitbucket.key', ''): + social_plugins['bitbucket'] = True + return { "form": form, - "sign_in_form": sign_in_form + "sign_in_form": sign_in_form, + "social_plugins": social_plugins }