diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 6be72277cc..9b59dc2cd9 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -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('
'); - } - $('#unenroll_error').text(json.error).stop().css("display", "block"); - } - }); + $(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(''); + } + $('#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("You'll receive a confirmation in your " + + "in-box. Please click the link in the " + + "email to confirm the email change.
"); + } else { + $("#change_email_error").html(data.error); + } + }); + return false; + }); + })(this) %block> @@ -48,10 +75,17 @@ @@ -121,13 +155,11 @@ - -✕
+