Skip to content

Commit d8a9d1a

Browse files
authored
Match login template with changes from .com (#11101)
Is it okay to change the template on .org? Or maybe just override the template on .com? I'm changing the template here because we already do something similar with the signup template.
1 parent b03f28d commit d8a9d1a

File tree

1 file changed

+57
-18
lines changed

1 file changed

+57
-18
lines changed

readthedocs/templates/account/login.html

Lines changed: 57 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,68 @@
1111

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

14-
<p><small>{% blocktrans trimmed %}If you have not created an account yet, then please
15-
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</small></p>
16-
17-
<form class="login" method="POST" action="{% url "account_login" %}">
18-
{% csrf_token %}
19-
{{ form.as_p }}
20-
{% if redirect_field_value %}
21-
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
14+
{% if is_from_cas_login %}
15+
<p>
16+
{% blocktrans %}
17+
In order to view this documentation, you must log in first.
18+
{% endblocktrans %}
19+
</p>
20+
{% endif %}
21+
22+
{% if allowed_providers %}
23+
{# If allowed providers is given, don't show the username/password form #}
24+
<div class="clearfix">
25+
<ul class="socialaccount_providers">
26+
{% include "socialaccount/snippets/provider_list.html" with process="login" next=request.GET.next verbiage="Sign in with" %}
27+
</ul>
28+
</div>
29+
30+
{% if project_password_url %}
31+
<h3>{% trans 'Or' %}</h3>
32+
<p>
33+
{% blocktrans trimmed with project_password_url=project_password_url %}
34+
Do you have a password to access this documentation?
35+
<a href="{{ project_password_url }}">Access here</a>.
36+
{% endblocktrans %}
37+
</p>
2238
{% endif %}
23-
<button class="primaryAction" type="submit">{% trans "Sign In" %}</button>
2439

25-
{% url 'account_reset_password' as password_reset_url %}
40+
{% else %}
41+
42+
<p><small>{% blocktrans trimmed %}If you have not created an account yet, then please
43+
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</small></p>
44+
45+
<form class="login" method="POST" action="{% url "account_login" %}">
46+
{% csrf_token %}
47+
{{ form.as_p }}
48+
{% if redirect_field_value %}
49+
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
50+
{% endif %}
51+
<button class="primaryAction" type="submit">{% trans "Sign In" %}</button>
52+
53+
{% url 'account_reset_password' as password_reset_url %}
54+
<p>
55+
<small>{% blocktrans trimmed %}If you forgot your password, <a href="{{ password_reset_url }}">reset it.</a>{% endblocktrans %}</small>
56+
</p>
57+
</form>
58+
59+
{% if project_password_url %}
60+
<h3>{% trans 'Or' %}</h3>
2661
<p>
27-
<small>{% blocktrans trimmed %}If you forgot your password, <a href="{{ password_reset_url }}">reset it.</a>{% endblocktrans %}</small>
62+
{% blocktrans trimmed with project_password_url=project_password_url %}
63+
Do you have a password to access this documentation?
64+
<a href="{{ project_password_url }}">Access here</a>.
65+
{% endblocktrans %}
2866
</p>
29-
</form>
67+
{% endif %}
3068

31-
<h3>{% trans 'Or' %}</h3>
69+
<h3>{% trans 'Or' %}</h3>
3270

33-
<div class="clearfix">
34-
<ul class="socialaccount_providers">
35-
{% include "socialaccount/snippets/provider_list.html" with process="login" next=request.GET.next verbiage="Sign in with" %}
36-
</ul>
37-
</div>
71+
<div class="clearfix">
72+
<ul class="socialaccount_providers">
73+
{% include "socialaccount/snippets/provider_list.html" with process="login" next=request.GET.next verbiage="Sign in with" %}
74+
</ul>
75+
</div>
76+
{% endif %}
3877

3978
{% endblock content %}

0 commit comments

Comments
 (0)