huge updates i donot track what updates i have made
This commit is contained in:
1 parent
ef7b381e34
commit
5086e11406
55 files changed
+11072
-1415
No files matched your search
@@ -0,0 +1,170 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<div class="reset-container">
|
||||
<img src="{% static 'img/logo.png' %}" alt="Logo" class="logo">
|
||||
<h1>Reset Password</h1>
|
||||
|
||||
<p>Enter your email address and we'll send you a verification code to reset your password.</p>
|
||||
|
||||
{% if error %}
|
||||
<div class="error-message">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if success %}
|
||||
<div class="success-message">
|
||||
{{ success }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if messages %}
|
||||
<div class="error-message">
|
||||
{% for message in messages %}
|
||||
{{ message }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="{% url 'email_reset_password' %}">
|
||||
{% csrf_token %}
|
||||
<div class="input-group">
|
||||
<label for="email">Email Address</label>
|
||||
<input type="email" name="email" id="email" required autofocus>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="submit-btn">Send Reset Code</button>
|
||||
</form>
|
||||
|
||||
<a href="{% url 'reset_password_options' %}" class="back-link">← Back to Reset Options</a>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #4285f4;
|
||||
--secondary-color: #34a853;
|
||||
--accent-color: #ea4335;
|
||||
--background-color: #f8f9fa;
|
||||
--text-color: #202124;
|
||||
--light-text: #5f6368;
|
||||
--error-color: #ea4335;
|
||||
--border-radius: 8px;
|
||||
--box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
|
||||
background-color: var(--background-color);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.reset-container {
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--box-shadow);
|
||||
width: 380px;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin-bottom: 30px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 30px;
|
||||
color: var(--light-text);
|
||||
line-height: 1.5;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--light-text);
|
||||
}
|
||||
|
||||
input[type="email"] {
|
||||
width: calc(100% - 20px);
|
||||
padding: 12px 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: var(--border-radius);
|
||||
font-size: 15px;
|
||||
transition: border 0.3s;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
border: 1px solid var(--primary-color);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: var(--border-radius);
|
||||
padding: 12px 24px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
transition: background-color 0.3s;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background-color: #3367d6;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
color: var(--error-color);
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.back-link {
|
||||
display: inline-block;
|
||||
margin-top: 30px;
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.back-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.success-message {
|
||||
color: var(--secondary-color);
|
||||
margin-bottom: 20px;
|
||||
padding: 10px;
|
||||
background-color: rgba(52, 168, 83, 0.1);
|
||||
border-radius: var(--border-radius);
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,83 @@
|
||||
{% autoescape off %}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Password Reset</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
line-height: 1.6;
|
||||
color: #333;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
.container {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
padding: 25px;
|
||||
}
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.logo {
|
||||
max-width: 100px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
h1 {
|
||||
color: #4285f4;
|
||||
font-size: 24px;
|
||||
margin: 0;
|
||||
}
|
||||
.content {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.reset-code {
|
||||
background-color: #f0f0f0;
|
||||
padding: 15px;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
letter-spacing: 5px;
|
||||
margin: 20px 0;
|
||||
color: #4285f4;
|
||||
}
|
||||
.footer {
|
||||
font-size: 12px;
|
||||
color: #777;
|
||||
text-align: center;
|
||||
margin-top: 30px;
|
||||
border-top: 1px solid #ddd;
|
||||
padding-top: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>Password Reset</h1>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<p>Hello,</p>
|
||||
<p>We received a request to reset your password for your Student Management System account. If you did not make this request, please ignore this email.</p>
|
||||
<p>To reset your password, use the following code:</p>
|
||||
<div class="reset-code">{{ reset_code }}</div>
|
||||
<p>This code will expire in 5 minutes.</p>
|
||||
<p>If you have any questions, please contact the system administrator.</p>
|
||||
<p>Thank you,<br>Student Management System Team</p>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p>This email was sent to you because someone requested a password reset for your account.</p>
|
||||
<p>© {% now "Y" %} Student Management System. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{% endautoescape %}
|
||||
@@ -0,0 +1 @@
|
||||
Password Reset for Student Management System
|
||||
@@ -0,0 +1,168 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login - Student Management System</title>
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #4285f4;
|
||||
--secondary-color: #34a853;
|
||||
--accent-color: #ea4335;
|
||||
--background-color: #f8f9fa;
|
||||
--text-color: #202124;
|
||||
--light-text: #5f6368;
|
||||
--error-color: #ea4335;
|
||||
--border-radius: 8px;
|
||||
--box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
|
||||
background-color: var(--background-color);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.login-container {
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--box-shadow);
|
||||
width: 380px;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin-bottom: 30px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--light-text);
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="password"] {
|
||||
width: calc(100% - 20px);
|
||||
padding: 12px 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: var(--border-radius);
|
||||
font-size: 16px;
|
||||
transition: border 0.3s;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
border: 1px solid var(--primary-color);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: var(--border-radius);
|
||||
padding: 12px 24px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
transition: background-color 0.3s;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background-color: #3367d6;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
color: var(--error-color);
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
padding: 10px;
|
||||
background-color: rgba(234, 67, 53, 0.1);
|
||||
border-radius: var(--border-radius);
|
||||
}
|
||||
|
||||
.forgot-password {
|
||||
margin-top: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.forgot-password a {
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.forgot-password a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="login-container">
|
||||
<img src="{% static 'img/logo.png' %}" alt="Logo" class="logo">
|
||||
<h1>Login</h1>
|
||||
|
||||
{% if error %}
|
||||
<div class="error-message">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if messages %}
|
||||
<div class="error-message">
|
||||
{% for message in messages %}
|
||||
{{ message }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="{% url 'login' %}">
|
||||
{% csrf_token %}
|
||||
<div class="input-group">
|
||||
<label for="username">Email or Phone Number</label>
|
||||
<input type="text" name="username" id="username" required autofocus placeholder="Enter email or phone number">
|
||||
</div>
|
||||
|
||||
<div class="input-group">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password" id="password" required placeholder="Enter password">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="submit-btn">Login</button>
|
||||
</form>
|
||||
|
||||
<div class="forgot-password">
|
||||
<a href="{% url 'reset_password_options' %}">Forgot Password?</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,113 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Password Reset Complete - Student Management System</title>
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #4285f4;
|
||||
--secondary-color: #34a853;
|
||||
--background-color: #f8f9fa;
|
||||
--text-color: #202124;
|
||||
--light-text: #5f6368;
|
||||
--border-radius: 8px;
|
||||
--box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
|
||||
background-color: var(--background-color);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.reset-container {
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--box-shadow);
|
||||
width: 380px;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin-bottom: 30px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 20px;
|
||||
color: var(--light-text);
|
||||
line-height: 1.5;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.success-icon {
|
||||
color: var(--secondary-color);
|
||||
font-size: 48px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
display: inline-block;
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
border-radius: var(--border-radius);
|
||||
padding: 12px 24px;
|
||||
font-size: 16px;
|
||||
width: calc(100% - 48px);
|
||||
text-align: center;
|
||||
transition: background-color 0.3s;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.login-btn:hover {
|
||||
background-color: #3367d6;
|
||||
}
|
||||
|
||||
.success-box {
|
||||
background-color: rgba(52, 168, 83, 0.1);
|
||||
border-radius: var(--border-radius);
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
border-left: 4px solid var(--secondary-color);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="reset-container">
|
||||
<img src="{% static 'img/logo.png' %}" alt="Logo" class="logo">
|
||||
<h1>Password Reset Complete</h1>
|
||||
|
||||
<div class="success-icon">✓</div>
|
||||
|
||||
<div class="success-box">
|
||||
<p>Your password has been successfully reset.</p>
|
||||
</div>
|
||||
|
||||
<p>You can now use your new password to log in to your account.</p>
|
||||
|
||||
<a href="{% url 'login' %}" class="login-btn">Log In</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,178 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Set New Password - Student Management System</title>
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #4285f4;
|
||||
--secondary-color: #34a853;
|
||||
--accent-color: #ea4335;
|
||||
--background-color: #f8f9fa;
|
||||
--text-color: #202124;
|
||||
--light-text: #5f6368;
|
||||
--error-color: #ea4335;
|
||||
--border-radius: 8px;
|
||||
--box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
|
||||
background-color: var(--background-color);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.reset-container {
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--box-shadow);
|
||||
width: 380px;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin-bottom: 30px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 30px;
|
||||
color: var(--light-text);
|
||||
line-height: 1.5;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--light-text);
|
||||
}
|
||||
|
||||
input[type="password"] {
|
||||
width: calc(100% - 20px);
|
||||
padding: 12px 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: var(--border-radius);
|
||||
font-size: 15px;
|
||||
transition: border 0.3s;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
border: 1px solid var(--primary-color);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: var(--border-radius);
|
||||
padding: 12px 24px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
transition: background-color 0.3s;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background-color: #3367d6;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
color: var(--error-color);
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.back-link {
|
||||
display: inline-block;
|
||||
margin-top: 30px;
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.back-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.alert-box {
|
||||
background-color: rgba(234, 67, 53, 0.1);
|
||||
border-radius: var(--border-radius);
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
border-left: 4px solid var(--error-color);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="reset-container">
|
||||
<img src="{% static 'img/logo.png' %}" alt="Logo" class="logo">
|
||||
<h1>Set New Password</h1>
|
||||
|
||||
{% if validlink %}
|
||||
<p>Please enter your new password below.</p>
|
||||
|
||||
{% if form.errors %}
|
||||
<div class="error-message">
|
||||
{% for field in form %}
|
||||
{% for error in field.errors %}
|
||||
{{ error }}<br>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="input-group">
|
||||
<label for="id_new_password1">New Password</label>
|
||||
{{ form.new_password1 }}
|
||||
</div>
|
||||
|
||||
<div class="input-group">
|
||||
<label for="id_new_password2">Confirm New Password</label>
|
||||
{{ form.new_password2 }}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="submit-btn">Change Password</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="alert-box">
|
||||
<p>The password reset link was invalid, possibly because it has already been used or has expired.</p>
|
||||
</div>
|
||||
<p>Please request a new password reset link.</p>
|
||||
<a href="{% url 'reset_password_options' %}" class="back-link">Request New Reset Link</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,107 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Password Reset Email Sent - Student Management System</title>
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #4285f4;
|
||||
--secondary-color: #34a853;
|
||||
--background-color: #f8f9fa;
|
||||
--text-color: #202124;
|
||||
--light-text: #5f6368;
|
||||
--border-radius: 8px;
|
||||
--box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
|
||||
background-color: var(--background-color);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.reset-container {
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--box-shadow);
|
||||
width: 380px;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin-bottom: 30px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 20px;
|
||||
color: var(--light-text);
|
||||
line-height: 1.5;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.success-icon {
|
||||
color: var(--secondary-color);
|
||||
font-size: 48px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.back-link {
|
||||
display: inline-block;
|
||||
margin-top: 30px;
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.back-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.alert-box {
|
||||
background-color: rgba(66, 133, 244, 0.1);
|
||||
border-radius: var(--border-radius);
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
border-left: 4px solid var(--primary-color);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="reset-container">
|
||||
<img src="{% static 'img/logo.png' %}" alt="Logo" class="logo">
|
||||
<h1>Email Sent</h1>
|
||||
|
||||
<div class="success-icon">✓</div>
|
||||
|
||||
<div class="alert-box">
|
||||
<p>We've emailed you instructions for setting your password. You should receive them shortly.</p>
|
||||
</div>
|
||||
|
||||
<p>If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder.</p>
|
||||
|
||||
<a href="{% url 'login' %}" class="back-link">← Return to Login</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,270 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Verify OTP - Student Management System</title>
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #4285f4;
|
||||
--secondary-color: #34a853;
|
||||
--accent-color: #ea4335;
|
||||
--background-color: #f8f9fa;
|
||||
--text-color: #202124;
|
||||
--light-text: #5f6368;
|
||||
--error-color: #ea4335;
|
||||
--border-radius: 8px;
|
||||
--box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
|
||||
background-color: var(--background-color);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.otp-container {
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--box-shadow);
|
||||
width: 380px;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin-bottom: 30px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.contact-info {
|
||||
color: var(--text-color);
|
||||
font-size: 15px;
|
||||
margin-bottom: 25px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
padding: 4px 8px;
|
||||
border: 1px solid var(--primary-color);
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.edit-btn:hover {
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--light-text);
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
width: calc(100% - 20px);
|
||||
padding: 12px 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: var(--border-radius);
|
||||
font-size: 18px;
|
||||
transition: border 0.3s;
|
||||
letter-spacing: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
border: 1px solid var(--primary-color);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: var(--border-radius);
|
||||
padding: 12px 24px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
transition: background-color 0.3s;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background-color: #3367d6;
|
||||
}
|
||||
|
||||
.timer {
|
||||
margin-top: 20px;
|
||||
font-size: 14px;
|
||||
color: var(--light-text);
|
||||
}
|
||||
|
||||
.resend-btn {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--primary-color);
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
text-decoration: underline;
|
||||
margin-left: 5px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.resend-btn:disabled {
|
||||
color: var(--light-text);
|
||||
text-decoration: none;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
color: var(--error-color);
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
padding: 10px;
|
||||
background-color: rgba(234, 67, 53, 0.1);
|
||||
border-radius: var(--border-radius);
|
||||
}
|
||||
|
||||
.back-link {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.back-link a {
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.back-link a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="otp-container">
|
||||
<img src="{% static 'img/logo.png' %}" alt="Logo" class="logo">
|
||||
<h1>Verify OTP</h1>
|
||||
|
||||
{% if is_email %}
|
||||
<p class="contact-info">
|
||||
Code sent to: {{ email|stringformat:"s"|slice:":3" }}***@{{ email|stringformat:"s"|slice:"-10:" }}
|
||||
<a href="{% url 'email_reset_password' %}" class="edit-btn">Edit Email</a>
|
||||
</p>
|
||||
{% else %}
|
||||
<p class="contact-info">
|
||||
Code sent to: +91 ******{{ phone|stringformat:"s"|slice:"-4:" }}
|
||||
<a href="{% url 'phone_reset_password' %}" class="edit-btn">Edit Number</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if error %}
|
||||
<div class="error-message">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if messages %}
|
||||
<div class="error-message">
|
||||
{% for message in messages %}
|
||||
{{ message }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if is_email %}
|
||||
<form method="post" action="{% url 'password_reset_done' %}">
|
||||
{% else %}
|
||||
<form method="post" action="{% url 'verify_reset_otp' %}">
|
||||
{% endif %}
|
||||
{% csrf_token %}
|
||||
<div class="input-group">
|
||||
<label for="otp">Enter Verification Code</label>
|
||||
<input type="text" name="otp" id="otp" maxlength="6" pattern="[0-9]{6}" required autofocus placeholder="Enter 6-digit code">
|
||||
{% if is_email %}
|
||||
<input type="hidden" name="email" value="{{ email }}">
|
||||
{% else %}
|
||||
<input type="hidden" name="phone" value="{{ phone }}">
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="submit-btn">Verify Code</button>
|
||||
</form>
|
||||
|
||||
<div class="timer">
|
||||
<span id="countdown">Resend code in <span id="timer">60</span>s</span>
|
||||
{% if is_email %}
|
||||
<form id="resendForm" method="post" action="{% url 'resend_reset_code' %}">
|
||||
{% else %}
|
||||
<form id="resendForm" method="post" action="{% url 'resend_phone_otp' %}">
|
||||
{% endif %}
|
||||
{% csrf_token %}
|
||||
{% if is_email %}
|
||||
<input type="hidden" name="email" value="{{ email }}">
|
||||
{% else %}
|
||||
<input type="hidden" name="phone" value="{{ phone }}">
|
||||
{% endif %}
|
||||
<button type="submit" class="resend-btn" id="resendBtn" disabled>Resend Code</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="back-link">
|
||||
<a href="{% url 'reset_password_options' %}">← Back to Reset Options</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Countdown timer for resend code
|
||||
let seconds = 60;
|
||||
const timerSpan = document.getElementById('timer');
|
||||
const resendBtn = document.getElementById('resendBtn');
|
||||
const countdownText = document.getElementById('countdown');
|
||||
|
||||
function updateTimer() {
|
||||
seconds--;
|
||||
timerSpan.textContent = seconds;
|
||||
|
||||
if (seconds <= 0) {
|
||||
clearInterval(timerInterval);
|
||||
countdownText.textContent = '';
|
||||
resendBtn.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
const timerInterval = setInterval(updateTimer, 1000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,197 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Reset Password - Student Management System</title>
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #4285f4;
|
||||
--secondary-color: #34a853;
|
||||
--accent-color: #ea4335;
|
||||
--background-color: #f8f9fa;
|
||||
--text-color: #202124;
|
||||
--light-text: #5f6368;
|
||||
--error-color: #ea4335;
|
||||
--border-radius: 8px;
|
||||
--box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
|
||||
background-color: var(--background-color);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.reset-container {
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--box-shadow);
|
||||
width: 380px;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin-bottom: 30px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 30px;
|
||||
color: var(--light-text);
|
||||
line-height: 1.5;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--light-text);
|
||||
}
|
||||
|
||||
input[type="email"],
|
||||
input[type="tel"] {
|
||||
width: calc(100% - 20px);
|
||||
padding: 12px 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: var(--border-radius);
|
||||
font-size: 15px;
|
||||
transition: border 0.3s;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
border: 1px solid var(--primary-color);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: var(--border-radius);
|
||||
padding: 12px 24px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
transition: background-color 0.3s;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background-color: #3367d6;
|
||||
}
|
||||
|
||||
.back-link {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.back-link a {
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.back-link a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
color: var(--error-color);
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.note {
|
||||
font-size: 12px;
|
||||
color: var(--light-text);
|
||||
margin-top: 8px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.success-message {
|
||||
color: var(--secondary-color);
|
||||
margin-bottom: 20px;
|
||||
padding: 10px;
|
||||
background-color: rgba(52, 168, 83, 0.1);
|
||||
border-radius: var(--border-radius);
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="reset-container">
|
||||
<img src="{% static 'img/logo.png' %}" alt="Logo" class="logo">
|
||||
<h1>Reset Password</h1>
|
||||
|
||||
{% if is_email %}
|
||||
<p>Enter your email address and we'll send you a verification code to reset your password.</p>
|
||||
{% else %}
|
||||
<p>Enter your phone number and we'll send you a verification code to reset your password.</p>
|
||||
{% endif %}
|
||||
|
||||
{% if error %}
|
||||
<div class="error-message">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if success %}
|
||||
<div class="success-message">
|
||||
{{ success }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if messages %}
|
||||
<div class="error-message">
|
||||
{% for message in messages %}
|
||||
{{ message }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="input-group">
|
||||
{% if is_email %}
|
||||
<label for="email">Email Address</label>
|
||||
<input type="email" name="email" id="email" required autofocus>
|
||||
{% else %}
|
||||
<label for="phone">Phone Number</label>
|
||||
<input type="tel" name="phone" id="phone" required autofocus>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="submit-btn">Send Verification Code</button>
|
||||
</form>
|
||||
|
||||
<a href="{% url 'reset_password_options' %}" class="back-link">← Back to Reset Options</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,160 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Set New Password - Student Management System</title>
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #4285f4;
|
||||
--secondary-color: #34a853;
|
||||
--accent-color: #ea4335;
|
||||
--background-color: #f8f9fa;
|
||||
--text-color: #202124;
|
||||
--light-text: #5f6368;
|
||||
--error-color: #ea4335;
|
||||
--border-radius: 8px;
|
||||
--box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
|
||||
background-color: var(--background-color);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.reset-container {
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--box-shadow);
|
||||
width: 380px;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin-bottom: 30px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 30px;
|
||||
color: var(--light-text);
|
||||
line-height: 1.5;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--light-text);
|
||||
}
|
||||
|
||||
input[type="password"] {
|
||||
width: calc(100% - 20px);
|
||||
padding: 12px 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: var(--border-radius);
|
||||
font-size: 15px;
|
||||
transition: border 0.3s;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
border: 1px solid var(--primary-color);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: var(--border-radius);
|
||||
padding: 12px 24px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
transition: background-color 0.3s;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background-color: #3367d6;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
color: var(--error-color);
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="reset-container">
|
||||
<img src="{% static 'img/logo.png' %}" alt="Logo" class="logo">
|
||||
<h1>Set New Password</h1>
|
||||
|
||||
<p>Please enter your new password below.</p>
|
||||
|
||||
{% if error %}
|
||||
<div class="error-message">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if messages %}
|
||||
<div class="error-message">
|
||||
{% for message in messages %}
|
||||
{{ message }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="{% url 'set_new_password' %}">
|
||||
{% csrf_token %}
|
||||
<div class="input-group">
|
||||
<label for="new_password1">New Password</label>
|
||||
<input type="password" name="new_password1" id="new_password1" required autofocus>
|
||||
</div>
|
||||
|
||||
<div class="input-group">
|
||||
<label for="new_password2">Confirm New Password</label>
|
||||
<input type="password" name="new_password2" id="new_password2" required>
|
||||
</div>
|
||||
|
||||
{% if is_email %}
|
||||
<input type="hidden" name="email" value="{{ email }}">
|
||||
{% else %}
|
||||
<input type="hidden" name="phone" value="{{ phone }}">
|
||||
{% endif %}
|
||||
<input type="hidden" name="token" value="{{ token }}">
|
||||
|
||||
<button type="submit" class="submit-btn">Set New Password</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,219 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Verify OTP - Student Management System</title>
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #4285f4;
|
||||
--secondary-color: #34a853;
|
||||
--accent-color: #ea4335;
|
||||
--background-color: #f8f9fa;
|
||||
--text-color: #202124;
|
||||
--light-text: #5f6368;
|
||||
--error-color: #ea4335;
|
||||
--border-radius: 8px;
|
||||
--box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
|
||||
background-color: var(--background-color);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.otp-container {
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--box-shadow);
|
||||
width: 380px;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin-bottom: 30px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.phone-info {
|
||||
color: var(--primary-color);
|
||||
font-size: 16px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--light-text);
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
width: calc(100% - 20px);
|
||||
padding: 12px 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: var(--border-radius);
|
||||
font-size: 15px;
|
||||
transition: border 0.3s;
|
||||
letter-spacing: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
border: 1px solid var(--primary-color);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: var(--border-radius);
|
||||
padding: 12px 24px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
transition: background-color 0.3s;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background-color: #3367d6;
|
||||
}
|
||||
|
||||
.back-link {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.back-link a {
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.back-link a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
color: var(--error-color);
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.timer {
|
||||
margin-top: 15px;
|
||||
font-size: 14px;
|
||||
color: var(--light-text);
|
||||
}
|
||||
|
||||
.resend-btn {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--primary-color);
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
text-decoration: underline;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.resend-btn:disabled {
|
||||
color: var(--light-text);
|
||||
text-decoration: none;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="otp-container">
|
||||
<img src="{% static 'img/logo.png' %}" alt="Logo" class="logo">
|
||||
<h1>Verify OTP</h1>
|
||||
<p class="phone-info">OTP sent to: {{ phone }}</p>
|
||||
|
||||
{% if error %}
|
||||
<div class="error-message">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if messages %}
|
||||
<div class="error-message">
|
||||
{% for message in messages %}
|
||||
{{ message }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="{% url 'verify_reset_otp' %}">
|
||||
{% csrf_token %}
|
||||
<div class="input-group">
|
||||
<label for="otp">Enter OTP</label>
|
||||
<input type="text" name="otp" id="otp" maxlength="6" pattern="[0-9]{6}" required autofocus>
|
||||
<input type="hidden" name="phone" value="{{ phone }}">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="submit-btn">Verify OTP</button>
|
||||
|
||||
<div class="timer">
|
||||
<span id="countdown">Resend OTP in <span id="timer">60</span>s</span>
|
||||
<form id="resendForm" method="post" action="{% url 'resend_reset_otp' %}" style="display: inline;">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="phone" value="{{ phone }}">
|
||||
<button type="submit" class="resend-btn" id="resendBtn" disabled>Resend OTP</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="back-link">
|
||||
<a href="{% url 'phone_reset_password' %}">Use another number</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Countdown timer for resend OTP
|
||||
let seconds = 60;
|
||||
const timerSpan = document.getElementById('timer');
|
||||
const resendBtn = document.getElementById('resendBtn');
|
||||
const countdownText = document.getElementById('countdown');
|
||||
|
||||
function updateTimer() {
|
||||
seconds--;
|
||||
timerSpan.textContent = seconds;
|
||||
|
||||
if (seconds <= 0) {
|
||||
clearInterval(timerInterval);
|
||||
countdownText.textContent = '';
|
||||
resendBtn.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
const timerInterval = setInterval(updateTimer, 1000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,156 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Reset Password - Student Management System</title>
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #4285f4;
|
||||
--secondary-color: #34a853;
|
||||
--accent-color: #ea4335;
|
||||
--background-color: #f8f9fa;
|
||||
--text-color: #202124;
|
||||
--light-text: #5f6368;
|
||||
--error-color: #ea4335;
|
||||
--border-radius: 8px;
|
||||
--box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
|
||||
background-color: var(--background-color);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.reset-container {
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--box-shadow);
|
||||
width: 380px;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin-bottom: 30px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 30px;
|
||||
color: var(--light-text);
|
||||
line-height: 1.5;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.options {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
margin: 30px 0;
|
||||
}
|
||||
|
||||
.option-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: white;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: var(--border-radius);
|
||||
padding: 15px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
text-decoration: none;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.option-btn:hover {
|
||||
border-color: var(--primary-color);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.option-icon {
|
||||
font-size: 24px;
|
||||
margin-right: 15px;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.option-text {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.option-text h3 {
|
||||
margin: 0 0 5px 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.option-text p {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: var(--light-text);
|
||||
}
|
||||
|
||||
.back-link {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.back-link a {
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.back-link a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="reset-container">
|
||||
<img src="{% static 'img/logo.png' %}" alt="Logo" class="logo">
|
||||
<h1>Reset Password</h1>
|
||||
|
||||
<p>Select how you would like to reset your password:</p>
|
||||
|
||||
<div class="options">
|
||||
<a href="{% url 'phone_reset_password' %}" class="option-btn">
|
||||
<div class="option-icon">📱</div>
|
||||
<div class="option-text">
|
||||
<h3>Reset via SMS</h3>
|
||||
<p>Receive a verification code on your phone number</p>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="{% url 'email_reset_password' %}" class="option-btn">
|
||||
<div class="option-icon">✉️</div>
|
||||
<div class="option-text">
|
||||
<h3>Reset via Email</h3>
|
||||
<p>Receive a reset link on your email address</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="back-link">
|
||||
<a href="{% url 'login' %}">Back to login</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,61 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="text-center">Reset Password</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if message %}
|
||||
<div class="alert alert-info">{{ message }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if error %}
|
||||
<div class="alert alert-danger">{{ error }}</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="form-group mb-3">
|
||||
<label for="email">Email address</label>
|
||||
<input type="email" class="form-control" id="email" name="email" value="{{ email }}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="code">Reset Code</label>
|
||||
<input type="text" class="form-control" id="code" name="code" required placeholder="Enter 6-digit code" maxlength="6" pattern="\d{6}">
|
||||
<small class="form-text text-muted">
|
||||
Enter the 6-digit code sent to your email.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="new_password1">New Password</label>
|
||||
<input type="password" class="form-control" id="new_password1" name="new_password1" required>
|
||||
<small class="form-text text-muted">
|
||||
Your password must contain at least 8 characters.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="new_password2">Confirm New Password</label>
|
||||
<input type="password" class="form-control" id="new_password2" name="new_password2" required>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary">Reset Password</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="text-center mt-3">
|
||||
<p>Didn't receive the code? <a href="{% url 'password_reset' %}">Request a new one</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user