Skip to content

Commit 1d7cee9

Browse files
Create change_password.html
1 parent 7924541 commit 1d7cee9

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

app/templates/change_password.html

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{% extends "base.html" %}
2+
3+
{% block content %}
4+
<div class="container">
5+
<h2>Change Password</h2>
6+
7+
{% with messages = get_flashed_messages(with_categories=true) %}
8+
{% if messages %}
9+
{% for category, message in messages %}
10+
<div class="alert alert-{{ category }}">{{ message }}</div>
11+
{% endfor %}
12+
{% endif %}
13+
{% endwith %}
14+
15+
<form method="POST" class="password-form">
16+
<div class="form-group">
17+
<label for="current_password">Current Password</label>
18+
<input type="password" id="current_password" name="current_password" required>
19+
</div>
20+
21+
<div class="form-group">
22+
<label for="new_password">New Password</label>
23+
<input type="password" id="new_password" name="new_password"
24+
minlength="8" required>
25+
<small class="help-text">Minimum 8 characters</small>
26+
</div>
27+
28+
<div class="form-group">
29+
<label for="confirm_password">Confirm New Password</label>
30+
<input type="password" id="confirm_password" name="confirm_password"
31+
minlength="8" required>
32+
</div>
33+
34+
<div class="form-actions">
35+
<button type="submit" class="btn-primary">Change Password</button>
36+
<a href="{{ url_for('auth.profile') }}" class="btn-secondary">Cancel</a>
37+
</div>
38+
</form>
39+
</div>
40+
41+
<style>
42+
.password-form {
43+
max-width: 500px;
44+
}
45+
46+
.alert {
47+
padding: 0.75rem 1rem;
48+
margin-bottom: 1rem;
49+
border-radius: 4px;
50+
}
51+
52+
.alert-error {
53+
background-color: #f8d7da;
54+
color: #721c24;
55+
border: 1px solid #f5c6cb;
56+
}
57+
58+
.alert-success {
59+
background-color: #d4edda;
60+
color: #155724;
61+
border: 1px solid #c3e6cb;
62+
}
63+
</style>
64+
{% endblock %}

0 commit comments

Comments
 (0)