From 2faf84bbf59af78f939ed40fd50e577864a10139 Mon Sep 17 00:00:00 2001 From: David Fischer Date: Wed, 25 Apr 2018 12:36:38 -0700 Subject: [PATCH 1/3] Support sign in and sign up with GH/GL/BB --- media/css/core.css | 12 +++++++ readthedocs/templates/account/login.html | 22 ++++++++++--- readthedocs/templates/account/signup.html | 33 +++++++++++++++++++ .../socialaccount/snippets/provider_list.html | 8 ++--- 4 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 readthedocs/templates/account/signup.html diff --git a/media/css/core.css b/media/css/core.css index e363486f8c5..97aec349904 100644 --- a/media/css/core.css +++ b/media/css/core.css @@ -521,6 +521,18 @@ p.build-missing { font-size: .8em; color: #9d9a55; margin: 0 0 3px; } .navigable .profile_image img { border-radius:5px; } .profile #content { padding-top:8px; } + +/* login & signup pages */ +.login-page h3, .signup-page h3 { + margin: 40px 0; +} +.login-page .socialaccount_providers .button, +.signup-page .socialaccount_providers .button { + display: inline-block; + float: none; + margin: 10px 0; +} + /* build page */ #build_list select { width: 10em; } diff --git a/readthedocs/templates/account/login.html b/readthedocs/templates/account/login.html index c9bb569727c..18d24917efa 100644 --- a/readthedocs/templates/account/login.html +++ b/readthedocs/templates/account/login.html @@ -5,12 +5,14 @@ {% block head_title %}{% trans "Sign In" %}{% endblock %} +{% block body_class %}login-page{% endblock %} + {% block content %}

{% trans "Sign In" %}

-

{% blocktrans %}If you have not created an account yet, then please -sign up first.{% endblocktrans %}

+

{% blocktrans %}If you have not created an account yet, then please +sign up first.{% endblocktrans %}

{% csrf_token %} @@ -19,7 +21,19 @@

{% trans "Sign In" %}

{% endif %} - {% blocktrans %}If you forgot your password, reset it.{% endblocktrans %} + + {% url 'account_reset_password' as password_reset_url %} +

+ {% blocktrans %}If you forgot your password, reset it.{% endblocktrans %} +

-{% endblock %} +

{% trans 'Or' %}

+ +
+ +
+ +{% endblock content %} diff --git a/readthedocs/templates/account/signup.html b/readthedocs/templates/account/signup.html new file mode 100644 index 00000000000..b9b2a81f767 --- /dev/null +++ b/readthedocs/templates/account/signup.html @@ -0,0 +1,33 @@ +{% extends "account/base.html" %} + +{% load i18n %} + +{% block head_title %}{% trans "Signup" %}{% endblock %} + +{% block body_class %}signup-page{% endblock %} + +{% block content %} +

{% trans "Sign Up" %}

+ +

+ {% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %} +

+ +
+ {% csrf_token %} + {{ form.as_p }} + {% if redirect_field_value %} + + {% endif %} + +
+ +

{% trans 'Or' %}

+ +
+ +
+ +{% endblock %} diff --git a/readthedocs/templates/socialaccount/snippets/provider_list.html b/readthedocs/templates/socialaccount/snippets/provider_list.html index 2c8f2ee4140..9ca9482030d 100644 --- a/readthedocs/templates/socialaccount/snippets/provider_list.html +++ b/readthedocs/templates/socialaccount/snippets/provider_list.html @@ -11,8 +11,8 @@ class="socialaccount-provider {{ provider.id }} {{ brand.id }} button" href="{% provider_login_url provider.id openid=brand.openid_url process=process next=next %}" > - {% blocktrans with brand_name=brand.name %} - Connect to {{ brand_name }} + {% blocktrans with brand_name=brand.name verbiage=verbiage|default:'Connect to' %} + {{ verbiage }} {{ brand_name }} {% endblocktrans %} @@ -24,8 +24,8 @@ class="socialaccount-provider {{ provider.id }} button" href="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params next=next %}" > - {% blocktrans with provider_name=provider.name %} - Connect to {{ provider_name }} + {% blocktrans with provider_name=provider.name verbiage=verbiage|default:'Connect to' %} + {{ verbiage }} {{ provider_name }} {% endblocktrans %} From 8a2bf285320baf4446f9cd9ca89c5b98f26efc13 Mon Sep 17 00:00:00 2001 From: David Fischer Date: Wed, 25 Apr 2018 13:57:23 -0700 Subject: [PATCH 2/3] Sign up is two words --- readthedocs/templates/account/signup.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readthedocs/templates/account/signup.html b/readthedocs/templates/account/signup.html index b9b2a81f767..4ee44570749 100644 --- a/readthedocs/templates/account/signup.html +++ b/readthedocs/templates/account/signup.html @@ -2,7 +2,7 @@ {% load i18n %} -{% block head_title %}{% trans "Signup" %}{% endblock %} +{% block head_title %}{% trans "Sign up" %}{% endblock %} {% block body_class %}signup-page{% endblock %} From 2b484ac5cde245058150c833083895db553a0e95 Mon Sep 17 00:00:00 2001 From: David Fischer Date: Wed, 25 Apr 2018 21:28:57 -0700 Subject: [PATCH 3/3] Let's verify social account emails --- readthedocs/settings/base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/readthedocs/settings/base.py b/readthedocs/settings/base.py index ed1b6b4fed3..5ee1c462fbb 100644 --- a/readthedocs/settings/base.py +++ b/readthedocs/settings/base.py @@ -273,7 +273,6 @@ def USE_PROMOS(self): # noqa ACCOUNT_EMAIL_VERIFICATION = 'mandatory' ACCOUNT_AUTHENTICATION_METHOD = 'username_email' ACCOUNT_ACTIVATION_DAYS = 7 - SOCIALACCOUNT_EMAIL_VERIFICATION = 'none' SOCIALACCOUNT_AUTO_SIGNUP = False SOCIALACCOUNT_PROVIDERS = { 'github': {