Skip to content

Commit

Permalink
Add password reset page and update some styles
Browse files Browse the repository at this point in the history
  • Loading branch information
erfanghorbanee committed Sep 1, 2024
1 parent 5580bef commit b7a0059
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
Binary file modified Django-Shop/static/login/images/login-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions Django-Shop/static/password_reset/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.btn-block {
display: block;
}

.reset-password-form p {
margin-bottom: 1rem;
font-size: 14px;
}

/* Style for the login illustration image */
.reset-password-container img.img-fluid {
max-width: 80%; /* Ensure the image is responsive */
height: auto; /* Maintain aspect ratio */
border-radius: 10px; /* Optional: Add rounded corners */
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Optional: Add a soft shadow */
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions Django-Shop/templates/account/password_reset.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{% extends "base.html" %}
{% load static %}
{% load allauth account %}

{% block title %}Password Reset{% endblock %}
{% block description %}Reset your password{% endblock %}

{% block extra_meta %}
<meta name="robots" content="noindex, nofollow">
{% endblock %}

{% block extra_styles %}
<link rel="stylesheet" href="{% static 'password_reset/css/styles.css' %}">
{% endblock %}

{% block content %}
<div class="container-fluid reset-password-container">
<div class="row">
<!-- Left Side - Image -->
<div class="col-md-6 d-none d-md-flex align-items-center justify-content-center">
<img src="{% static 'password_reset/images/password_reset.jpg' %}" alt="Password Reset Illustration" class="img-fluid">
</div>

<!-- Right Side - Form -->
<div class="col-md-6 d-flex align-items-center justify-content-center">
<div class="reset-password-form-container">
<h1 class="mb-4">Password Reset</h1>
{% if user.is_authenticated %}
<div class="alert alert-info">
You are already logged in. If you need to reset your password, please log out first.
</div>
{% else %}
<p class="mb-4">
Enter your email below to receive a password reset link.
</p>
<form method="post" action="{% url 'account_reset_password' %}" class="reset-password-form">
{% csrf_token %}
<div class="mb-3">
<input type="email" name="email" class="form-control" placeholder="Email" autocomplete="email" maxlength="320" required="" id="id_email">
<!-- Display errors for email field -->
{% if form.email.errors %}
<div class="text-danger">
{% for error in form.email.errors %}
<p>{{ error }}</p>
{% endfor %}
</div>
{% endif %}
</div>

<button type="submit" class="btn btn-primary btn-block w-100">Reset My Password</button>
</form>
{% endif %}
<p class="mt-4 text-center">
Still need help? Contact us.
</p>
</div>
</div>
</div>
</div>
{% endblock %}

0 comments on commit b7a0059

Please sign in to comment.