Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Finished version 2.0

  • Loading branch information...
commit 326e7315a1d98f37908c32dd774b6cc820555815 1 parent 4674fae
@toantran authored
View
26 coffee/public/js/recover.coffee
@@ -5,18 +5,20 @@ jQuery ($) ->
$.post('/account/recover', {email: email})
.success (data) ->
if data?.success
- $('<div>A reset password instruction email has been sent to your email account.</div>')
- .dialog
- autoOpen: true
- buttons:
- 'Ok': ->
- $(@).dialog 'close'
+ $('#recover-ok-dlg').modal 'show'
+# $('<div>A reset password instruction email has been sent to your email account.</div>')
+# .dialog
+# autoOpen: true
+# buttons:
+# 'Ok': ->
+# $(@).dialog 'close'
else
- $("<div>An error has occurred while trying to send your reset password email. Please try again later.</div>")
- .dialog
- autoOpen: true
- buttons:
- 'Ok': ->
- $(@).dialog 'close'
+ $('#recover-failed-dlg').modal 'show'
+# $("<div>An error has occurred while trying to send your reset password email. Please try again later.</div>")
+# .dialog
+# autoOpen: true
+# buttons:
+# 'Ok': ->
+# $(@).dialog 'close'
return false;
View
18 public/js/recover.js
@@ -9,23 +9,9 @@
email: email
}).success(function(data) {
if (data != null ? data.success : void 0) {
- return $('<div>A reset password instruction email has been sent to your email account.</div>').dialog({
- autoOpen: true,
- buttons: {
- 'Ok': function() {
- return $(this).dialog('close');
- }
- }
- });
+ return $('#recover-ok-dlg').modal('show');
} else {
- return $("<div>An error has occurred while trying to send your reset password email. Please try again later.</div>").dialog({
- autoOpen: true,
- buttons: {
- 'Ok': function() {
- return $(this).dialog('close');
- }
- }
- });
+ return $('#recover-failed-dlg').modal('show');
}
});
return false;
View
17 views/account/recover.jade
@@ -11,4 +11,21 @@ link(rel="stylesheet/less", type="text/css", href="/stylesheets/recover.less")
input#form-login-username(maxlength='255', name='email', size='25', type='text', required, placeholder='Enter your email address')
.message!= partial('../messages')
button.btn.btn-primary(type='submit') Submit
+
+#recover-ok-dlg.modal.hide
+ .modal-header
+ a.close(data-dismiss='modal') x
+ h4 OK
+ .modal-body
+ p A reset password instruction email has been sent to your email account.
+ .modal-footer
+ a.btn.btn-success.pull-right(data-dismiss='modal') OK
+#recover-failed-dlg.modal.hide
+ .modal-header
+ a.close(data-dismiss='modal') x
+ h4 Failed
+ .modal-body
+ p An error has occurred while trying to send your reset password email. Please try again later.
+ .modal-footer
+ a.btn.btn-success.pull-right(data-dismiss='modal') OK
script(type='text/javascript', src='/js/recover.js')
Please sign in to comment.
Something went wrong with that request. Please try again.