Skip to content

Commit 5d6eede

Browse files
committed
New templates for password management functionality.
- Legacy-Id: 3384
1 parent 13c87fb commit 5d6eede

8 files changed

Lines changed: 207 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% extends "base.html" %}
2+
3+
{% block morecss %}
4+
table.register-form ul.errorlist{ list-style-type: none; color: red; padding: 0px; margin: 0px; }
5+
table.register-form p { margin-top: 0px; }
6+
{% endblock %}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% extends "registration/base.html" %}
2+
3+
{% block title %}Change password{% endblock %}
4+
5+
{% block content %}
6+
<div id="change_password_page">
7+
<h1>Change password</h1>
8+
{% if success %}
9+
<p>Your password has been updated.</p>
10+
<p>Now you can <a href="{% url ietfauth.views.ietf_login %}">sign in</a></p>
11+
{% else %}
12+
<p>Hello, you can select a new password below for your user {{ username }}.</p>
13+
<form action="" method="POST">
14+
<table class="register-form">
15+
{{ form }}
16+
</table>
17+
<div class="submit_row">
18+
<input type="submit" value="Change password" />
19+
</div>
20+
</form>
21+
{% endif %}
22+
</div>
23+
{% endblock %}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% extends "registration/base.html" %}
2+
3+
{% block title %}Confirm account creation{% endblock %}
4+
5+
{% block content %}
6+
<div id="confirm_account_page">
7+
<h1>Confirm account creation</h1>
8+
{% if success %}
9+
<p>Your account with login name '{{ email }}' has been created, using the password you have select.</p>
10+
<p>Now you can <a href="{% url ietfauth.views.ietf_login %}">sign in</a></p>
11+
{% else %}
12+
<p>In order to complete the setup of your account with login name '{{ email }}', please set a password:</p>
13+
<form action="" method="POST">
14+
<table class="register-form">
15+
{{ form }}
16+
</table>
17+
<div class="submit_row">
18+
<input type="submit" value="Set Password" />
19+
</div>
20+
</form>
21+
{% endif %}
22+
</div>
23+
{% endblock %}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{% extends "registration/base.html" %}
2+
3+
{% block title %}Account Creation{% endblock %}
4+
5+
{% block scripts %}
6+
{{ block.super }}
7+
8+
(function($) {
9+
var checkUsername = function() {
10+
var field = $(this);
11+
var url = $("#check_user_name_url").val();
12+
var error = field.next('.username-error');
13+
14+
$.ajax({
15+
url: url,
16+
data: {username: field.val()},
17+
dataType: 'json',
18+
success: function(response) {
19+
if (response.error) {
20+
error.text(response.error);
21+
error.show();
22+
} else {
23+
error.hide();
24+
}
25+
}
26+
});
27+
}
28+
29+
$(document).ready(function(){
30+
$('#id_email').after(' <span class="username-error" style="display: none;"></span>');
31+
$('#id_email').keyup(checkUsername).blur(checkUsername);
32+
});
33+
})(jQuery);
34+
{% endblock %}
35+
36+
{% block content %}
37+
<div id="register_page">
38+
<h1>Account Creation</h1>
39+
{% if success %}
40+
<p>Your account creation request has been received successfully. <br />
41+
We have sent you an email with instructions on how to complete the process.</p>
42+
<p>Best regards,
43+
<br />
44+
<br />
45+
<blockquote>
46+
The datatracker login manager service<br />
47+
(for the IETF Secretariat)
48+
49+
{% else %}
50+
<form action="" method="POST">
51+
<p>Please enter your email address in order to create a new account.</p>
52+
<table class="register-form">
53+
{{ form }}
54+
</table>
55+
<div class="submit_row">
56+
<input type="hidden" id="check_user_name_url" value="{% url ajax_check_username %}" />
57+
<input type="submit" value="Submit" />
58+
</div>
59+
</form>
60+
<p class="reset_password_description">
61+
I'm already registered but I forgot my password. <a href="{% url password_reset %}">Please, help me reset my password.</a>
62+
</p>
63+
{% endif %}
64+
</div>
65+
{% endblock %}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{% autoescape off %}
2+
Hello,
3+
4+
We have received an account creation request for {{ username }}
5+
at {{ domain }}. In order to set a new password for the
6+
{{ username }} account, please go to the following link and
7+
follow the instructions there:
8+
9+
http://{{ domain }}{% url confirm_account username today realm auth %}
10+
11+
This link will expire in {{ expire }} days.
12+
13+
Best regards,
14+
15+
The datatracker login manager service
16+
(for the IETF Secretariat)
17+
{% endautoescape %}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% extends "registration/base.html" %}
2+
3+
{% block title %}Account Management{% endblock %}
4+
5+
{% block content %}
6+
<div id="account_index">
7+
<h1>Account Management</h1>
8+
9+
<p>
10+
<b>You can:</b>
11+
<ul>
12+
{% if user.username %}
13+
<li><a href="/accounts/profile/">See your profile</a></li>
14+
{% else %}
15+
<li><a href="/accounts/login/">Sign in</a></li>
16+
{% endif %}
17+
<li><a href="/accounts/create/">Request an account</a></li>
18+
<li><a href="/accounts/reset/">Request a password reset </a></li>
19+
</ul>
20+
</p>
21+
22+
</div>
23+
{% endblock %}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{% extends "registration/base.html" %}
2+
3+
{% block title %}Password Reset Request{% endblock %}
4+
5+
{% block content %}
6+
<div id="register_page">
7+
<h1>Password Reset Request</h1>
8+
{% if success %}
9+
<p>Your password reset request has been successfully received. <br />
10+
We have sent you an email with instructions on how to set a new password.</p>
11+
<p>Best regards,
12+
<br />
13+
<br />
14+
<blockquote>
15+
The datatracker login manager service<br />
16+
(for the IETF Secretariat)
17+
</blockquote>
18+
</p>
19+
{% else %}
20+
<form action="" method="POST">
21+
<table class="register-form">
22+
{{ form }}
23+
</table>
24+
<div class="submit_row">
25+
<input type="submit" value="Request password reset" />
26+
</div>
27+
</form>
28+
{% endif %}
29+
</div>
30+
{% endblock %}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% autoescape off %}
2+
Hello,
3+
4+
We have received a password reset request for {{ username }}
5+
at {{ domain }}. In order to set a new password for the
6+
{{ username }} account, please go to the following link and
7+
follow the instructions there:
8+
9+
http://{{ domain }}{% url confirm_password_reset username today realm auth %}
10+
11+
This link will expire in {{ expire }} days.
12+
13+
If you have not requested a password reset you can ignore this email, your
14+
credentials have been left untouched.
15+
16+
Best regards,
17+
18+
The datatracker login manager service
19+
(for the IETF Secretariat)
20+
{% endautoescape %}

0 commit comments

Comments
 (0)