Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add better styles for password reset procedure

Artur Smęt79dc61d64b91
diff --git a/templates/account/password_reset.html b/templates/account/password_reset.html
index e407e3d787..c6b3d71ca9 100644
--- a/templates/account/password_reset.html
+++ b/templates/account/password_reset.html
@@ -3,25 +3,28 @@
{% load bootstrap_form from bootstrap3 %}
{% block content %}
-<div class="row">
- <div class="col-sm-6">
- <div class="panel panel-default">
- <div class="panel-body">
- <form method="post" novalidate>
- {% csrf_token %}
- <fieldset>
- <legend>{% trans 'Password Reset' %}</legend>
- {% bootstrap_form form %}
- <input type="hidden" name="next" value="{{ next }}" />
- </fieldset>
- <div class="form-group text-right">
- <button class="btn btn-primary">
- {% trans "Continue" %}
- </button>
- </div>
- </form>
- </div>
+ <div class="row">
+ <div class="col-md-8 push-md-2">
+ <div class="jumbotron">
+ <div class="text-center">
</div>
+ <form method="post" novalidate>
+ {% csrf_token %}
+ <legend class="text-center">{% trans 'Password Reset' %}</legend>
+ <fieldset>
+ {% bootstrap_form form %}
+ <input type="hidden" name="next" value="{{ next }}"/>
+ </fieldset>
+ <div class="row login__btn-group text-right">
+ <div class="col-sm-12">
+ <button class="btn primary">
+ {% trans "Continue" %}
+ </button>
+ </div>
+ </div>
+ </form>
+ </div>
</div>
-</div>
+ </div>
+
{% endblock %}
diff --git a/templates/account/password_reset_base.html b/templates/account/password_reset_base.html
new file mode 100644
index 0000000000..2706ad672f
--- /dev/null
+++ b/templates/account/password_reset_base.html
@@ -0,0 +1,14 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load bootstrap_form from bootstrap3 %}
+
+{% block content %}
+ <div class="row">
+ <div class="col-md-8 push-md-2">
+ <div class="jumbotron">
+ {% block form %}{% endblock form %}
+ </div>
+ </div>
+ </div>
+
+{% endblock %}
diff --git a/templates/account/password_reset_done.html b/templates/account/password_reset_done.html
new file mode 100644
index 0000000000..2ed785318f
--- /dev/null
+++ b/templates/account/password_reset_done.html
@@ -0,0 +1,16 @@
+{% extends "account/password_reset_base.html" %}
+
+{% load i18n %}
+{% load account %}
+
+{% block title %}{% trans "Password Reset" %}{% endblock %}
+
+{% block form %}
+ <h1>{% trans "Password Reset" %}</h1>
+
+ {% if user.is_authenticated %}
+ {% include "account/snippets/already_logged_in.html" %}
+ {% endif %}
+
+ <p>{% blocktrans %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}</p>
+{% endblock %}
diff --git a/templates/account/password_reset_from_key.html b/templates/account/password_reset_from_key.html
index 10ab7154bf..c1a054e351 100644
--- a/templates/account/password_reset_from_key.html
+++ b/templates/account/password_reset_from_key.html
@@ -1,36 +1,33 @@
-{% extends "account/base.html" %}
+{% extends "account/password_reset_base.html" %}
{% load i18n %}
{% load bootstrap_form from bootstrap3 %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
-{% block content %}
- <div class="row">
- {% if token_fail %}
- <div class="col-sm-12">
- <h1>{% trans "Bad Token" %}</h1>
- {% url 'account_reset_password' as passwd_reset_url %}
- <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>
- </div>
- {% else %}
- <div class="col-sm-6">
- <div class="panel panel-default">
- <div class="panel-body">
- <form method="post" novalidate>
- {% csrf_token %}
- <fieldset>
- <legend>{% trans 'Change Password' %}</legend>
- {% bootstrap_form form %}
- </fieldset>
- <div class="form-group text-right">
- <button class="btn btn-primary">
- {% trans "Continue" %}
- </button>
- </div>
- </form>
- </div>
- </div>
- </div>
- {% endif %}
+{% block form %}
+ {% if token_fail %}
+ <div class="col-sm-12">
+ <h1>{% trans "Bad Token" %}</h1>
+ {% url 'account_reset_password' as passwd_reset_url %}
+ <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>
</div>
+ {% else %}
+ <form method="post" novalidate>
+ {% csrf_token %}
+ <fieldset>
+ <legend class="text-center">{% trans 'Change Password' %}</legend>
+ {% bootstrap_form form %}
+ </fieldset>
+ <div class="row login__btn-group text-right">
+ <div class="col-sm-12">
+ <button class="btn primary">
+ {% trans "Continue" %}
+ </button>
+ </div>
+ </div>
+ </form>
+ {% endif %}
{% endblock %}
diff --git a/templates/account/password_reset_from_key_done.html b/templates/account/password_reset_from_key_done.html
new file mode 100644
index 0000000000..e136830b8f
--- /dev/null
+++ b/templates/account/password_reset_from_key_done.html
@@ -0,0 +1,11 @@
+{% extends "account/password_reset_base.html" %}
+
+{% load i18n %}
+{% block title %}{% trans "Change Password" %}{% endblock %}
+
+{% block form %}
+ <h2 class="text-center">{% trans "Change Password" %}</h2>
+ {% url "account_signin" as login_url %}
+ <p>{% trans 'Your password is now changed.' %}
+ {% blocktrans with login_url=login_url %}You can now <a href="{{ login_url }}">sign in</a> using your new password {% endblocktrans %}</p>
+{% endblock %}
diff --git a/templates/account/password_set.html b/templates/account/password_set.html
index fd8171d9e4..cd805d6603 100644
--- a/templates/account/password_set.html
+++ b/templates/account/password_set.html
@@ -10,7 +10,7 @@
<form method="post" novalidate action="{% url 'account_set_password' %}">
{% csrf_token %}
<fieldset>
- <legend>{% trans 'Password Reset' %}</legend>
+ <legend class="text-center">{% trans 'Password Reset' %}</legend>
{% bootstrap_form form %}
<input type="hidden" name="next" value="{{ next }}" />
</fieldset>