Merge pull request #2754 from solgenomics/topic/fix_homepage_add_accessions_dialog
[sgn.git] / mason / user / reset_password.mas
blob00611a257fed3a76f6f4e86c89ffd0e5a6aea85e
2 <%args>
4 </%args>
6 <style>
7 .textlabel {
8   width: 200px;
9   white-space: nowrap;
10   max-width: 150px;
11   overflow: hidden;
12   text-overflow: ellipsis;
13   float: left;
16 .input { 
17   width: 200px;
18   white-space:nowrap;
21 .form-control { 
22   width: 200px;
25 </style>
28 <& /page/page_title.mas, title=>"Reset Password" &>
30 <div>
31 To reset your password, please enter your email address. A link will be sent to that address with a link that will enable you to reset your password.
32 </div>
33 <br />
34 <div style="white-space:nowrap">
35 <form id="password_reset_form" name="password_reset_form" style="white-space:nowrap">
36 <div style="white-space:nowrap; align:center">
37   <label class="textlabel">Email Address</label>
38   <input class="form-control" style="width:200px; white-space:nowrap; float:center" id="password_reset_email" name="password_reset_email" /><br />
39   <button type="submit" class="btn btn-primary" id="submit_password_reset_email" style="float:center" >Get link</button>
40 </div>
41 <br />
43 </form>
44 </div>
45 <script>
46     jQuery(document).ready( function() { 
48       jQuery('#password_reset_form').submit( function(event) { 
49     
50         event.preventDefault();
52         var form_data = jQuery('#password_reset_form').serialize();
54         jQuery.ajax( { 
55           url: '/ajax/user/reset_password',
56           data: form_data,
57           error: function(r) { alert('An error occurred! Sorry!');  },
58           success: function(r) {
59             if (r.error) { alert(r.error); }
60             else { 
61               alert(r.message);
62               window.history.back();
63             }
64           }
65     
66       });
67     });
68   });
70 </script>