7 <script src="/js/node_modules/datatables/media/js/jquery.dataTables.min.js"></script>
8 <script src="/js/source/entries/user_profile.js" ></script>
9 <script src="/js/source/entries/login.js"></script>
11 <link rel="stylesheet" type="text/css" href="/js/node_modules/datatables/media/css/jquery.dataTables.css" />
13 % if($dbuser_id == 0){ #This is a new user. Security will be handled on the Perl side
15 $(document).ready(function(){
16 has_login().then(function(r){
17 if(r.user == null || r.role !== "curator"){
18 alert("You do not have a valid curator login.");
19 window.history.back();
25 <h1> Enter New User Data </h1>
27 <table id="new_user_data_form" width="100%" style="display">
30 <td><textarea id="edit_first_name" rows="1" cols="60" style="display"></textarea></td>
31 <td>Password (Must be 7 or more characters)</td>
32 <td><input id="new_password" rows="1" cols="60" style="display" type="password"></input></td>
36 <td><textarea id="edit_last_name" rows="1" cols="60" style="display"></textarea></td>
37 <td>Confirm Password</td>
38 <td><input id="new_password_confirm" rows="1" cols="60" style="display" type="password"></input></td>
41 <td>Email Address</td>
42 <td><textarea id="edit_email" rows="1" cols="60" style="display"></textarea></td>
43 <td colspan="2">(Keep careful track of the password you choose, you will have to give it to the new user)</td>
47 <td><textarea id="edit_username" rows="1" cols="60" style="display"></textarea></td>
50 <td>Organization/Institution</td>
51 <td><textarea id="edit_organization" rows="1" cols="60" style="display"></textarea></td>
54 <select id="edit_user_type" name="edit_user_type">
55 <option value="">Regular User</option>
56 <option value="curator">Curator</option>
64 <center><button id="submit_new_user_data_button" type="button" class="btn btn-primary" onclick="submit_new_user_data()">Submit new user data</button></center>
68 % if($dbuser_id != 0) {
70 <h1> User Profile </h1>
74 <table width="50%" id="user_profile_table">
76 <td width="20%" style="border-bottom: 1px solid lightblue">
77 <label for="user_name">Name</label>
79 <td width="20%" style="border-bottom: 1px solid lightblue">
80 <span id="user_name" disabled></span>
84 <td width="20%" style="border-bottom: 1px solid lightblue">
85 <label for="user_username">Username</label>
87 <td width="20%" style="border-bottom: 1px solid lightblue">
88 <span id="user_username" disabled></span>
92 <td width="20%" style="border-bottom: 1px solid lightblue">
93 <label for="user_email">Email</label>
95 <td width="20%" style="border-bottom: 1px solid lightblue">
96 <span id="user_email" disabled></span>
100 <td width="20%" style="border-bottom: 1px solid lightblue">
101 <label for="user_type">User Type</label>
103 <td width="20%" style="border-bottom: 1px solid lightblue">
104 <span id="user_type" disabled></span>
108 <td width="20%" style="border-bottom: 1px solid lightblue">
109 <label for="user_organization">Organization/Institution</label>
111 <td width="20%" style="border-bottom: 1px solid lightblue">
112 <span id="user_organization" disabled></span>
119 % if($sp_person_id == $dbuser_id){
123 <button id="change_user_data_button" class="btn btn-primary" type="button" onclick="edit_profile(<% $dbuser_id %>)">Edit Your Profile</button>
125 <button id="change_password_button" class="btn btn-primary" type="button" onclick="change_password(<% $dbuser_id %>)">Change Password</button>
127 <p><table id="change_user_data_form" width="50%" style="display:none">
130 <td><textarea id="edit_first_name" rows="1" cols="60" style="display:none"></textarea></td>
134 <td><textarea id="edit_last_name" rows="1" cols="60" style="display:none"></textarea></td>
137 <td>Email Address</td>
138 <td><textarea id="edit_email" rows="1" cols="60" style="display:none"></textarea></td>
142 <td><textarea id="edit_username" rows="1" cols="60" style="display:none"></textarea></td>
145 <td>Organization/Institution</td>
146 <td><textarea id="edit_organization" rows="1" cols="60" style="display:none"></textarea></td>
150 <table id="change_password_form" width="50%" style="display:none">
152 <td>Old Password</td>
153 <td><input id="old_password" rows="1" cols="60" style="display:none" type="password"></input></td>
156 <td>New Password (Must be 7 or more characters)</td>
157 <td><input id="new_password" rows="1" cols="60" style="display:none" type="password"></input></td>
160 <td>Confirm New Password</td>
161 <td><input id="new_password_confirm" rows="1" cols="60" style="display:none" type="password"></input></td>
169 <h2>Authored SMIDs</h2>
171 <table id="user_authored_smids" class="display" style="width:90%">
174 <h2>Authored Experiments</h2>
176 <table id="user_authored_experiments" class="display" style="width:90%">
179 % if($sp_person_id == $dbuser_id) {
182 <table id="user_profile_groups" class="display" style="width:90%">
188 $(document).ready(function(){
189 var dbuser_id = <% $dbuser_id %>;
190 populate_profile_data(dbuser_id);