Skip to content

Commit

Permalink
fixed signup button and autofocus on user input fields
Browse files Browse the repository at this point in the history
  • Loading branch information
vabene1111 committed Jan 17, 2022
1 parent c14dd04 commit edd4787
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cookbook/templates/account/login.html
Expand Up @@ -19,7 +19,7 @@ <h3>{% trans "Sign In" %}</h3>

<div class="row">
<div class="col-sm-12 col-lg-6 col-md-6 offset-lg-3 offset-md-3">
<hr>
<hr>
<form class="login" method="POST" action="{% url 'account_login' %}">
{% csrf_token %}
{{ form | crispy }}
Expand All @@ -29,12 +29,16 @@ <h3>{% trans "Sign In" %}</h3>
{% endif %}

<button class="btn btn-success" type="submit">{% trans "Sign In" %}</button>
<a class="btn btn-secondary" href="{% url 'account_signup' %}">{% trans "Sign Up" %}</a>

{% if SIGNUP_ENABLED %}
<a class="btn btn-secondary" href="{% url 'account_signup' %}">{% trans "Sign Up" %}</a>
{% endif %}

{% if EMAIL_ENABLED %}
<a class="btn btn-warning float-right d-none d-xl-block d-lg-block"
href="{% url 'account_reset_password' %}">{% trans "Reset My Password" %}</a>
<p class="d-xl-none d-lg-none">{% trans 'Lost your password?' %} <a href="{% url 'account_reset_password' %}">{% trans "Reset My Password" %}</a></p>
<p class="d-xl-none d-lg-none">{% trans 'Lost your password?' %} <a
href="{% url 'account_reset_password' %}">{% trans "Reset My Password" %}</a></p>
{% endif %}
</form>
</div>
Expand All @@ -44,7 +48,7 @@ <h3>{% trans "Sign In" %}</h3>

{% if socialaccount_providers %}
<div class="row" style="margin-top: 2vh">
<div class="col-sm-12 col-lg-6 col-md-6 offset-lg-3 offset-md-3">
<div class="col-sm-12 col-lg-6 col-md-6 offset-lg-3 offset-md-3">
<h5>{% trans "Social Login" %}</h5>
<span>{% trans 'You can use any of the following providers to sign in.' %}</span>

Expand All @@ -62,5 +66,8 @@ <h5>{% trans "Social Login" %}</h5>
</div>
{% endif %}

<script>
$('#id_login').focus()
</script>

{% endblock %}
4 changes: 4 additions & 0 deletions cookbook/templates/account/signup.html
Expand Up @@ -71,4 +71,8 @@ <h3>{% trans "Create an Account" %}</h3>

</div>


<script>
$('#id_username').focus()
</script>
{% endblock %}

0 comments on commit edd4787

Please sign in to comment.