6 /breeders_toolbox/trial.mas - a mason component to display a trial detail page
20 $breeding_program_name
25 $trial_type_id => undef
26 $planting_date => undef
27 $harvest_date => undef
28 $trial_description => undef
29 $user_can_modify => undef
30 $has_plant_entries => undef
31 $has_subplot_entries => undef
32 $hidap_enabled => undef
35 $plants_per_plot => undef
36 $has_expression_atlas => undef
37 $expression_atlas_url => undef
38 $site_project_name => undef
39 $trial_phenotype_files => undef
40 $sgn_session_id => undef
43 $phenotypes_fully_uploaded => undef
44 $assayed_traits => undef
45 $identifier_prefix => 'SGN'
46 $main_production_site_url
51 @media (min-width: 1200px) {
61 <& /util/import_javascript.mas, classes => [ 'jquery.iframe-post-form', 'CXGN.Trial' , 'jstree/dist/jstree', 'CXGN.BreedersToolbox.HTMLSelect', 'moment_min', 'daterangepicker' ] &>
65 my $start_time = time();
67 #print STDERR "Check 7 (mason) : ".(time() - $start_time)."\n";
74 <& /page/page_title.mas, title=>"Trial detail for ".$trial_name &>
76 <&| /page/info_section.mas, title=>"Trial details", collapsible => 1, subtitle => '[<a id="edit_trial_details">Edit Trial Details</a>]'&>
79 <div class="panel panel-default">
80 <table class="table table-hover" >
83 <td><b>Trial Name</b></td>
87 % print "$trial_name";
89 % print "[No Trial Name]";
96 <td><b>Breeding Program </b></td>
98 <span id="breeding_program">
99 % if ($breeding_program_name) {
100 % print "$breeding_program_name";
103 % print "No Breeding Program";
110 <td><b>Trial Location</b></td>
112 <div id="trial_location">
113 % if ($location_name) {
114 % print "$location_name";
116 % print "[No Location]";
125 <div id="trial_year">
136 <td><b>Trial Type</b></td>
138 <div id="trial_type">
140 % print "$trial_type";
142 % print "[Type not set]";
149 <td><b>Planting Date</b></td>
151 <div id="planting_date">
152 % if ($planting_date) {
153 <a href="/breeders/trial/<% $trial_id %>?currentDate=<% $planting_date %>" ><% $planting_date %></a>
155 % print "[No Planting Date]";
162 <td><b>Harvest Date</b></td>
164 <div id="harvest_date">
165 % if ($harvest_date) {
166 <a href="/breeders/trial/<% $trial_id %>?currentDate=<% $harvest_date %>" ><% $harvest_date %></a>
168 % print "[No Harvest Date]";
174 <tr><td><b>Description</b></td>
176 <div id="trial_description">
177 % if ($trial_description) {
178 % print "$trial_description";
180 % print "[No Description]";
188 % my $folder_collapsed = 1;
190 % $folder_collapsed = 0;
193 <div class="well well-sm">
195 <&| /page/info_section.mas, title=>"Folder", collaspible=>1, collapsed=>$folder_collapsed,
196 subtitle => '[<a id="new_folder_dialog_link">New Folder</a>] | [<a id="open_folder_dialog_link">Change</a>]' &>
198 <& /breeders_toolbox/folder/folder_set.mas, breeding_program_id => $breeding_program_id, breeding_program_name =>$breeding_program_name, trial_id => $trial_id, trial_name =>$trial_name &>
199 <& /breeders_toolbox/folder/folder_new.mas, breeding_program_id => $breeding_program_id, breeding_program_name =>$breeding_program_name &>
201 <span id="trial_folder_div"><a href="/folder/<% $folder_id %>"><% $folder_name %></a></span>
205 </div><!--closes well-->
209 <&| /page/info_section.mas, title=>"Trial barcode", collapsible => 1, subtitle => '[<a id="generate_trial_barcode_link">Generate Barcode</a>]|[<a id="direct_phenotyping_link">Direct Phenotyping</a>]'&>
211 <center><& /util/barcode.mas, identifier => "$identifier_prefix"."$trial_id", trial_id=> "$trial_id", trial_name=> "$trial_name", format=>"trial_qrcode" &></center><br />
213 <& /breeders_toolbox/trial/generate_trial_barcode.mas, identifier => "$identifier_prefix"."$trial_id", trial_id=> "$trial_id", trial_name=> "$trial_name" &>
217 <& /breeders_toolbox/trial/edit_trial_details_dialog.mas, trial_name => $trial_name, breeding_program => $breeding_program_id, location => $location_id, year => $year, trial_type => $trial_type, trial_type_id => $trial_type_id, planting_date => $planting_date, harvest_date => $harvest_date, trial_description => $trial_description &>
219 % if ($hidap_enabled) {
221 <& /hidap/hidap_trial_link.mas, trial_id => $trial_id &>
225 <& /breeders_toolbox/trial/edit_fieldMap.mas, trial_id => $trial_id, trial_name => $trial_name &>
226 <&| /page/info_section.mas, id => "physical_layout", title=>"Physical Trial Layout", collapsible=>1, collapsed => 1, subtitle=>'[<a id="upload_trial_coords_link">Upload trial coordinates</a>] [<a id="edit_field_map_link">Edit Field Map</a>] [<button type="button" class="btn btn-link" data-toggle="modal" data-target="#fieldmap_usage_modal">Usage Help <span class="glyphicon glyphicon-question-sign"></span></button>]' &>
228 <& /breeders_toolbox/trial/trial_coords.mas, trial_id => $trial_id &>
232 <& /breeders_toolbox/trial/trial_coords_upload_dialogs.mas, trial_id => $trial_id, trial_name => $trial_name &>
242 /* prevent horizontal scrollbar */
250 <& /breeders_toolbox/trial/download_layout_dialog.mas, trial_id => $trial_id, trial_name => $trial_name, has_subplot_entries => $has_subplot_entries &>
252 <&| /page/info_section.mas, id => "trial_design_section", title=>"Design", collapsible=>1, collapsed=>0, subtitle=>"[<a id='trial_download_layout_button'>Download Layout</a>]" &>
254 <div class="well well-sm">
256 <& /breeders_toolbox/trial/design.mas, trial_id => $trial_id &>
258 <&| /page/info_section.mas, id => "trial_accessions", title=>"Accessions", is_subsection => 1, collapsible=>1, collapsed=>1 &>
260 <& /breeders_toolbox/trial/trial_accessions.mas, trial_id => $trial_id &>
264 <& /breeders_toolbox/trial/add_trial_used_seedlots.mas, trial_id => $trial_id &>
265 <&| /page/info_section.mas, id => "trial_seedlots", title=>"Seedlots", is_subsection => 1, collapsible=>1, collapsed=>1, subtitle=>"[<a id='trial_upload_seedlot_button' >Upload Seedlots Planted In Trial</a>]" &>
267 <& /breeders_toolbox/trial/trial_seedlots.mas, trial_id => $trial_id &>
272 <&| /page/info_section.mas, id => "trial_controls", title=>"Controls", is_subsection => 1, collapsible=>1, collapsed=>1 &>
274 <& /breeders_toolbox/trial/trial_controls.mas, trial_id => $trial_id &>
278 <& /breeders_toolbox/trial/upload_plot_gps_dialogs.mas, trial_id => $trial_id &>
279 <&| /page/info_section.mas, id => "trial_plots", title=>"Plots", is_subsection => 1, collapsible=>1, collapsed=>1, subtitle=>"[<a id='trial_upload_plot_gps_button' >Upload GPS Coordinates</a>]" &>
281 <& /breeders_toolbox/trial/trial_plots.mas, trial_id => $trial_id &>
285 % if ($has_subplot_entries) {
287 <&| /page/info_section.mas, id => "trial_subplots", title=>"Subplots", is_subsection => 1, collapsible=>1, collapsed=>1 &>
289 <& /breeders_toolbox/trial/trial_subplots.mas, trial_id => $trial_id &>
295 <&| /page/info_section.mas, id => "trial_plants", title=>"Plant Entries", is_subsection => 1, collapsible=> 1, collapsed=>1 &>
297 <div id="plant_entries_section">
299 % if (!$has_plant_entries) {
300 <button class="btn btn-default" id="create_plant_entries_button">Add plant entries</button>
301 <button class="btn btn-default" id="upload_plant_entries_button">Upload plant entries</button>
302 <& /breeders_toolbox/trial/add_plants_per_plot.mas, trial_id => $trial_id, trial_name => $trial_name &>
306 <& /breeders_toolbox/trial/trial_plants.mas, trial_id => $trial_id &>
310 </div><!--closes plant_entries_section -->
314 <& /breeders_toolbox/trial/add_trial_treatment_dialogs.mas &>
315 <&| /page/info_section.mas, id => "trial_treatments", title=>"Field Management Factors", is_subsection => 1, collapsible=>1, collapsed=>1, subtitle=>"[<a id='trial_detail_page_add_treatment'>Add Management Factor</a>]" &>
317 <& /breeders_toolbox/trial/trial_treatments.mas, trial_id => $trial_id &>
321 </div><!-- closes well -->
325 <& /breeders_toolbox/trial/download_phenotypes_dialog.mas, trial_ids => $trial_id, dialog_name => $trial_name, dialog_type => 'Trial' &>
327 <&| /page/info_section.mas,
328 title => 'Weather at Trial Location',
332 <& /breeders_toolbox/trial/weather.mas, location => $location_name &>
336 % my $download_pheno_subtitle;
337 % if (scalar(@$assayed_traits) > 0){
338 % $download_pheno_subtitle = "[<a id='trial_download_phenotypes_button'>Download Trial Data</a>]"
341 % $download_pheno_subtitle = "Trial has no phenotype for download";
344 <&| /page/info_section.mas, id=> "trial_detail_traits_assayed", title => "Traits assayed", collapsible=>1, collapsed=>1, hide_if_empty=>1, subtitle=> $download_pheno_subtitle &>
346 % if ($has_expression_atlas) {
347 <& /breeders_toolbox/trial/export_trial_to_expression_atlas.mas, trial_id => $trial_id, trial_name=>$trial_name, expression_atlas_url=>$expression_atlas_url, site_project_name=>$site_project_name, sgn_session_id=>$sgn_session_id, user_name=>$user_name, main_production_site_url=>$main_production_site_url &>
350 <& /breeders_toolbox/trial/phenotype_summary.mas, trial_id => $trial_id &>
354 <&| /page/info_section.mas, id => "pheno_heatmap", title=>"Phenotype Heatmap", collapsible=>1, collapsed => 1 &>
356 <& /breeders_toolbox/trial/phenotype_heatmap.mas, trial_id => $trial_id &>
360 <&| /page/info_section.mas, id=> "compute_derived_traits", title=>'Compute Trait Phenotypes', collapsible=>1, collapsed=>1, &>
362 <& /breeders_toolbox/trial/derived_trait.mas, trial_id => $trial_id &>
368 <&| /page/info_section.mas,
369 title => 'Trial JBrowse',
373 <& /breeders_toolbox/trial/jbrowse_instance.mas, trial_id => $trial_id &>
377 <&| /page/info_section.mas, title=>"Files", collapsible=>1, collapsed=>0 &>
379 <div class="well well-sm">
381 <div class="panel panel-default">
382 <div class="panel-body">
383 <&| /page/info_section.mas, title=>"Data Collection Files", is_subsection => 1, collapsible=>1, collapsed=>0, &>
384 <&| /page/info_section.mas, title=>"Phenotyping Spreadsheets", empty_message=>'', is_subsection => 1, collapsible=>0, collapsed=>0, subtitle=>'[<a name="create_spreadsheet_link">Create Spreadsheet</a>]' &>
386 <&| /page/info_section.mas, title=>"Android Field Book Layout", empty_message=>'', is_subsection => 1, collapsible=>0, collapsed=>0, subtitle=>'[<a name="create_fieldbook_link">Create Field Book</a>]' &>
388 <&| /page/info_section.mas, title=>"Data Collector Spreadsheet", empty_message=>'', is_subsection => 1, collapsible=>0, collapsed=>0, subtitle=> '[<a id="create_DataCollector_link">Create DataCollector Spreadsheet</a>]' &>
390 </&><!-- closes create new phenotyping file section -->
393 <div class="panel panel-default">
394 <div class="panel-body">
395 <&| /page/info_section.mas, title=>"Upload Phenotyping Files", is_subsection => 1, collapsible=>1, collapsed=>0, &>
396 <&| /page/info_section.mas, title=>"Phenotyping Spreadsheets", empty_message=>'', is_subsection => 1, collapsible=>0, collapsed=>0, subtitle=>'[<a id="upload_spreadsheet_phenotypes_link">Upload</a>]'&>
398 <&| /page/info_section.mas, title=>"Android Field Book Exported", empty_message=>'', is_subsection => 1, collapsible=>0, collapsed=>0, subtitle=>'[<a id="upload_fieldbook_phenotypes_link">Upload</a>]'&>
400 <&| /page/info_section.mas, title=>"Data Collector Spreadsheet", empty_message=>'', is_subsection => 1, collapsible=>0, collapsed=>0, subtitle=>'[<a id="upload_datacollector_phenotypes_link">Upload</a>]'&>
402 </&><!-- closes upload new phenotype file section -->
405 <div class="panel panel-default">
406 <div class="panel-body">
407 <&| /page/info_section.mas, title=>"Uploaded Phenotyping Files", is_subsection => 1, collapsible=>1, collapsed=>0, subtitle=>'[<a id="trial_set_phenotypes_fully_link">Phenotypes Fully Uploaded?</a>]' &>
409 <table class="table table-bordered files_datatables" alt="">
411 <tr><th>Filename</th><th>Date Uploaded</th><th>Uploaded By</th><th>File Type</th><th>Options</th></tr>
414 % foreach my $f (@$trial_phenotype_files) {
416 <td><% $f->[4] %></td>
417 <td><% $f->[1] %></td>
418 <td><a href="/solpeople/profile/<% $f->[2] %>"><% $f->[3] %></a></td>
419 <td><% $f->[6] %></td>
420 <td><a href="/breeders/phenotyping/view/<% $f->[0] %>">View</a> | <a href="/breeders/phenotyping/download/<% $f->[0] %>">Download</a></td>
426 </&><!-- closes uploaded file section -->
429 <div class="panel panel-default">
430 <div class="panel-body">
431 <&| /page/info_section.mas, title=>"Uploaded Additional Files", is_subsection => 1, collapsible=>1, collapsed=>0, subtitle=>'[<a id="trial_upload_additional_files_link">Upload Additional Files</a>]' &>
433 <& /breeders_toolbox/trial/upload_additional_file.mas, trial_id => $trial_id &>
435 </&><!-- closes uploaded additional file section -->
439 </div><!-- closes well -->
441 </&><!-- closes entire phenotyping file section -->
443 <& /breeders_toolbox/upload_phenotype_spreadsheet.mas &>
444 <& /fieldbook/upload_phenotype_fieldbook.mas &>
445 <& /breeders_toolbox/upload_phenotype_datacollector.mas &>
447 <& /breeders_toolbox/trial/create_datacollector_dialog.mas, trial_id => $trial_id, trial_name => $trial_name &>
448 <& /fieldbook/create_fieldbook_dialog.mas, trial_id => $trial_id, trial_name => $trial_name &>
449 <& /breeders_toolbox/trial/create_spreadsheet_dialog.mas, trial_id => $trial_id, trial_name => $trial_name &>
451 <& /breeders_toolbox/trial/set_phenotypes_fully_uploaded.mas, trial_id => $trial_id &>
453 % my $data_agreement_link = "Add/edit data agreement";
454 % if ($user_can_modify) { $data_agreement_link = '[<a id="add_data_agreement">Add/edit data agreement</a>]'; }
455 <&| /page/info_section.mas, title=>"Data Agreement", is_subsection => 0, collapsible=>1, collapsed=>0, subtitle=> $data_agreement_link &>
457 <& /breeders_toolbox/data_agreement.mas, trial_id => $trial_id &>
461 <&| /page/info_section.mas, title=>'Delete trial data', subtitle=>'<font color="red" role="">Deletion cannot be undone</font>', collapsed=>1, collapsible=>1 &>
462 <& /breeders_toolbox/trial/trial_deletion.mas, trial_id => $trial_id &>
466 % #print STDERR "Check 9 (mason) : ".(time() - $start_time)."\n";
468 <!-- Phenotypic correlation analysis -->
469 <& /solgs/population/correlation.mas,
470 trial_id => $trial_id
473 <!-- Population structure analysis -- PCA -->
474 <& /solgs/model/pca.mas,
475 trial_id => $trial_id
478 % #print STDERR "Check 10 (mason) : ".(time() - $start_time)."\n";
480 <div id="trialIDDiv" class="trialIDDivClass" style="display:none;">
484 <div data-spy="affix" data-offset-top="0" style="max-height: 100%; overflow-y: auto;">
485 <div class="panel panel-info">
486 <div class="panel-heading">Completion</div>
487 <div class="panel-body">
489 <&| /page/info_section.mas, title=>"Trial Info", collapsible=>1, collapsed=>0 &>
491 <p class="text-success" title="This trial has a name saved. You can view and edit this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Trial Name </small><span class="glyphicon glyphicon-ok-sign"></span></p>
493 <p class="text-danger" title="This trial does not have a name. Please add this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Trial Name </small><span class="glyphicon glyphicon-remove-sign"></span></p>
495 % if ($breeding_program_name) {
496 <p class="text-success" title="This trial has a breeding program saved. You can view and edit this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Breeding Program </small><span class="glyphicon glyphicon-ok-sign"></span></p>
498 <p class="text-danger" title="This trial does not have a breeding program. Please add this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Breeding Program </small><span class="glyphicon glyphicon-remove-sign"></span></p>
500 % if ($location_name) {
501 <p class="text-success" title="This trial has a location saved. You can view and edit this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Location </small><span class="glyphicon glyphicon-ok-sign"></span></p>
503 <p class="text-danger" title="This trial does not have a location. Please add this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Location </small><span class="glyphicon glyphicon-remove-sign"></span></p>
506 <p class="text-success" title="This trial has a year saved. You can view and edit this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Year </small><span class="glyphicon glyphicon-ok-sign"></span></p>
508 <p class="text-danger" title="This trial does not have a year. Please add this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Year </small><span class="glyphicon glyphicon-remove-sign"></span></p>
511 <p class="text-success" title="This trial has a trial type saved. You can view and edit this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Trial Type </small><span class="glyphicon glyphicon-ok-sign"></span></p>
513 <p class="text-danger" title="This trial does not have a trial type. Please add this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Trial Type </small><span class="glyphicon glyphicon-remove-sign"></span></p>
515 % if ($planting_date) {
516 <p class="text-success" title="This trial has a planting date saved. You can view and edit this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Planting Date </small><span class="glyphicon glyphicon-ok-sign"></span></p>
518 <p class="text-danger" title="This trial does not have a planting date. Please add this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Planting Date </small><span class="glyphicon glyphicon-remove-sign"></span></p>
520 % if ($harvest_date) {
521 <p class="text-success" title="This trial has a harvest date saved. You can view and edit this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Harvest Date </small><span class="glyphicon glyphicon-ok-sign"></span></p>
523 <p class="text-danger" title="This trial does not have a harvest date. Please add this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Harvest Date </small><span class="glyphicon glyphicon-remove-sign"></span></p>
525 % if ($trial_description) {
526 <p class="text-success" title="This trial has a description saved. You can view and edit this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Description </small><span class="glyphicon glyphicon-ok-sign"></span></p>
528 <p class="text-danger" title="This trial does not have a description. Please add this information by clicking [Edit Trial Details] in the Trial Detail section on this page."><small>Description </small><span class="glyphicon glyphicon-remove-sign"></span></p>
531 <p class="text-success" title="This trial is saved in a folder or breeding program. You can change this by clicking [Change] in the Folder section on this page."><small>In Folder </small><span class="glyphicon glyphicon-ok-sign"></span></p>
533 <p class="text-info" title="This trial is not in a folder! If this happens please contact us because this should not happen. A trial should always be in a folder or breeding program."><small>Not In Folder </small><span class="glyphicon glyphicon-info-sign"></span></p>
537 <&| /page/info_section.mas, id=>"trial_completion_layout_section", title=>"Field Design", collapsible=>1, collapsed=>1 &>
538 % if ($design_name) {
539 <p class="text-success" title="This trial has a design type saved. You can view and download this information in the Design section on this page."><small>Has Field Design </small><span class="glyphicon glyphicon-ok-sign"></span></p>
541 <p class="text-danger" title="This trial does not have a design type saved! If this happens please contact us because this should not happen!"><small>No Field Design </small><span class="glyphicon glyphicon-remove-sign"></span></p>
544 <div id="trial_completion_layout_section_div">
545 <div class="well well-sm">LOADING...</div>
548 % if ($has_plant_entries) {
549 <p class="text-success" title="This trial has plot and plant entries saved. This means that phenotypes can be recorded on the plot and plant level."><small>Has Plots<br/>And Plants </small><span class="glyphicon glyphicon-ok-sign"></span></p>
551 <p class="text-info" title="This trial has plot entries saved, but no plant entries. Plant entries are needed for plant level phenotyping. You can create plant entries in Design->Plant Entries section on this page."><small>Has Plots<br/>No Plants </small><span class="glyphicon glyphicon-info-sign"></span></p>
555 <&| /page/info_section.mas, id=>"trial_completion_phenotype_section", title=>"Phenotyping", collapsible=>1, collapsed=>1 &>
557 <div id="trial_completion_phenotype_section_div">
558 <div class="well well-sm">LOADING...</div>
561 % if ($phenotypes_fully_uploaded) {
562 <p class="text-success" title="All recorded phenotypes for this trial are saved in the database. You can change this by clicking [Phenotypes Fully Uploaded?] in the Files section on this page."><small>Phenotyping<br/>Complete </small><span class="glyphicon glyphicon-ok-sign"></span></p>
564 <p class="text-info" title="Once phenotypes are fully uploaded for a trial, you can click [Phenotypes Fully Uploaded?] in the Files section on this page."><small>Phenotyping<br/>Incomplete </small><span class="glyphicon glyphicon-info-sign"></span></p>
572 <script defer="defer">
574 jQuery(document).ready(function () {
576 trial_detail_page_setup_dialogs();
578 jQuery('#delete_breeding_program_trial_association_link').click(
580 var trial_id = get_trial_id();
582 var yes = confirm("Do you really want to remove this trial from the breeding program?");
585 url: '/breeders/program/remove/<% $breeding_program_id %>/'+trial_id,
588 success: function(response) {
594 jQuery('#trial_completion_layout_section_onswitch').click( function() {
596 url : '/ajax/breeders/trial/'+ <% $trial_id %> + '/trial_completion_layout_section',
597 success: function(response){
599 if (response.has_layout == 1){
600 html += '<p class="text-success" title="This trial has plots and their layout information saved in the database. All relationships between accessions, plots, seedlots, plants, and subplots are consistent. You can view and download this information in the Design section on this page."><small>Has Field Layout </small><span class="glyphicon glyphicon-ok-sign"></span></p>';
602 html += '<p class="text-danger" title="There is something wrong with the layout! If this occurs please contact us because this should not occur! (click here for more info)"><span id="layout_error_button"><small>Bad Field Layout </small><span class="glyphicon glyphicon-remove-sign"></span></span></p>';
604 if (response.has_physical_map == 1){
605 html += '<p class="text-success" title="This trial has a physical map saved. You can view and edit the physical map in the Physical Trial Layout section on this page."><small>Has Physial Map </small><span class="glyphicon glyphicon-ok-sign"></span></p>';
607 html += '<p class="text-info" title="This trial does not have physical map information. This means the map will not appear in the Physical Trial Layout section. You can add physical map info by clicking [Upload Trial Coordinates] in the Physical Trial Layout section on this page. (click here for more info)"><span id="physical_map_error_button"><small>No Physical Map </small><span class="glyphicon glyphicon-info-sign"></span></span></p>';
609 if (response.has_seedlots == 1){
610 html += '<p class="text-success" title="This trial has seedlots linked to plots (and the accessions are in sync). This allows us to track breeding material on the seedlots detail page. You can view this data and navigate to the seedlots on the Design section of this page."><small>Has Seedlots </small><span class="glyphicon glyphicon-ok-sign"></span></p>';
612 html += '<p class="text-info" title="This trial does not have seedlots saved. This means we cannot track your breeding material using seedlots. You can upload this information by clicking [Upload Seedlots Planted in Trial] in the Design section on this page. (click here for more info)"><span id="seedlot_error_button"><small>No Seedlot Info </small><span class="glyphicon glyphicon-info-sign"></span></span></p>';
614 jQuery(document).on('click', 'span[id="layout_error_button"]', function(){
615 alert(response.layout_errors);
617 jQuery(document).on('click', 'span[id="physical_map_error_button"]', function(){
618 alert(response.physical_map_errors);
620 jQuery(document).on('click', 'span[id="seedlot_error_button"]', function(){
621 alert(response.seedlot_errors);
623 jQuery('#trial_completion_layout_section_div').html(html);
625 error: function(response){
626 alert('Error retrieving trial completion layout section');
632 jQuery('#trial_completion_phenotype_section_onswitch').click( function() {
634 url : '/ajax/breeders/trial/'+ <% $trial_id %> + '/trial_completion_phenotype_section',
635 success: function(response){
637 if (response.has_phenotypes == 1){
638 html = '<p class="text-success" title="This trial has phenotypes saved. You can view and download this data in the Traits Assayed section on this page."><small>Has Phenotypes </small><span class="glyphicon glyphicon-ok-sign"></span></p>';
640 html = '<p class="text-info" title="This trial does not have any phenotypes stored. You can upload phenotypes in the Files section on this page."><small>No Phenotypes </small><span class="glyphicon glyphicon-info-sign"></span></p>';
642 jQuery('#trial_completion_phenotype_section_div').html(html);
644 error: function(response){
645 alert('Error retrieving trial completion phenotype section');
651 jQuery('#direct_phenotyping_link').click(function () {
652 var id = <% $trial_id %>;
653 location.href = '/breeders/trial_phenotyping?trial_id=' + id + '';