Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sign in and sign up with GH/GL/BB #4022

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions media/css/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
22 changes: 18 additions & 4 deletions readthedocs/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

{% block head_title %}{% trans "Sign In" %}{% endblock %}

{% block body_class %}login-page{% endblock %}

{% block content %}

<h1>{% trans "Sign In" %}</h1>

<p>{% blocktrans %}If you have not created an account yet, then please
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</p>
<p><small>{% blocktrans %}If you have not created an account yet, then please
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</small></p>

<form class="login" method="POST" action="{% url "account_login" %}">
{% csrf_token %}
Expand All @@ -19,7 +21,19 @@ <h1>{% trans "Sign In" %}</h1>
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<button class="primaryAction" type="submit">{% trans "Sign In" %}</button>
{% blocktrans %}If you forgot your password, <a href="/accounts/password/reset/">reset it.</a>{% endblocktrans %}

{% url 'account_reset_password' as password_reset_url %}
<p>
<small>{% blocktrans %}If you forgot your password, <a href="{{ password_reset_url }}">reset it.</a>{% endblocktrans %}</small>
</p>
</form>

{% endblock %}
<h3>{% trans 'Or' %}</h3>

<div class="clearfix">
<ul class="socialaccount_providers">
{% include "socialaccount/snippets/provider_list.html" with process="login" next="" verbiage="Sign in with" %}
</ul>
</div>

{% endblock content %}
33 changes: 33 additions & 0 deletions readthedocs/templates/account/signup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% extends "account/base.html" %}

{% load i18n %}

{% block head_title %}{% trans "Signup" %}{% endblock %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using "Signup" and "Sign up", I think we need to use only one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good catch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, it looks like this is present in allauth itself:
https://github.com/pennersr/django-allauth/blob/2894261/allauth/templates/account/signup.html#L5-L8

Nonetheless, I'll change it for us. I lean toward "sign up" being two words


{% block body_class %}signup-page{% endblock %}

{% block content %}
<h1>{% trans "Sign Up" %}</h1>

<p>
<small>{% blocktrans %}Already have an account? Then please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</small>
</p>

<form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">
{% csrf_token %}
{{ form.as_p }}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<button type="submit">{% trans "Sign Up" %} &raquo;</button>
</form>

<h3>{% trans 'Or' %}</h3>

<div class="clearfix">
<ul class="socialaccount_providers">
{% include "socialaccount/snippets/provider_list.html" with process="login" next="" verbiage="Sign up with" %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process="login" and verbiage="Sign up with"

Just in case, process shouldn't be signup or similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

login is correct, I believe. I tested the full workflow.

</ul>
</div>

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
</a>
</li>
Expand All @@ -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 %}
</a>
</li>
Expand Down