Skip to content
15 changes: 15 additions & 0 deletions readthedocsext/theme/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@
{% endif %}
{% endblock content_title_text %}

{% block head_scripts %}
{{ block.super }}

<script type="text/javascript">
// TODO: where should we put this code?
const last_login_method = "{{ last_login_method }}";
if (window.location.pathname == "/accounts/login/" && last_login_method == "email") {
history.pushState({}, "", "#/email/");
}
</script>
{% endblock head_scripts %}

{% block content_body %}
{% get_providers as socialaccount_providers %}

Expand Down Expand Up @@ -47,6 +59,9 @@
{% block authentication_email_text %}
{% trans "Email" %}
{% endblock authentication_email_text %}
{% if last_login_method == "email" %}
<div class="ui teal label">Last used</div>
{% endif %}
</a>

{% if USE_ORGANIZATIONS %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
{{ verbiage }} {{ provider_name }}
{% endblocktrans %}
</a>
{% if last_login_method == "github" %}
<span class="ui compact small teal basic label">Last used</span>
{% endif %}
</li>
<div class="ui tiny modal" data-modal-id="github-select">
<div class="header">
Expand All @@ -48,11 +51,16 @@
Our GitHub OAuth app
{% endblocktrans %}
<span class="ui compact small basic label">Default</span>
{% if last_login_method == "github" %}
<span class="ui compact small teal basic label">Last used</span>
{% endif %}
{% elif provider.id == "githubapp" %}
{% blocktrans trimmed %}
Our GitHub App
{% endblocktrans %}
<span class="ui violet compact small basic label">Beta</span>
{% if last_login_method == "githubapp" %}
<span class="ui compact small teal basic label">Last used</span>
{% endif %}
{% endif %}
</div>
<div class="description">
Expand Down