Add ability for customers to change password from account
This commit is contained in:
parent
0cdfafca57
commit
178c0b61f2
@ -485,7 +485,7 @@ section:not(:last-child) {
|
|||||||
background-blend-mode: multiply;
|
background-blend-mode: multiply;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
color: white;
|
color: #f1e8e2;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 2rem 1rem;
|
padding: 2rem 1rem;
|
||||||
font-family: 'Vollkorn', serif;
|
font-family: 'Vollkorn', serif;
|
||||||
@ -577,6 +577,11 @@ article > header {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
align-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.article__header--with-action h1 {
|
||||||
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
article + article {
|
article + article {
|
||||||
@ -883,6 +888,16 @@ article + article {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Customer/User
|
||||||
|
========================================================================== */
|
||||||
|
.customer__detail-section {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
gap: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ==========================================================================
|
/* ==========================================================================
|
||||||
|
|||||||
@ -11,12 +11,13 @@
|
|||||||
</header>
|
</header>
|
||||||
<section>
|
<section>
|
||||||
<h4>Info</h4>
|
<h4>Info</h4>
|
||||||
<p>
|
<div class="customer__detail-section">
|
||||||
|
<div>
|
||||||
<strong>Email address</strong><br>
|
<strong>Email address</strong><br>
|
||||||
{{customer.email}}<br>
|
{{customer.email}}<br>
|
||||||
<a href="{% url 'account_email' %}">Manage</a>
|
<a href="{% url 'account_email' %}">Manage</a>
|
||||||
</p>
|
</div>
|
||||||
<p>
|
<div>
|
||||||
<strong>Default shipping address</strong>
|
<strong>Default shipping address</strong>
|
||||||
{% with shipping_address=customer.default_shipping_address %}
|
{% with shipping_address=customer.default_shipping_address %}
|
||||||
<address>
|
<address>
|
||||||
@ -29,7 +30,8 @@
|
|||||||
{{shipping_address.city}}, {{shipping_address.state}}, {{shipping_address.postal_code}}
|
{{shipping_address.city}}, {{shipping_address.state}}, {{shipping_address.postal_code}}
|
||||||
</address>
|
</address>
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
</p>
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<h4>Your addresses</h4>
|
<h4>Your addresses</h4>
|
||||||
|
|||||||
@ -5,6 +5,9 @@
|
|||||||
<header>
|
<header>
|
||||||
<p><a href="{% url 'storefront:customer-detail' customer.pk %}">← Back</a></p>
|
<p><a href="{% url 'storefront:customer-detail' customer.pk %}">← Back</a></p>
|
||||||
<h1>Update your profile</h1>
|
<h1>Update your profile</h1>
|
||||||
|
<p>
|
||||||
|
<a href="{% url 'account_change_password' %}">Change password</a>
|
||||||
|
</p>
|
||||||
</header>
|
</header>
|
||||||
<section>
|
<section>
|
||||||
<form method="POST" action="{% url 'storefront:customer-update' customer.pk %}">
|
<form method="POST" action="{% url 'storefront:customer-update' customer.pk %}">
|
||||||
|
|||||||
21
src/templates/account/password_change.html
Normal file
21
src/templates/account/password_change.html
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block head_title %}{% trans "Change Password" %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<article>
|
||||||
|
<header>
|
||||||
|
<p><a href="{% url 'storefront:customer-detail' user.pk %}">← Back</a></p>
|
||||||
|
<h1>{% trans "Change Password" %}</h1>
|
||||||
|
<a href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<form method="POST" action="{% url 'account_change_password' %}" class="password_change">
|
||||||
|
{% csrf_token %}
|
||||||
|
{{ form.as_p }}
|
||||||
|
<input type="submit" value="{% trans "Save changes" %}">
|
||||||
|
</form>
|
||||||
|
</article>
|
||||||
|
{% endblock %}
|
||||||
Loading…
x
Reference in New Issue
Block a user