add event relations to time ontology and related code
[sgn.git] / mason / breeders_toolbox / add_cross_dialogs.mas
blob17b4f1f850ccbc5b211b43fad78d2e346ca4179a
1 <%args>
2 $locations
3 </%args>
5 <style>
6   .ui-autocomplete {
7   max-height: 100px;
8   overflow-y: auto;
9   /* prevent horizontal scrollbar */
10   overflow-x: hidden;
11   }
13   /* IE 6 doesn't support max-height
14   * we use height instead, but this forces the menu to always be this tall
15   */
16   * html .ui-autocomplete {
17   height: 100px;
18   }
19 </style>
21 <div class="modal fade" id="create_cross" name="create_cross" tabindex="-1" role="dialog" aria-labelledby="createNewCrossesDialog">
22     <div class="modal-dialog modal-xl" role="document">
23         <div class="modal-content ui-front">
24             <div class="modal-header">
25                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
26                 <h4 class="modal-title" id="createNewCrosses">Add New Cross</h4>
27             </div>
28             <div class="modal-body">
29                 <div class="container-fluid">
31                     <&| /util/workflow.mas, id=> "add_cross_workflow" &>
32                         <&| /util/workflow.mas:step, title=> "Intro" &>
33                             <& /page/page_title.mas, title=>"What is a cross?" &>
35                             <ul>
36                                 <li>The Cross Tool can track any pollinations in a breeding program.</li>
37                                 <li>Each cross has a globally unique cross id.</li>
38                                 <li>Supported cross types are: biparental, self, open, sib, bulk, bulk_self, bulk_open, or doubled_haploid</li>
39                                 <li>For an open pollinated cross, the cross can be defined as between female accession A and male population P1 (populations in the database are defined strictly as groups of accessions). If the male parent is not known, it can be left blank.</li>
40                                 <li>An individual cross can be linked to the specific female plot or plant, as well as to the specific male plot or plant.</li>
41                                 <li>A cross can have other data associated to it, such as number of flowers, pollination date, etc.</li>
42                                 <li>Seed produced by a cross can be managed using a seedlot.</li>
43                                 <li>Progenies from a cross can become named accessions in the database.</li>
44                             </ul>
46                             <br/>
47                             <center>
48                                 <button class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
49                             </center>
50                         </&>
51                         <&| /util/workflow.mas:step, title=> "Crossing Experiment" &>
52                             <& /page/page_title.mas, title=>"Select a crossing experiment" &>
54                             <p>Crossing experiments are for grouping crosses together. The grouping is most often done for crosses derived from the same field trial, the same year, or for crosses that have the same breeding objective.</p>
55                             <!--
56                             <hr>
57                             <div class="form-group">
58                                 <label class="col-sm-2 control-label">You can check your crossing experiment here: </label>
59                                 <div class="col-sm-10">
60                                     <div id="upload_crosses_select_crossingtrial_3" name="upload_crosses_select_crossingtrial_3" >
61                                     </div>
62                                 </div>
63                             </div><br/><br/>
64                             <hr>
65                             -->
66                             <center>
67                                 <button class="btn btn-info" name="create_crossingtrial_link">If you need to create a crossing experiment, click here</button><br/><br/>
68                                 <button class="btn btn-primary" onclick="Workflow.complete(this);">Once you have a crossing experiment, go to Next Step</button>
69                             </center>
71                         </&>
73                         <form class="form-horizontal" role="form" name="create_cross_form" id="create_cross_form">
75                             <&| /util/workflow.mas:step, title=> "Enter cross information" &>
76                                 <& /page/page_title.mas, title=>"Enter basic information about the cross" &>
78                                 <&| /page/explanation.mas, title=>'Cross Type information' &>
79                                     <p>
80                                         <b>Cross type information</b>
81                                         <br>
82                                         <a id="cross_type_info">Descriptions of cross types</a>
83                                     </p>
84                                 </&>
85                                 <!--
86                                 <h3>Required:</h3>
87                                 -->
88                                 <div class="form-group">
89                                     <label class="col-sm-3 control-label">Crossing Experiment: </label>
90                                     <div class="col-sm-9">
91                                         <div id="upload_crosses_select_crossingtrial_4" name="upload_crosses_select_crossingtrial_4" >
92                                         </div>
93                                     </div>
94                                 </div><br/><br/><br/>
95                                 <!--
96                                 <div class="form-group">
97                                     <label class="col-sm-3 control-label">Location of cross: </label>
98                                     <div class="col-sm-9">
99                                         <select class="form-control" id="location" name="location">
100                                             <option value="">Select Location</option>
101 <%perl>
102     # foreach my $location (@locations) {
103     #     print "<option value=".'"'.@$location[1].'"'.">".@$location[1]."</option>";
104     # }
105     foreach my $location_hashref (@$locations) {
106         my $properties = $location_hashref->{'properties'};
107         my $program = $properties->{'Program'};
108         my $name = $properties->{'Name'};
109         print "<option value=\"$name\" data-program=\"$program\">".$name."</option>";
110     }
111 </%perl>
112                                         </select>
113                                     </div>
114                                 </div><br/><br/>
115                                 -->
116                                 <div class="form-group">
117                                     <label class="col-sm-3 control-label">Cross Unique ID: </label>
118                                     <div class="col-sm-9">
119                                         <input class="form-control" type="text" id="cross_name" name="cross_name" />
120                                     </div>
121                                 </div><br/><br/>
122                                 <div class="form-group">
123                                     <label class="col-sm-3 control-label">Cross Combination (optional): </label>
124                                     <div class="col-sm-9">
125                                         <input class="form-control" type="text" id="dialog_cross_combination" name="dialog_cross_combination" placeholder="e.g. female_name/male_name"/>
126                                     </div>
127                                 </div><br/><br/>
128                                 <div class="form-group">
129                                     <label class="col-sm-3 control-label">Cross Type: </label>
130                                     <div class="col-sm-9">
131                                         <select class="form-control" id="cross_type">
132                                             <option value="">Select a cross type</option>
133                                             <option value="biparental">biparental</option>
134                                             <option value="self">self</option>
135                                             <option value="open">open pollinated</option>
136                                             <option value="sib">sib</option>
137                                             <option value="bulk">bulk</option>
138                                             <option value="bulk_self">bulk selfed</option>
139                                             <option value="bulk_open">bulk and open pollinated</option>
140                                             <option value="doubled_haploid">doubled haploid</option>
141                                             <option value="polycross">polycross</option>
142                                             <option value="reciprocal">reciprocal</option>
143                                             <option value="multicross">multicross</option>
144                                         </select>
145                                     </div>
146                                 </div>
147                                 <br/><br/>
148                                 <center>
149                                     <button class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
150                                 </center>
151                             </&>
152                             <&| /util/workflow.mas:step, title=> "Enter parentage information" &>
153                                 <& /page/page_title.mas, title=>"Enter basic information about the cross" &>
155                                 <div class="form-group" id="get_maternal_parent" style="display: none">
156                                     <label class="col-sm-2 control-label">Female Parent: </label>
157                                     <div class="col-sm-10">
158                                         <input class="form-control" id="maternal_parent" type="text" name="maternal" />
159                                     </div><br/><br/>
160                                 </div>
161                                 <div class="form-group" id="get_paternal_parent" style="display: none">
162                                     <label class="col-sm-2 control-label">Male Parent: </label>
163                                     <div class="col-sm-10">
164                                         <input class="form-control" id="paternal_parent" type="text" name="paternal" />
165                                     </div><br/><br/>
166                                 </div>
167                                 <div class="form-group" id="get_selfed_parent" style="display: none">
168                                     <label class="col-sm-2 control-label">Selfed Parent: </label>
169                                     <div class="col-sm-10">
170                                         <input class="form-control" id="selfed_parent" type="text" name="selfed" />
171                                     </div><br/><br/>
172                                 </div>
173                                 <div class="form-group" id="get_sib_parent" style="display: none">
174                                     <label class="col-sm-2 control-label">Sib Parent: </label>
175                                     <div class="col-sm-10">
176                                         <input class="form-control" id="sib_parent" type="text" name="sib" />
177                                     </div><br/><br/>
178                                 </div>
179                                 <div class="form-group" id="get_open_maternal_parent" style="display: none">
180                                     <label class="col-sm-2 control-label">Female Parent: </label>
181                                     <div class="col-sm-10">
182                                         <input class="form-control" id="open_maternal_parent" type="text" name="open maternal" />
183                                     </div><br/><br/>
184                                 </div>
185                                 <div class="form-group" id="get_open_paternal_population" style="display: none">
186                                     <div class="col-sm-2"><center><label class="control-label">Male Population: </label><i>(optional)</i></center></div>
187                                     <div class="col-sm-10">
188                                         <input class="form-control" id="open_paternal_population" type="text" name="open paternal" />
189                                     </div><br/><br/>
190                                 </div>
191                                 <div class="form-group" id="get_bulk_maternal_population" style="display: none">
192                                     <label class="col-sm-2 control-label">Female Population: </label>
193                                     <div class="col-sm-10">
194                                         <input class="form-control" id="bulk_maternal_population" type="text" name="bulk maternal" />
195                                     </div><br/><br/>
196                                 </div>
197                                 <div class="form-group" id="get_bulk_paternal_parent" style="display: none">
198                                     <label class="col-sm-2 control-label">Male Parent: </label>
199                                     <div class="col-sm-10">
200                                         <input class="form-control" id="bulk_paternal_parent" type="text" name="bulk paternal" />
201                                     </div><br/><br/>
202                                 </div>
203                                 <div class="form-group" id="get_bulk_selfed_population" style="display: none">
204                                     <label class="col-sm-2 control-label">Selfed Population: </label>
205                                     <div class="col-sm-10">
206                                         <input class="form-control" id="bulk_selfed_population" type="text" name="bulk selfed" />
207                                     </div><br/><br/>
208                                 </div>
209                                 <div class="form-group" id="get_bulk_open_maternal_population" style="display: none">
210                                     <label class="col-sm-2 control-label">Female Population: </label>
211                                     <div class="col-sm-10">
212                                         <input class="form-control" id="bulk_open_maternal_population" type="text" name="bulk open maternal" />
213                                     </div><br/><br/>
214                                 </div>
215                                 <div class="form-group" id="get_bulk_open_paternal_population" style="display: none">
216                                     <div class="col-sm-2"><center><label class="control-label">Male Population: </label><i>(optional)</i></center></div>
217                                     <div class="col-sm-10">
218                                         <input class="form-control" id="bulk_open_paternal_population" type="text" name="bulk open paternal" />
219                                     </div><br/><br/>
220                                 </div>
221                                 <div class="form-group" id="get_doubled_haploid_parent" style="display: none">
222                                     <label class="col-sm-2 control-label">Doubled Haploid Parent: </label>
223                                     <div class="col-sm-10">
224                                         <input class="form-control" id="doubled_haploid_parent" type="text" name="doubled haploid" />
225                                     </div><br/><br/>
226                                 </div>
227                                 <div class="form-group" id="polycross_accessions" style="display: none">
228                                     <label class="col-sm-2 control-label">Accessions to use in Polycross: </label>
229                                     <div class="col-sm-10">
230                                         <div id="polycross_accession_list"></div>
231                                     </div><br/><br/>
232                                 </div>
233                                 <div class="form-group" id="reciprocal_accessions" style="display: none">
234                                     <label class="col-sm-2 control-label">Accessions to use in Reciprocal cross: </label>
235                                     <div class="col-sm-10">
236                                         <div id="reciprocal_accession_list"></div>
237                                     </div><br/><br/>
238                                 </div>
239                                 <div class="form-group" id="maternal_accessions" style="display: none">
240                                     <label class="col-sm-2 control-label">Multicross Female Parents: </label>
241                                     <div class="col-sm-10">
242                                         <div id="maternal_accession_list"></div>
243                                     </div><br/><br/>
244                                 </div>
245                                 <div class="form-group" id="paternal_accessions" style="display: none">
246                                     <label class="col-sm-2 control-label">Multicross Male Parents: </label>
247                                     <div class="col-sm-10">
248                                         <div id="paternal_accession_list"></div>
249                                     </div><br/><br/>
250                                 </div>
251                                 <br>
252                                 <center>
253                                     <button class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
254                                 </center>
255                             </&>
256                             <&| /util/workflow.mas:step, title=> "Track exact cross parents" &>
257                                 <& /page/page_title.mas, title=>"Optional: If you choose to record exact cross parents, you can do so." &>
259                                 <div class="form-group">
260                                     <label class="col-sm-2 control-label">Field Trial: </label>
261                                     <div class="col-sm-10">
262                                         <div class="input-group">
263                                             <input type ="text" class ="form-control" id ="field_trial">
264                                             <div class ="input-group-btn">
265                                                 <button class = "btn btn-info" id ="search_plots"></i>Search Plots</button>
266                                             </div>
267                                         </div>
268                                     </div>
269                                 </div><br/><br/>
270                                 <div class="form-group">
271                                     <label class="col-sm-2 control-label">Female Plot: </label>
272                                     <div class="col-sm-10">
273                                         <select class="form-control" id="female_plot" name="female_plot">
274                                             <option value="">Choose trial first</option>
275                                         </select>
276                                     </div>
277                                 </div><br/><br/>
278                                 <div class="form-group">
279                                     <label class="col-sm-2 control-label">Male Plot: </label>
280                                     <div class="col-sm-10">
281                                         <select class="form-control" id="male_plot" name="male_plot">
282                                             <option value="">Choose trial first</option>
283                                         </select>
284                                     </div>
285                                 </div><br/><br/>
286                                 <center>
287                                     <button class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
288                                 </center>
289                             </&>
290                             <&| /util/workflow.mas:step, title=> "Additional cross info" &>
291                                 <& /page/page_title.mas, title=>"If you would like to add auto-generated progeny names for this cross, you can add it here" &>
292                                 <h3>Optional:</h3>
293                                 <table>
294                                 <!--
295                                     <tr>
296                                         <td>
297                                             <div class="form-group">
298                                                 <label class="col-sm-9 control-label">Specify Pollination Date: </label>
299                                                 <div class="col-sm-3">
300                                                     <input id= "pollination_date_checkbox" type="checkbox" />
301                                                 </div>
302                                             </div>
303                                         </td>
304                                         <td>
305                                             <div class="form-group" id="get_pollination_date" style="display: none">
306                                                 <label class="col-sm-6 control-label">Pollination Date (YYYY/MM/DD): </label>
307                                                 <div class="col-sm-6">
308                                                     <input class="form-control" type="text" id="pollination_date" />
309                                                 </div>
310                                             </div>
311                                         </td>
312                                     </tr>
313                                     <tr>
314                                         <td>
315                                             <div class="form-group">
316                                                 <label class="col-sm-9 control-label">Specify Number of Flowers: </label>
317                                                 <div class="col-sm-3">
318                                                     <input id= "flower_number_checkbox" type="checkbox" />
319                                                 </div>
320                                             </div>
321                                             <div class="form-group">
322                                                 <label class="col-sm-9 control-label">Specify Number of Fruits: </label>
323                                                 <div class="col-sm-3">
324                                                     <input id= "fruit_number_checkbox" type="checkbox" />
325                                                 </div>
326                                             </div>
327                                         </td>
328                                         <td>
329                                             <div class="form-group" id="get_flower_number" style="display: none">
330                                                 <label class="col-sm-6 control-label">Number of Flowers: </label>
331                                                 <div class="col-sm-6">
332                                                     <input class="form-control" type="text" id="flower_number" />
333                                                 </div>
334                                             </div>
335                                             <div class="form-group" id="get_fruit_number" style="display: none">
336                                                 <label class="col-sm-6 control-label">Number of Fruits: </label>
337                                                 <div class="col-sm-6">
338                                                     <input class="form-control" type="text" id="fruit_number" />
339                                                 </div>
340                                             </div>
341                                         </td>
342                                     </tr>
343                                     <tr>
344                                         <td>
345                                             <div class="form-group">
346                                                 <label class="col-sm-9 control-label">Specify Number of Seeds: </label>
347                                                 <div class="col-sm-3">
348                                                     <input id= "seed_number_checkbox" type="checkbox" />
349                                                 </div>
350                                             </div>
351                                         </td>
352                                         <td>
353                                             <div class="form-group" id="get_seed_number" style="display: none">
354                                                 <label class="col-sm-6 control-label">Number of Seeds: </label>
355                                                 <div class="col-sm-6">
356                                                     <input class="form-control" type="text" id="seed_number" />
357                                                 </div>
358                                             </div>
359                                         </td>
360                                     </tr>
361                                     -->
362                                     <tr>
363                                         <td>
364                                             <div class="form-group">
365                                                 <label title="You may choose to create accessions for the progeny of the cross at this time." class="col-sm-9 control-label">Add New Accessions for Progeny: </label>
366                                                 <div class="col-sm-3">
367                                                     <input id="create_progeny_checkbox" type="checkbox"/>
368                                                 </div>
369                                             </div>
370                                         </td>
371                                         <td>
372                                             <div class="form-group" id="create_progeny_number" style="display: none">
373                                                 <label class="col-sm-6 control-label">Number of progeny: </label>
374                                                 <div class="col-sm-6">
375                                                     <input class="form-control" type="text" id="progeny_number" />
376                                                 </div>
377                                             </div>
378                                         </td>
379                                     </tr>
380                                     <tr id="use_prefix_suffix" style = "display: none">
381                                         <td>
382                                             <div class="form-group">
383                                                 <label class="col-sm-9 control-label">Use Prefix and/or Suffix: </label>
384                                                 <div class="col-sm-3">
385                                                     <input id="use_prefix_suffix_checkbox" type="checkbox" checked/>
386                                                 </div>
387                                             </div>
388                                         </td>
389                                         <td id="get_prefix_suffix" style="display: none">
390                                             <div class="form-group" >
391                                                 <label class="col-sm-6 control-label">Prefix: </label>
392                                                 <div class="col-sm-6">
393                                                     <input class="form-control" id="prefix" name="prefix" value="P" size="5" />
394                                                 </div>
395                                             </div>
396                                             <div class="form-group" >
397                                                 <label class="col-sm-6 control-label">Suffix: </label>
398                                                 <div class="col-sm-6">
399                                                     <input class="form-control" id="suffix" name="suffix" size="5" />
400                                                 </div>
401                                             </div>
402                                         </td>
403                                     </tr>
404                                 </table>
405                                 <br/>
406                                 <center>
407                                     <button class="btn btn-primary" name="create_cross_submit" id="create_cross_submit" onclick="Workflow.complete(this, false);">Submit Cross</button>
408                                 </center>
409                             </&>
410                         </form>
412                         <&| /util/workflow.mas:complete, title=> "Complete" &>
413                             <& /page/page_title.mas, title=>"Finished! Your cross is now in the database" &>
414                             <p>
415                                 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
416                                 The cross was added successfully
417                             </p>
419                             <ul>
420                                 <li>You may want to proceed to the cross detail page for the cross you just created.</li>
421                                 <li>You can print barcodes for the cross.</li>
422                                 <li>You can add crossing information as it becomes available (e.g. number of seeds, progeny, etc).</li>
423                             </ul>
424                             <br/>
425                         </&>
426                     </&><!-- End of workflow -->
427                 </div>
428             </div>
429             <div class="modal-footer">
430                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
431             </div>
432         </div>
433     </div>
434 </div>
436 <div class="modal fade" id="cross_type_dialog" name="cross_type_dialog" tabindex="-1" role="dialog" aria-labelledby="crossTypeDialog">
437     <div class="modal-dialog modal-lg" role="document">
438         <div class="modal-content">
439             <div class="modal-header">
440                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
441                 <h4 class="modal-title" id="crossTypeDialog">Template Information</h4>
442             </div>
443             <div class="modal-body">
444                 <div class="container-fluid">
445                     <h2>
446                         Individual Crosses:
447                     </h2>
449                     <p><b>biparental:</b> An individual plant pollinated by another individual plant.<p>
450                     <p><b>self:</b> A self pollinated individual plant.<p>
451                     <p><b>open pollinated:</b> An individual plant pollinated by a group of plants or open pollinated (pollen may be from a group with known or unknown members).<p>
452                     <p><b>sib:</b> Mating between individuals that have at least one parent in common. Generally between two individuals within the same plot.<p>
453                     <p><b>bulk:</b> A group of plants (usually a related family) pollinated by an individual plant.<p>
454                     <p><b>bulk selfed:</b> A group of plants (usually a related family) that are self pollinated (each individual selfed, not combined pollen).<p>
455                     <p><b>bulk and open pollinated:</b> A group of plants (usually a related family) that are pollinated by another group of plants or open pollinated (pollen may be from a group with known or unknown members).<p>
456                     <p><b>doubled haploid:</b> Plants derived from doubling the chromosome number of haploid tissue.<p>
457                     <br>
459                     <h2>
460                       Group of Crosses:
461                     </h2>
463                     <p><b>polycross:</b> Creates a group of open pollinated crosses. Each accession in the selected list becomes the female parent in an open cross, and all the members of the list grouped together form the male parent.<p>
464                     <p><b>reciprocal:</b> Creates a group of biparental crosses. Starting with a list of accessions, all possible biparental cross combinations are made between them.<p>
465                     <p><b>multicross:</b> Creates a group of biparental crosses. Starting with a list of maternal accessions and a list of paternal accessions, direct crosses are made in order.<p>
466                 </div>
467             </div>
468             <div class="modal-footer">
469                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
470             </div>
471         </div>
472     </div>
473 </div>
475 <div class="modal fade" id="cross_saved_dialog_message" name="cross_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="crossSavedDialog">
476   <div class="modal-dialog" role="document">
477     <div class="modal-content">
478       <div class="modal-header">
479         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
480         <h4 class="modal-title" id="crossSavedDialog">Success</h4>
481       </div>
482       <div class="modal-body">
483         <div class="container-fluid">
484             <p>
485           <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
486           The cross or crosses were saved successfully.
487           </p>
488         </div>
489       </div>
490       <div class="modal-footer">
491         <button id="dismiss_cross_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
492       </div>
493     </div>
494   </div>
495 </div>
497 <script>
499 jQuery.noConflict();
501 jQuery(document).ready(function($) {
503     jQuery("#field_trial").autocomplete({
504         source:'/ajax/stock/project_autocomplete',
505     });
507     $("#search_plots").click(function(e){
508         e.preventDefault();
510         var maternal_parent;
511         if ($('#maternal_parent').val() != ''){
512             maternal_parent = $('#maternal_parent').val();
513         }
515         if ($('#selfed_parent').val() != ''){
516             maternal_parent = $('#selfed_parent').val();
517         }
519         if ($('#open_maternal_parent').val() != ''){
520             maternal_parent = $('#open_maternal_parent').val();
521         }
523         if ($('#sib_parent').val() != ''){
524             maternal_parent = $('#sib_parent').val();
525         }
527         console.log(maternal_parent);
529         jQuery.ajax({
530             url:'/ajax/breeders/get_accession_plots',
531             data:{'field_trial':$('#field_trial').val(),
532                   'parent_accession':maternal_parent,
533                   },
534             success: function(response){
535             console.log(response);
536             var html = '<select id = "female_plot" >';
537             for (var i=0; i<response.data.length; i++) {
538             html = html + "<option value='"+response.data[i][0]+ "'>" + response.data[i][1] + "</option>";
539             }
540             html = html + "</select>";
541             console.log(html);
543             if(i ==''){
544             alert("No plot");
545             return;
546             }
548             jQuery('#female_plot').html(html);
550             },
551             error:function(response){
552             alert("An error occurred getting female plots.");
553             }
554         });
556         var paternal_parent;
558         if ($('#paternal_parent').val() != ''){
559         paternal_parent = $('#paternal_parent').val();
560         }
562         if ($('#selfed_parent').val() != ''){
563         paternal_parent = $('#selfed_parent').val();
564         }
566         if ($('#sib_parent').val() != ''){
567         paternal_parent = $('#sib_parent').val();
568         }
570         jQuery.ajax({
571             url:'/ajax/breeders/get_accession_plots',
572             data:{'field_trial':$('#field_trial').val(),
573                   'parent_accession':paternal_parent,
574                   },
575             success: function(response){
576             console.log(response);
577             var html = '<select id = "male_plot" >';
578             for (var i=0; i<response.data.length; i++) {
579             html = html + "<option value='"+response.data[i][0]+ "'>" + response.data[i][1] + "</option>";
580             }
581             html = html + "</select>";
582             console.log(html);
584             if(i ==''){
585             alert("No plot");
586             return;
587             }
589             jQuery('#male_plot').html(html);
591             },
592         });
593     });
596 </script>