Merge pull request #2754 from solgenomics/topic/fix_homepage_add_accessions_dialog
[sgn.git] / mason / user / reset_password_form.mas
blobe7bf24f8298cfa067f37d7c762b7405d569ffd37
2 <%args>
3 $person_id
4 $username
5 $token
6 </%args>
8 <style>
9 .textlabel {
10   width: 200px;
11   white-space: nowrap;
12   max-width: 150px;
13   overflow: hidden;
14   text-overflow: ellipsis;
15   float:left;     
18 .input { 
19   width: 200px;
20   white-space:nowrap;
23 .form-control { 
24   width: 200px;
27 </style>
29 <& /page/page_title.mas, title=>"Enter new password for user $username" &>
31 <form id="process_reset_password_form" name="process_reset_password_form">
32 <div style="white-space:nowrap">
33   <label class="textlabel" for="new_password" style="white-space:nowrap;">New password</label>
34   <input class="form-control" style="width:150" id="new_password" name="new_password" type="password" />
35 </div>
36 <br />
37 <div>
38   <label class="textlabel" for="confirm_password" >Confirm password</label>
39   <input class="form-control" style="width:150" id="confirm_password" name="confirm_password" type="password" />
40 </div>
41 <input type="hidden" name="sp_person_id" value="<% $person_id %>" />
42 <input type="hidden" name="token" value="<% $token %>" />
43 <br/>
44 <button class="btn btn-primary" id="submit_password_reset_button" type="submit" >Reset Password</button>
45 </form>
47 <script>
48   jQuery(document).ready( function() { 
50     jQuery('#process_reset_password_form').submit( function(event) { 
51        var form_data = jQuery('#process_reset_password_form').serialize();
52        jQuery.ajax( { 
53          url: '/ajax/user/process_reset_password',
54          data: form_data,
55          error: function(r) { alert('An error occurred! Sorry!');  },
56          success: function(r) {
57            if (r.error) { alert(r.error); }
58            else { 
59              alert(r.message);
60            }
61          }
62        });
63        event.preventDefault();
64     });
65   });
66 </script>