diff --git a/lms/static/coffee/src/views/forgot_password.coffee b/lms/static/coffee/src/views/forgot_password.coffee
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/lms/static/js/form.ext.js b/lms/static/js/form.ext.js
new file mode 100644
index 0000000000..417992a622
--- /dev/null
+++ b/lms/static/js/form.ext.js
@@ -0,0 +1,43 @@
+(function($, undefined) {
+ var form_ext;
+ $.form_ext = form_ext = {
+ ajax: function(options) {
+ return $.ajax(options);
+ },
+ handleRemote: function(element) {
+ var method = element.attr('method');
+ var url = element.attr('action');
+ var data = element.serializeArray();
+ var options = {
+ type: method || 'GET',
+ data: data,
+ success: function(data, status, xhr) {
+ element.trigger("ajax:success", [data, status, xhr]);
+ },
+ complete: function(xhr, status) {
+ element.trigger("ajax:complete", [xhr, status]);
+ },
+ error: function(xhr, status, error) {
+ element.trigger("ajax:error", [xhr, status, error]);
+ }
+ }
+ if(url) { options.url = url; }
+ return form_ext.ajax(options)
+ },
+ CSRFProtection: function(xhr) {
+ var token = $.cookie('csrftoken');
+ if (token) xhr.setRequestHeader('X-CSRFToken', token);
+ },
+ }
+ $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { form_ext.CSRFProtection(xhr); }});
+ $(document).delegate('form', 'submit', function(e) {
+ var form = $(this),
+ remote = form.data("remote") !== undefined;
+
+ if(remote) {
+ form_ext.handleRemote(form);
+ return false;
+ }
+
+ });
+})(jQuery);
diff --git a/lms/static/sass/shared/_modal.scss b/lms/static/sass/shared/_modal.scss
index 4a3bed4859..84c57a847c 100644
--- a/lms/static/sass/shared/_modal.scss
+++ b/lms/static/sass/shared/_modal.scss
@@ -106,7 +106,7 @@
}
}
- #enroll_error, #login_error {
+ .modal-form-error {
background: $error-red;
border: 1px solid rgb(202, 17, 17);
color: rgb(143, 14, 14);
diff --git a/lms/templates/forgot_password_modal.html b/lms/templates/forgot_password_modal.html
new file mode 100644
index 0000000000..18ec20ff04
--- /dev/null
+++ b/lms/templates/forgot_password_modal.html
@@ -0,0 +1,34 @@
+<%! from django.core.urlresolvers import reverse %>
+ Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one.Password reset
+
+