|
1 | 1 | {% extends "account/base.html" %} |
2 | | -{% load i18n %} |
3 | 2 |
|
4 | | -{% block head_title %}{% trans "Change Password" %}{% endblock %} |
| 3 | +{% load static widget_tweaks %} |
5 | 4 |
|
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 %} |
7 | 8 |
|
8 | 9 | {% 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 }}"> |
15 | 19 | {% 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> |
18 | 41 | </form> |
19 | | - {% else %} |
20 | | - <p>{% trans 'Your password is now changed.' %}</p> |
21 | | - {% endif %} |
22 | | -{% endif %} |
| 42 | + {% endif %} |
| 43 | + </div> |
23 | 44 | {% endblock %} |
| 45 | +{% block footer %}{% endblock %} |
0 commit comments