Skip to content

Commit

Permalink
Match login template with changes from .com (#11101)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stsewd committed Feb 28, 2024
1 parent b03f28d commit d8a9d1a
Showing 1 changed file with 57 additions and 18 deletions.
75 changes: 57 additions & 18 deletions readthedocs/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,68 @@

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

<p><small>{% blocktrans trimmed %}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 %}
{{ form.as_p }}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% if is_from_cas_login %}
<p>
{% blocktrans %}
In order to view this documentation, you must log in first.
{% endblocktrans %}
</p>
{% endif %}

{% if allowed_providers %}
{# If allowed providers is given, don't show the username/password form #}
<div class="clearfix">
<ul class="socialaccount_providers">
{% include "socialaccount/snippets/provider_list.html" with process="login" next=request.GET.next verbiage="Sign in with" %}
</ul>
</div>

{% if project_password_url %}
<h3>{% trans 'Or' %}</h3>
<p>
{% blocktrans trimmed with project_password_url=project_password_url %}
Do you have a password to access this documentation?
<a href="{{ project_password_url }}">Access here</a>.
{% endblocktrans %}
</p>
{% endif %}
<button class="primaryAction" type="submit">{% trans "Sign In" %}</button>

{% url 'account_reset_password' as password_reset_url %}
{% else %}

<p><small>{% blocktrans trimmed %}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 %}
{{ form.as_p }}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<button class="primaryAction" type="submit">{% trans "Sign In" %}</button>

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

{% if project_password_url %}
<h3>{% trans 'Or' %}</h3>
<p>
<small>{% blocktrans trimmed %}If you forgot your password, <a href="{{ password_reset_url }}">reset it.</a>{% endblocktrans %}</small>
{% blocktrans trimmed with project_password_url=project_password_url %}
Do you have a password to access this documentation?
<a href="{{ project_password_url }}">Access here</a>.
{% endblocktrans %}
</p>
</form>
{% endif %}

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

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

{% endblock content %}

0 comments on commit d8a9d1a

Please sign in to comment.