Skip to content

Commit 4e90d5c

Browse files
committed
feat: Redesign password reset email verification page
1 parent 0e76285 commit 4e90d5c

File tree

3 files changed

+41
-15
lines changed

3 files changed

+41
-15
lines changed
624 KB
Loading
Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,45 @@
11
{% extends "account/base.html" %}
2-
{% load i18n %}
32

4-
{% block head_title %}{% trans "Change Password" %}{% endblock %}
3+
{% load static widget_tweaks %}
54

6-
{% block content_header %}{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}{% endblock %}
5+
{% block head_title %}{% if token_fail %}Bad Token{% else %}Change Password{% endif %}{% endblock %}
6+
7+
{% block header %}{% endblock %}
78

89
{% block content %}
9-
{% if token_fail %}
10-
{% url 'account_reset_password' as passwd_reset_url %}
11-
<p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
12-
{% else %}
13-
{% if form %}
14-
<form method="POST" action=".">
10+
<div class="w-[40rem] flex flex-col items-center justify-center mx-auto p-8 font-common shadow-sign-content rounded-lg">
11+
<h3>{% if token_fail %}Bad Token{% else %}Change Password{% endif %}</h3>
12+
{% if token_fail %}
13+
<img src="{% static 'img/email_verification_expired.png' %}">
14+
<p class="mt-4 text-center">The password reset link was invalid, possibly because it has already been used. Would you like to request a new one?</p>
15+
<a class="button" href="{% url 'account_reset_password' %}">New Password Reset</a>
16+
{% else %}
17+
<p class="my-4 text-center">Enter your new password.</p>
18+
<form class="flex flex-col items-center w-[80%]" method="POST" action="{{ action_url }}">
1519
{% csrf_token %}
16-
{{ form.as_p }}
17-
<input type="submit" name="action" value="{% trans "change password" %}"/>
20+
{% if form.non_field_errors %}
21+
<ul class="m-0 border-2 rounded-md p-2 border-red-400 text-red-600 font-bold">
22+
{% for error in form.non_field_errors %}<li>{{ error }}</li>{% endfor %}
23+
</ul>
24+
{% endif %}
25+
{% for field in form %}
26+
<div class="w-full my-1">
27+
<div class="flex w-full my-2">
28+
<label class="text-base text-left">{{ field.label }}</label>
29+
<span aria-hidden="true" class="text-4xl text-red-400 h-2 ml-1">*</span>
30+
</div>
31+
{% if field.errors %}
32+
{{ field|add_class:"h-12 text-lg rounded-lg border-red-600 border-2 my-2" }}
33+
{% else %}
34+
{{ field|add_class:"h-12 text-lg rounded-lg border-base-green-400 border-2 my-2" }}
35+
{% endif %}
36+
{% if field.help_text %}<div class="w-full text-left ml-4 font-text">{{ field.help_text|safe }}</div>{% endif %}
37+
{% if field.errors %}<ul class="m-0 w-full ml-4 text-left text-red-600 font-text">{% for error in field.errors %}<li>{{ error }}</li>{% endfor %}</ul>{% endif %}
38+
</div>
39+
{% endfor %}
40+
<button type="submit" class="w-full my-4 h-12 text-lg bg-base-green-600 border-2 rounded-lg border-base-green-800 font-common hover:bg-base-white-400 hover:text-base-green-600">Change Password</button>
1841
</form>
19-
{% else %}
20-
<p>{% trans 'Your password is now changed.' %}</p>
21-
{% endif %}
22-
{% endif %}
42+
{% endif %}
43+
</div>
2344
{% endblock %}
45+
{% block footer %}{% endblock %}

theme/static_src/src/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
}
3535
}
3636

37+
.button {
38+
@apply border-2 px-4 py-2 my-2 bg-base-green-600 border-base-green-800 hover:bg-base-green-400 rounded-lg;
39+
}
40+
3741
/**
3842
* A catch-all path to Django template files, JavaScript, and Python files
3943
* that contain Tailwind CSS classes and will be scanned by Tailwind to generate the final CSS file.

0 commit comments

Comments
 (0)