remove unused digestion.pl
[sgn.git] / mason / ontology / associate_ontology.mas
blob659d0541663f0b6525b23f839a7d1d953dc3ef73
1 <%doc>
3 =head1 NAME
5 /ontology/associate_ontology.mas - a component for printing a generic 'associate_ontology' javasript form and displaying the ontology annotation
7 =head1 DESCRIPTION
10 Parameters:
12 =over 9
14 =item object_id
16 a database id
18 =item object_name
20 the type of the object you are annotating
22 =item cvterm_autocomplete_uri
24 defaults to /ajax/cvterm/autocomplete
26 =item cvterm_add_uri
28 the uri for associating the cvterm with your object
30 =iterm relationships_uri
32 populate the relationships drop down menu. defaults to /ajax/cvterm/relationships
34 =item evidence_uri
36 populate the evidence code menu. Defaults to /ajax/cvterm/evidence
38 =item evidence_description_uri
40 populate the evidence description menu. Defaults to /ajax/cvterm/evidence_description
42 =iterm show_form
44 whether the associate form should be printed. Usually only if the user is logged-in
46 =item ontology_url
48 the url for displaying the ontology annotation
50 =back
52 =head1 AUTHOR
54 Naama Menda <nm249@cornell.edu>
56 =cut
59 </%doc>
61 <%args>
63 $object_id
64 $object_name
65 $cvterm_autocomplete_uri  => '/ajax/cvterm/autocomplete'
66 $cvterm_add_uri
67 $relationships_uri => '/ajax/cvterm/relationships'
68 $evidence_uri => '/ajax/cvterm/evidence'
69 $evidence_description_uri => '/ajax/cvterm/evidence_description'
70 $reference_uri => '/stock/'.$object_id.'/references'
71 $show_form => 0
72 $div_id => 'ontology_terms'
73 $ontology_url
75 </%args>
77 <style>
78   #ontology .evidence {
79     margin: 1em 0 0 4em;
80     width: 50%;
81     border: 1px dotted gray;
82     padding: 10px;
83   }
84   #ontology_show_details {
85     text-align: right;
86     margin-bottom: -2em;
87   }
88   #ontology_show_details label {
89     font-weight: bold;
90   }
91   .active#ontology_show_details {
92     background: white;
93   }
94 </style>
96 <& /util/import_javascript.mas, classes=>[qw[ jquery jqueryui popup CXGN.AJAX.Ontology] ]&>
98   <div id="ontology_show_details" style="display: none">
99     <form> <input type="checkbox" id="show_details" disabled="true" />
100       <label for="show_details">Show complete details</label> 
101     </form>
102   </div>
104 <div id="ontology" >[loading...] </div>
106 <script language="javascript">
108   
109   Ontology.displayOntologies("ontology" , "<% $ontology_url %>");
110   
111 </script>
113 % if ($show_form) { 
114 <div id="associate_cvterm_form">
115   <b>Associate ontology term</b>
116   <form name="cvterm_form" >
117     <div id="cvterm_search" >
118       <input type="text" style="width: 50%" id="term_name" name="term_name" value="Type a term name" onchange="Ontology.updateAutocomplete('<% $cvterm_autocomplete_uri %>')" />
119       <input type="hidden" id="object_id" name="object_id" value="<% $object_id %>" />
121       <select id = "db_name" onchange="jQuery('#term_name').val('---Type a term name---')")">
122         <option value="GO">GO (gene ontology)</option>
123         <option value="PO">PO (plant ontology)</option>
124         <option value="SP">SP (Solanaceae phenotypes)</option>
125       </select><br>
127       <div style="font-size: 80%; margin-left: 1em; color: #333">type a cvterm name</div>
128       <div id ="ontology_evidence">
129         <b>Relationship type:</b>
130     <select id="relationship_select" style="width: 100%"
131             onchange="Ontology.populateEvidence('evidence_code_select', '<% $evidence_uri %>' )">
132     </select>
133     <b>Evidence code:</b>
134     <select id="evidence_code_select" style="width: 100%"
135             onchange="jQuery('#associate_ontology_button').removeAttr('disabled');Ontology.populateEvidence('evidence_description_select', '<% $evidence_description_uri %>' + '?evidence_code_id=' + jQuery('#evidence_code_select').val() );Ontology.getEvidenceWith();Ontology.populateEvidence('reference_select', '<% $reference_uri %>')">
136     </select>
137     
138     <b>Evidence description:</b>
139     <select id="evidence_description_select" style="width: 100%">
140     </select>
141     
142     <b>Evidence with:</b>
143     <select id="evidence_with_select" style="width: 100%">
144     </select>
145     
146     <b>Reference:</b>
147     <select id="reference_select" style="width: 100%">
148     </select>
149     <div id="ontology_select_button">
150       <input type="button"
151              id="associate_ontology_button"
152              value="associate term"
153              disabled="true"
154              onclick="javascript:Ontology.submitCvtermForm('<% $cvterm_add_uri %>', '<% $ontology_url %>');this.disabled=true"
155              </div>
156       </div>
158     </div>
159   </form>
160 </div>
162 % }