Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
96bdd034
Commit
96bdd034
authored
Oct 12, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-enable email change functionality
parent
05c5ac34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
16 deletions
+103
-16
lms/templates/dashboard.html
+102
-15
lms/urls.py
+1
-1
No files found.
lms/templates/dashboard.html
View file @
96bdd034
...
...
@@ -16,19 +16,46 @@
$
(
".unenroll"
).
click
(
function
(
event
)
{
$
(
"#unenroll_course_id"
).
val
(
$
(
event
.
target
).
data
(
"course-id"
)
);
$
(
"#unenroll_course_number"
).
text
(
$
(
event
.
target
).
data
(
"course-number"
)
);
});
$
(
document
).
delegate
(
'#unenroll_form'
,
'ajax:success'
,
function
(
data
,
json
,
xhr
)
{
if
(
json
.
success
)
{
location
.
href
=
"${reverse('dashboard')}"
;
}
else
{
if
(
$
(
'#unenroll_error'
).
length
==
0
)
{
$
(
'#unenroll_form'
).
prepend
(
'<div id="unenroll_error" class="modal-form-error"></div>'
);
}
$
(
'#unenroll_error'
).
text
(
json
.
error
).
stop
().
css
(
"display"
,
"block"
);
}
});
$
(
'#pwd_reset_button'
).
click
(
function
()
{
$
.
post
(
'${reverse("password_reset")}'
,
{
"email"
:
$
(
'#id_email'
).
val
()},
function
(
data
){
$
(
"#password_reset_complete_link"
).
click
();
});
});
$
(
"#change_email_form"
).
submit
(
function
(){
var
new_email
=
$
(
'#new_email_field'
).
val
();
var
new_password
=
$
(
'#new_email_password'
).
val
();
$
.
post
(
'${reverse("change_email")}'
,
{
"new_email"
:
new_email
,
"password"
:
new_password
},
function
(
data
)
{
if
(
data
.
success
)
{
$
(
"#change_email_title"
).
html
(
"Please verify your new email"
);
$
(
"#change_email_body"
).
html
(
"<p>You'll receive a confirmation in your "
+
"in-box. Please click the link in the "
+
"email to confirm the email change.</p>"
);
}
else
{
$
(
"#change_email_error"
).
html
(
data
.
error
);
}
});
return
false
;
});
$
(
document
).
delegate
(
'#unenroll_form'
,
'ajax:success'
,
function
(
data
,
json
,
xhr
)
{
if
(
json
.
success
)
{
location
.
href
=
"${reverse('dashboard')}"
;
}
else
{
if
(
$
(
'#unenroll_error'
).
length
==
0
)
{
$
(
'#unenroll_form'
).
prepend
(
'<div id="unenroll_error" class="modal-form-error"></div>'
);
}
$
(
'#unenroll_error'
).
text
(
json
.
error
).
stop
().
css
(
"display"
,
"block"
);
}
});
})(
this
)
</script>
</
%
block>
...
...
@@ -48,10 +75,17 @@
<section
class=
"user-info"
>
<ul>
<li>
<span
class=
"title"
><div
class=
"icon name-icon"
></div>
Full Name
</span><span
class=
"data"
>
${ user.profile.name | h }
</span>
<span
class=
"title"
><div
class=
"icon name-icon"
></div>
Full Name
</span>
<span
class=
"data"
>
${ user.profile.name | h }
</span>
</li>
<li>
<span
class=
"title"
><div
class=
"icon email-icon"
></div>
Email (
<a
href=
"#change_email"
rel=
"leanModal"
class=
"edit-email"
>
edit
</a>
)
</span>
<span
class=
"data"
>
${ user.email | h }
</span>
</li>
<li>
<span
class=
"title"
><div
class=
"icon email-icon"
></div>
Email
</span><span
class=
"data"
>
${ user.email | h }
</span>
<span
class=
"title"
><a
href=
"#"
id=
"pwd_reset_button"
>
Reset Password
</a></span>
<form
id=
"password_reset_form"
method=
"post"
data-remote=
"true"
action=
"${reverse('password_reset')}"
>
<input
id=
"id_email"
type=
"hidden"
name=
"email"
maxlength=
"75"
value=
"${user.email}"
/>
<!-- <input type="submit" id="pwd_reset_button" value="Reset Password" /> -->
</form>
</li>
</ul>
</section>
...
...
@@ -121,13 +155,11 @@
</section>
</section>
<section
id=
"unenroll-modal"
class=
"modal unenroll-modal"
>
<div
class=
"inner-wrapper"
>
<header>
<h2>
Are you sure you want to unregister from
<span
id=
"unenroll_course_number"
></span>
?
</h2>
<hr>
<hr
/
>
</header>
<form
id=
"unenroll_form"
method=
"post"
data-remote=
"true"
action=
"${reverse('change_enrollment')}"
>
...
...
@@ -146,4 +178,59 @@
</div>
</section>
<section
id=
"password_reset_complete"
class=
"modal"
>
<div
class=
"inner-wrapper"
>
<a
href=
"#password_reset_complete"
rel=
"leanModal"
id=
"password_reset_complete_link"
></a>
<div>
<header>
<h2>
Password Reset Email Sent
</h2>
<hr/>
</header>
<section>
<p><span>
An email has been sent to ${user.email}. Follow the link in the email to change your password.
</span></p>
</section>
</div>
<div
class=
"close-modal"
>
<div
class=
"inner"
>
<p>
✕
</p>
</div>
</div>
</div>
</section>
<!-- Haven't Adapted this Yet -->
<section
id=
"change_email"
class=
"modal"
>
<div
class=
"inner-wrapper"
>
<header>
<h2><span
id=
"change_email_title"
>
Change e-mail
</span></h2>
<hr/>
</header>
<div
id=
"apply_name_change_error"
></div>
<div
id=
"change_email_body"
>
<form
id=
"change_email_form"
>
<div
id=
"change_email_error"
>
</div>
<fieldset>
<ul>
<li>
<label>
Please enter your new email address:
</label>
<input
id=
"new_email_field"
type=
"email"
value=
""
/>
</li>
<li>
<label>
Please confirm your password:
</label>
<input
id=
"new_email_password"
value=
""
type=
"password"
/>
</li>
</ul>
<section>
<p>
We will send a confirmation to both ${user.email} and your new e-mail as part of the process.
</p>
</section>
<input
type=
"submit"
id=
"submit_email_change"
/>
</fieldset>
</form>
</div>
<div
class=
"close-modal"
>
<div
class=
"inner"
>
<p>
✕
</p>
</div>
</div>
</div>
</section>
lms/urls.py
View file @
96bdd034
...
...
@@ -19,7 +19,7 @@ urlpatterns = ('',
# (specifically missing get parameters in certain cases)
url
(
r'^debug_request$'
,
'util.views.debug_request'
),
url
(
r'^change_email$'
,
'student.views.change_email_request'
),
url
(
r'^change_email$'
,
'student.views.change_email_request'
,
name
=
"change_email"
),
url
(
r'^email_confirm/(?P<key>[^/]*)$'
,
'student.views.confirm_email_change'
),
url
(
r'^change_name$'
,
'student.views.change_name_request'
),
url
(
r'^accept_name_change$'
,
'student.views.accept_name_change'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment