6 /breeders_toolbox/trial.mas - a mason component to display a trial detail page
20 $breeding_program_name
24 $main_production_site_url => undef
27 $trial_type_id => undef
28 $planting_date => undef
29 $show_transplanting_date => undef
30 $transplanting_date => undef
31 $harvest_date => undef
32 $trial_description => undef
33 $user_can_modify => undef
34 $has_plant_entries => undef
35 $has_subplot_entries => undef
36 $has_tissue_sample_entries => undef
37 $hidap_enabled => undef
40 $plants_per_plot => undef
41 $has_expression_atlas => undef
42 $expression_atlas_url => undef
43 $site_project_name => undef
44 $sgn_session_id => undef
47 $phenotypes_fully_uploaded => undef
48 $has_col_and_row_numbers => undef
49 $identifier_prefix => 'SGN'
53 $field_trial_is_planned_to_be_genotyped => undef
54 $field_trial_is_planned_to_cross => undef
55 $trial_stock_type => undef
56 $trial_stock_count => undef
57 $management_factor_types => ()
59 $latest_trial_activity => undef
65 <& /util/import_javascript.mas, classes => [ 'jquery.iframe-post-form', 'CXGN.Trial' , 'jstree/dist/jstree', 'CXGN.BreedersToolbox.HTMLSelect', 'moment_min', 'daterangepicker' ] &>
70 <& /page/page_title.mas, title=>"Trial detail for ".$trial_name &>
72 <& /page/detail_page_2_col_section.mas, info_section_collapsed => 0, trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>Trial Details</h4>", info_section_subtitle => 'View and edit basic information about the experiment.', buttons_html => '<button class="btn btn-primary btn-sm" id="edit_trial_details" style="margin:3px">Edit Trial Details</button>', icon_class => "glyphicon glyphicon-dashboard", info_section_id => "trial_details", trial_name => $trial_name, breeding_program_name => $breeding_program_name, breeding_program_id => $breeding_program_id, location_name => $location_name, country_name => $country_name, year => $year, trial_type => $trial_type, planting_date => $planting_date,show_transplanting_date => $show_transplanting_date, transplanting_date => $transplanting_date, harvest_date => $harvest_date, trial_description => $trial_description, plot_width => $plot_width, plot_length => $plot_length, field_size => $field_size, field_trial_is_planned_to_be_genotyped => $field_trial_is_planned_to_be_genotyped, field_trial_is_planned_to_cross => $field_trial_is_planned_to_cross, folder_name => $folder_name, folder_id => $folder_id, identifier_prefix => $identifier_prefix, trial_stock_type => $trial_stock_type, trial_stock_count => $trial_stock_count, trial_owner => $trial_owner, latest_trial_activity => $latest_trial_activity &>
74 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, trial_name => $trial_name, breeding_program_name => $breeding_program_name, location_name => $location_name, year => $year, trial_type => $trial_type, planting_date => $planting_date, show_transplanting_date => $show_transplanting_date, transplanting_date => $transplanting_date, harvest_date => $harvest_date, trial_description => $trial_description, folder_id => $folder_id, design_name => $design_name, has_plant_entries => $has_plant_entries, phenotypes_fully_uploaded => $phenotypes_fully_uploaded, user_can_modify => $user_can_modify, user_name => $user_name, info_section_title => "<h4 style='display:inline'>Trial Status</h4>", info_section_subtitle => 'View progress of this trial.', icon_class => "glyphicon glyphicon-forward", info_section_id => "trial_status_section" &>
76 % my $barcode_section_title = '';
77 % if ($trial_stock_type eq 'family_name') {
78 % $barcode_section_title = 'Generate barcode labels for plots or plants or family names in this trial.';
79 % } elsif ($trial_stock_type eq 'cross') {
80 % $barcode_section_title = 'Generate barcode labels for plots or plants or cross unique ids in this trial.';
82 % $barcode_section_title = 'Generate barcode labels for plots or plants or accessions in this trial.';
85 <div class="col-sm-6">
86 <& /page/detail_page_3_col_section.mas, icon_class => "glyphicon glyphicon-qrcode", title => $barcode_section_title, button_id => "generate_trial_barcode_link" &>
88 <div class="col-sm-6">
89 <& /page/detail_page_3_col_section.mas, icon_class => "glyphicon glyphicon-pencil", title => "Directly record phenotypes to database for this trial.", button_id => "direct_phenotyping_link" &>
93 % my $subtitle = 'View and edit the spatial layout of the experiment. Also view a heatmap for phenotyped traits.';
94 % my $layout_buttons = '';
95 % if ($has_col_and_row_numbers){
96 % $layout_buttons = '<h3><span class="glyphicon glyphicon-ok-sign text-success"></span> This experiment has spatial layout info uploaded!</h3><button class="btn btn-primary" style="margin:3px" id="edit_field_map_link">Edit Field Layout</button><button class="btn btn-primary" style="margin:3px" id="trial_fieldmap_download_layout_button">Download Spatial Layout</button> <button class="btn btn-primary" style="margin:3px" id="gps_field_map_link">Edit Geo Field Layout</button><button class="btn btn-danger" id="delete_field_map_hm_link" style="margin:3px">Delete Spatial Layout</button> <button class="btn btn-default" style="margin:3px" data-toggle="modal" data-target="#fieldmap_usage_modal">Usage Help <span class="glyphicon glyphicon-question-sign"></span></button>';
98 % $layout_buttons = '<h3><span class="glyphicon glyphicon-remove-sign text-danger"></span> This experiment does not have spatial layout info!</h3><button class="btn btn-primary" style="margin:3px" id="heatmap_upload_trial_coords_link">Upload Spatial Layout</button> <button class="btn btn-primary" style="margin:3px" id="edit_field_map_link">Edit Field Layout</button> <button class="btn btn-default" style="margin:3px" data-toggle="modal" data-target="#fieldmap_usage_modal">Usage Help <span class="glyphicon glyphicon-question-sign"></span></button>';
101 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, has_col_and_row_numbers => $has_col_and_row_numbers, info_section_title => "<h4 style='display:inline'>Field Layout Tools and Phenotype Heatmap</h4>", info_section_subtitle => $subtitle, buttons_html => $layout_buttons, icon_class => "glyphicon glyphicon-th", info_section_id => "pheno_heatmap" &>
103 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, trial_name => $trial_name, info_section_title => "<h4 style='display:inline'>Experimental Design</h4>", info_section_subtitle => 'View and add experimental design information. Add plant entries and tissue sample entries.', buttons_html => '<button class="btn btn-sm btn-primary" style="margin:3px" id="trial_download_layout_button">Download Layout</button> <button class="btn btn-sm btn-default" style="margin:3px" id="trial_upload_seedlot_button" >Upload Seedlots Planted In Trial</button> <button class="btn btn-sm btn-default" style="margin:3px" id="trial_upload_plot_gps_button" >Upload GPS Coordinates</button> <button class="btn btn-sm btn-default" style="margin:3px" id="trial_detail_page_add_treatment">Add Management Factor</button> <button class="btn btn-sm btn-default" style="margin:3px" id="update_experimental_design_type_button">Update Experimental Design Type</button> <button class="btn btn-sm btn-default" style="margin:3px" id="trial_detail_page_change_accessions">Change Accessions</button>', icon_class => "glyphicon glyphicon-list-alt", info_section_id => "trial_design_section", has_plant_entries => $has_plant_entries, has_subplot_entries => $has_subplot_entries, has_tissue_sample_entries => $has_tissue_sample_entries, trial_stock_type => $trial_stock_type &>
105 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>Phenotype Summary Statistics</h4>", info_section_subtitle => 'View and download uploaded phenotype data.', buttons_html => "<button class='btn btn-sm btn-primary' style='margin:3px' id='trial_download_phenotypes_button'>Download Trial Data</button>", icon_class => "glyphicon glyphicon-equalizer", info_section_id => "trial_detail_traits_assayed", has_expression_atlas => $has_expression_atlas, 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, trial_stock_type => $trial_stock_type &>
107 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>Phenotype Raw Data</h4>", info_section_subtitle => 'View phenotyping raw data.', info_section_id => "trial_raw_data", trial_name => $trial_name, site_project_name => $site_project_name, sgn_session_id => $sgn_session_id, user_name => $user_name, main_production_site_url => $main_production_site_url, trial_stock_type => $trial_stock_type &>
109 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>Compute New Phenotypes</h4>", info_section_subtitle => 'Compute derived traits or compute plot phenotypes from plant phenotypes.', icon_class => "glyphicon glyphicon-floppy-save", info_section_id => "compute_derived_traits" &>
111 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>Upload Data Files</h4>", info_section_subtitle => 'Phenotypic data collection using Excel or Android Fieldbook. Also upload any additional files for this trial.', icon_class => "glyphicon glyphicon-cloud-upload", info_section_id => "trial_upload_files", trial_stock_type => $trial_stock_type &>
113 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>Analysis Tools</h4>", info_section_subtitle => 'Run correlation, anova, population structure (PCA), or clustering. Also access HIDAP, if enabled on this site.', icon_class => "glyphicon glyphicon-signal", info_section_id => "trial_analysis_tools", hidap_enabled => $hidap_enabled, main_production_site_url => $main_production_site_url, breeding_program_name => $breeding_program_name, folder_name => $folder_name, trial_name => $trial_name &>
115 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>Weather Data</h4>", info_section_subtitle => 'View rainfall, temperature, light intensity and other weather data for this location.', icon_class => "glyphicon glyphicon-cloud", info_section_id => "trial_weather_data", location_name => $location_name &>
117 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>Soil Data</h4>", info_section_subtitle => 'View and upload soil data for this trial.', icon_class => "glyphicon glyphicon-info-sign", buttons_html => "<button class='btn btn-sm btn-primary' style='margin:3px' id='trial_upload_soil_data_button' >Upload Soil Data</button>", info_section_id => "trial_soil_data_section"&>
119 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>JBrowse Genome Alignments For this Experiment</h4>", info_section_subtitle => 'View JBrowse alignments for accessions in this trial.', icon_class => "glyphicon glyphicon-align-left", info_section_id => "trial_jbrowse_data" &>
121 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, trial_type => $trial_type, info_section_title => "<h4 style='display:inline'>Experiment Linkage</h4>", info_section_subtitle => 'View other experiments, crosses, and genotyping plates linked to this experiment.', icon_class => "glyphicon glyphicon-link", info_section_id => "trial_linkage_section" &>
123 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, trial_type => $trial_type, project_id => $project_id, info_section_title => "<h4 style='display:inline'>Audit Table</h4>", info_section_subtitle => 'Track audit information linked to this experiment.', icon_class => "glyphicon glyphicon-time", info_section_id => "trial_audit_table_section" &>
125 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>Delete Experiment Data</h4>", info_section_subtitle => 'Delete phenotypes, field layout, and/or the entire experiment from the database.', icon_class => "glyphicon glyphicon-trash", info_section_id => "trial_deletion_section" &>
127 % my $data_agreement_link = '<button class="btn btn-sm btn-primary" disabled style="margin:3px">Add/edit data agreement</button>';
128 % if ($user_can_modify) { $data_agreement_link = '<button class="btn btn-sm btn-primary" style="margin:3px" id="add_data_agreement">Add/edit data agreement</button>'; }
130 <& /page/detail_page_2_col_section.mas, trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>Data Agreement License</h4>", info_section_subtitle => 'View and edit the public data agreement on this experiment.', icon_class => "glyphicon glyphicon-inbox", info_section_id => "trial_data_agreement_section", buttons_html => $data_agreement_link &>
132 <& /breeders_toolbox/folder/folder_set.mas, project_type => 'field_trial', breeding_program_id => $breeding_program_id, breeding_program_name =>$breeding_program_name, trial_id => $trial_id, trial_name =>$trial_name &>
133 <& /breeders_toolbox/folder/folder_new.mas, breeding_program_id => $breeding_program_id, breeding_program_name =>$breeding_program_name, project_type => 'field_trial' &>
134 <& /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, show_transplanting_date => $show_transplanting_date, transplanting_date => $transplanting_date, harvest_date => $harvest_date, trial_description => $trial_description, field_size => $field_size, plot_width => $plot_width, plot_length => $plot_length, field_trial_is_planned_to_be_genotyped => $field_trial_is_planned_to_be_genotyped, field_trial_is_planned_to_cross => $field_trial_is_planned_to_cross &>
136 <& /breeders_toolbox/trial/generate_trial_barcode.mas, identifier => "$identifier_prefix"."$trial_id", trial_id=> "$trial_id", trial_name=> "$trial_name", trial_stock_type => $trial_stock_type &>
137 <& /breeders_toolbox/trial/download_fieldmap_dialog.mas, trial_id => $trial_id, trial_name => $trial_name &>
138 <& /breeders_toolbox/trial/edit_fieldMap.mas, trial_id => $trial_id, trial_name => $trial_name, trial_stock_type => $trial_stock_type &>
139 <& /breeders_toolbox/trial/trial_coords_upload_dialogs.mas, trial_id => $trial_id, trial_name => $trial_name &>
140 <& /breeders_toolbox/trial/download_layout_dialog.mas, trial_id => $trial_id, trial_name => $trial_name, has_subplot_entries => $has_subplot_entries &>
141 <& /breeders_toolbox/trial/add_trial_used_seedlots.mas, trial_id => $trial_id &>
142 <& /breeders_toolbox/trial/upload_plot_gps_dialogs.mas, trial_id => $trial_id &>
143 <& /breeders_toolbox/trial/add_subplots_per_plot.mas, trial_id => $trial_id, trial_name => $trial_name &>
144 <& /breeders_toolbox/trial/add_plants_per_plot.mas, trial_id => $trial_id, trial_name => $trial_name &>
145 <& /breeders_toolbox/trial/add_plants_per_subplot.mas, trial_id => $trial_id, trial_name => $trial_name &>
146 <& /breeders_toolbox/trial/add_trial_treatment_dialogs.mas, management_factor_types => $management_factor_types &>
147 <& /breeders_toolbox/trial/change_plot_accessions_dialogs.mas, trial_id => $trial_id &>
148 <& /breeders_toolbox/trial/download_phenotypes_dialog.mas, trial_ids => $trial_id, dialog_name => $trial_name, dialog_type => 'Trial' &>
149 <& /breeders_toolbox/trial/update_experimental_design_type.mas, trial_id => $trial_id, trial_name => $trial_name, design_name => $design_name &>
151 <& /breeders_toolbox/upload_phenotype_spreadsheet.mas &>
152 <& /fieldbook/upload_phenotype_fieldbook.mas &>
153 <& /breeders_toolbox/upload_phenotype_datacollector.mas &>
155 <& /breeders_toolbox/trial/create_datacollector_dialog.mas, trial_id => $trial_id, trial_name => $trial_name, trial_stock_type => $trial_stock_type &>
156 <& /fieldbook/create_fieldbook_dialog.mas, trial_id => $trial_id, trial_name => $trial_name, trial_stock_type => $trial_stock_type &>
157 <& /breeders_toolbox/trial/create_spreadsheet_dialog.mas, trial_id => $trial_id, trial_name => $trial_name, trial_stock_type => $trial_stock_type &>
158 <& /breeders_toolbox/trial/set_phenotypes_fully_uploaded.mas, trial_id => $trial_id &>
159 <& /breeders_toolbox/trial/upload_soil_data_dialogs.mas, trial_id => $trial_id, trial_name => $trial_name &>
161 <& /breeders_toolbox/add_data_agreement_dialogs.mas, trial_id => $trial_id &>
163 <div id="trialIDDiv" class="trialIDDivClass" style="display:none;">
168 <script defer="defer">
170 jQuery(document).ready(function () {
172 var can_modify = '<% $user_can_modify %>';
173 // alert('can modify: '+can_modify);
174 if (can_modify === '0') {
175 jQuery('#edit_trial_details').prop('disabled', true);
178 jQuery('#edit_trial_details').click(function(){
180 jQuery('#trial_details_edit_dialog').modal("show");
182 edit_trial_details();
186 trial_detail_page_setup_dialogs();
188 jQuery('#delete_breeding_program_trial_association_link').click(
190 var trial_id = get_trial_id();
192 var yes = confirm("Do you really want to remove this trial from the breeding program?");
195 url: '/breeders/program/remove/<% $breeding_program_id %>/'+trial_id,
198 success: function(response) {
204 jQuery('#custom_barcode').click(function () {
205 location.href = '/tools/label_designer';
208 jQuery('#direct_phenotyping_link').click(function () {
209 var id = <% $trial_id %>;
210 location.href = '/breeders/trial_phenotyping?trial_id=' + id + '';
213 jQuery('#gps_field_map_link').click(function () {
214 var id = <% $trial_id %>;
215 window.open('/tools/fieldmap?trial_id=' + id ,'_blank');