Merge pull request #5205 from solgenomics/topic/generic_trial_upload
[sgn.git] / mason / locus / registry.mas
blob5f441c27a0c7db75abecb60fc1933a3c6a5c2ee6
3 <%doc>
5 =head1 NAME
7 /locus/registry.mas - a component for locus registry form
9 =head1 DESCRIPTION
12 Parameters:
14 =over 4
16 =item person_id
18 The ID of the logged in person
20 =item locus_id
22 a locus id
24 =item is_owner
26 boolean. If passed, a link to the registry form will be printed
28 =item registry
30 the existing registry name
32 =back
34 =head1 AUTHOR
36 Naama Menda <nm249@cornell.edu>
38 =cut
40 </%doc>
42 <%args>
44 $person_id
45 $locus_id
46 $is_owner => undef
47 $registry => undef
49 </%args>
51 <%perl>
53 </%perl>
55 % if ($registry) {
56 This locus is associated with registry name: <% $registry %>
57 % }
58 % if ($is_owner)  {
60 <& /util/import_javascript.mas, classes => ["CXGN.Phenome.Locus"] &>
61   <div id="associateRegistryForm" style="display: none">
62     <div id="registry_search">
63       Registry Name:
64       <input type="text"
65              style="width: 50%"
66              id="registry_input"
67              onkeyup="Locus.getRegistries(this.value)">
68       <input type="button"
69              id="associate_registry_button"
70              value="associate registry"
71              disabled="true"
72              onclick="Locus.associateRegistry('<% $locus_id %>','<% $person_id %>');this.disabled=false;">
74       <select id="registry_select"
75               style="width: 100%"
76               name="registry_select"
77               size="10"
78               onchange="Locus.updateRegistryInput()">
80       </select>
82       Click <a href="javascript:Locus.addRegistryView()">here</a> to add a new registry name to our database
83     </div>
85     <div id="registry_add" style="display: none">
86       <b>Please enter the values for the new registry name below (* is required)</b><br><br>
87       <table cellspacing="0" cellpadding="0">
88         <tr><td>*Registry Symbol: </td><td width="20">&nbsp;</td>
89           <td><input type="text" id="registry_symbol" onblur="Locus.enableButton();" onchange="Locus.enableButton();"></td></tr>
90         <tr><td>*Registry Name: </td><td width="20">&nbsp;</td>
91           <td><input type="text" id="registry_name" onblur="Locus.enableButton();" onchange="Locus.enableButton();"></td></tr>
92       </table>
93       Registry Description:<br>
94       <textarea id="registry_description" style="width: 100%"></textarea><br>
95       <input type="button" disabled="true" id="add_registry_button" value="Add New Registry" onclick="Locus.addRegistry('<% $locus_id %> ', '<% $person_id %> ');this.disabled=true;"><br>
96       Click <a href="javascript:Locus.searchRegistries()">here</a> to go back to the registry search
97     </div>
98   </div>
100 % }