Merge pull request #3313 from solgenomics/topic/add_pedigree_upload_header_check
[sgn.git] / mason / user / reset_password_form.mas
blobb2bf1d5f75f7779bfa6d86fe2f466538091fa94b
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 <div class="modal fade" id="post_email_reset_password_dialog" name="post_email_reset_password_dialog" data-backdrop="false" aria-labelledby="post_email_reset_password_dialog_title">
32     <div class="modal-dialog modal-sm" role="document">
33         <div class="modal-content">
34             <div class="modal-header" style="text-align:center">
35                 <h3 class="modal-title" id="post_email_reset_password_dialog_title">Reset Password</h3>
36             </div>
37             <div class="modal-body">
38                 <form id="process_reset_password_form" name="process_reset_password_form">
39                     <div style="white-space:nowrap">
40                     <label class="textlabel" for="new_password" style="white-space:nowrap;">New password</label>
41                         <input class="form-control" style="width:150" id="new_password" name="new_password" type="password" />
42                     </div>
43                     <br />
44                     <div>
45                         <label class="textlabel" for="confirm_password" >Confirm password</label>
46                         <input class="form-control" style="width:150" id="confirm_password" name="confirm_password" type="password" />
47                     </div>
48                     <input type="hidden" name="sp_person_id" value="<% $person_id %>" />
49                     <input type="hidden" name="token" value="<% $token %>" />
50                     <br/>
51                     <button class="btn btn-primary" id="submit_password_reset_button" type="submit" >Reset Password</button>
52                 </form>
53             </div>
54             <div class="modal-footer">
55             </div>
56         </div>
57     </div>
58 </div>
60 <script>
61   jQuery(document).ready( function() { 
63   jQuery('#post_email_reset_password_dialog').appendTo("body").modal("show");
65     jQuery('#post_email_reset_password_dialog').on('shown.bs.modal', function() {
66         jQuery(document).off('focusin.modal');
67     });
69     jQuery('#process_reset_password_form').submit( function(event) { 
70        var form_data = jQuery('#process_reset_password_form').serialize();
71        jQuery.ajax( { 
72          url: '/ajax/user/process_reset_password',
73          data: form_data,
74          error: function(r) { alert('An error occurred! Sorry!');  },
75          success: function(r) {
76            if (r.error) { alert(r.error); }
77            else { 
78              alert(r.message);
79            }
80          }
81        });
82        event.preventDefault();
83     });
84   });
85 </script>