From 5b7b95d426c1aa9008283d81457e6e0524d09202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Wed, 3 Mar 2021 10:36:18 +0100 Subject: [PATCH] Add a link to password reset view. Fixup that template. --- src/project/templates/account/login.html | 13 ++++--- .../templates/account/password_reset.html | 35 ++++++++++++++++--- .../templates/account/pre_login_base.html | 15 ++------ src/project/templates/account/signup.html | 8 ++--- 4 files changed, 45 insertions(+), 26 deletions(-) diff --git a/src/project/templates/account/login.html b/src/project/templates/account/login.html index 2605b5f..d17b786 100644 --- a/src/project/templates/account/login.html +++ b/src/project/templates/account/login.html @@ -3,8 +3,6 @@ {% load static %} {% block non_login_content %} - {% if form.non_field_errors %} {% for error in form.non_field_errors %} @@ -24,7 +22,7 @@ @@ -35,13 +33,17 @@ - + + {% trans "Forgot password?" %} +
@@ -50,4 +52,5 @@ href="{% url "account_signup" %}"> {% trans "Become a member" %} + {% endblock %} diff --git a/src/project/templates/account/password_reset.html b/src/project/templates/account/password_reset.html index de23d9e..ce8be80 100644 --- a/src/project/templates/account/password_reset.html +++ b/src/project/templates/account/password_reset.html @@ -1,13 +1,14 @@ -{% extends "account/base.html" %} +{% extends "account/pre_login_base.html" %} {% load i18n %} {% load account %} {% block head_title %}{% trans "Password Reset" %}{% endblock %} -{% block content %} +{% block non_login_content %} + +

{% trans "Password Reset" %}

-

{% trans "Password Reset" %}

{% if user.is_authenticated %} {% include "account/snippets/already_logged_in.html" %} {% endif %} @@ -16,9 +17,33 @@
{% csrf_token %} - {{ form.as_p }} - + + + {% if form.email.errors %} + {% for error in form.email.errors %} +
+ {{ error }} +
+ {% endfor %} + {% endif %} + +

{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}

+ +
+ + {% trans "To login" %} + {% endblock %} diff --git a/src/project/templates/account/pre_login_base.html b/src/project/templates/account/pre_login_base.html index 8e5f0e9..37e6626 100644 --- a/src/project/templates/account/pre_login_base.html +++ b/src/project/templates/account/pre_login_base.html @@ -49,18 +49,6 @@ z-index: 2; } - .form-signin input[type="email"] { - margin-bottom: -1px; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; - } - - .form-signin input[type="password"] { - margin-bottom: 10px; - border-top-left-radius: 0; - border-top-right-radius: 0; - } - .hr-text:after { content: attr(data-content); padding: 0 4px; @@ -75,6 +63,9 @@
+ + {% block non_login_content %} {% endblock %}
diff --git a/src/project/templates/account/signup.html b/src/project/templates/account/signup.html index 1dfff44..27eb870 100644 --- a/src/project/templates/account/signup.html +++ b/src/project/templates/account/signup.html @@ -3,8 +3,6 @@ {% load static %} {% block non_login_content %} -

{% trans "Become a member" %}

{% if form.non_field_errors %} @@ -18,6 +16,8 @@ {{ form.email.errors }} {{ form.password1.errors }} +

{% trans "To become a member, you need to have an account. Create one here." %}

+
{% csrf_token %} @@ -28,7 +28,7 @@ @@ -46,7 +46,7 @@ {% if form.password1.errors %}