package SGN::View::Mason::Commands;
use strict;
use vars qw($m $c);
HTML::Mason::Component::FileBased->new(
'code' => sub {
use utf8; local $SGN::View::Mason::Commands::m = $HTML::Mason::Commands::m;
HTML::Mason::Exception::Params->throw
    ( error =>
      "Odd number of parameters passed to component expecting name/value pairs"
    ) if @_ % 2;
my ( $trial_id, $trial_name, $breeding_program_id, $breeding_program_name, $location_id, $location_name, $country_name, $main_production_site_url, $year, $trial_type, $trial_type_id, $planting_date, $show_transplanting_date, $transplanting_date, $harvest_date, $trial_description, $user_can_modify, $has_plant_entries, $has_subplot_entries, $has_tissue_sample_entries, $hidap_enabled, $folder_name, $folder_id, $plants_per_plot, $has_expression_atlas, $expression_atlas_url, $site_project_name, $sgn_session_id, $user_name, $design_name, $phenotypes_fully_uploaded, $has_col_and_row_numbers, $identifier_prefix, $plot_width, $plot_length, $field_size, $field_trial_is_planned_to_be_genotyped, $field_trial_is_planned_to_cross, $trial_stock_type, $trial_stock_count, $management_factor_types, $trial_owner, $latest_trial_activity, $stock_id, $stockref, $project_id );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( trial_id trial_name breeding_program_id breeding_program_name location_id location_name ) )
    {
        HTML::Mason::Exception::Params->throw
            ( error => "no value sent for required parameter '$arg'" )
                unless exists $pos{$arg};
    }
#line 19 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
    $trial_id = $_[ $pos{'trial_id'} ];
#line 20 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
    $trial_name = $_[ $pos{'trial_name'} ];
#line 21 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
    $breeding_program_id = $_[ $pos{'breeding_program_id'} ];
#line 22 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
    $breeding_program_name = $_[ $pos{'breeding_program_name'} ];
#line 23 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
    $location_id = $_[ $pos{'location_id'} ];
#line 24 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
    $location_name = $_[ $pos{'location_name'} ];
#line 25 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $country_name = exists $pos{'country_name'} ? $_[ $pos{'country_name'} ] :  "";
#line 26 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $main_production_site_url = exists $pos{'main_production_site_url'} ? $_[ $pos{'main_production_site_url'} ] :  undef;
#line 27 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $year = exists $pos{'year'} ? $_[ $pos{'year'} ] :  undef;
#line 28 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $trial_type = exists $pos{'trial_type'} ? $_[ $pos{'trial_type'} ] :  undef;
#line 29 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $trial_type_id = exists $pos{'trial_type_id'} ? $_[ $pos{'trial_type_id'} ] :  undef;
#line 30 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $planting_date = exists $pos{'planting_date'} ? $_[ $pos{'planting_date'} ] :  undef;
#line 31 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $show_transplanting_date = exists $pos{'show_transplanting_date'} ? $_[ $pos{'show_transplanting_date'} ] :  undef;
#line 32 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $transplanting_date = exists $pos{'transplanting_date'} ? $_[ $pos{'transplanting_date'} ] :  undef;
#line 33 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $harvest_date = exists $pos{'harvest_date'} ? $_[ $pos{'harvest_date'} ] :  undef;
#line 34 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $trial_description = exists $pos{'trial_description'} ? $_[ $pos{'trial_description'} ] :  undef;
#line 35 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $user_can_modify = exists $pos{'user_can_modify'} ? $_[ $pos{'user_can_modify'} ] :  undef;
#line 36 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $has_plant_entries = exists $pos{'has_plant_entries'} ? $_[ $pos{'has_plant_entries'} ] :  undef;
#line 37 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $has_subplot_entries = exists $pos{'has_subplot_entries'} ? $_[ $pos{'has_subplot_entries'} ] :  undef;
#line 38 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $has_tissue_sample_entries = exists $pos{'has_tissue_sample_entries'} ? $_[ $pos{'has_tissue_sample_entries'} ] :  undef;
#line 39 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $hidap_enabled = exists $pos{'hidap_enabled'} ? $_[ $pos{'hidap_enabled'} ] :  undef;
#line 40 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $folder_name = exists $pos{'folder_name'} ? $_[ $pos{'folder_name'} ] :  undef;
#line 41 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $folder_id = exists $pos{'folder_id'} ? $_[ $pos{'folder_id'} ] :  undef;
#line 42 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $plants_per_plot = exists $pos{'plants_per_plot'} ? $_[ $pos{'plants_per_plot'} ] :  undef;
#line 43 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $has_expression_atlas = exists $pos{'has_expression_atlas'} ? $_[ $pos{'has_expression_atlas'} ] :  undef;
#line 44 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $expression_atlas_url = exists $pos{'expression_atlas_url'} ? $_[ $pos{'expression_atlas_url'} ] :  undef;
#line 45 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $site_project_name = exists $pos{'site_project_name'} ? $_[ $pos{'site_project_name'} ] :  undef;
#line 46 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $sgn_session_id = exists $pos{'sgn_session_id'} ? $_[ $pos{'sgn_session_id'} ] :  undef;
#line 47 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $user_name = exists $pos{'user_name'} ? $_[ $pos{'user_name'} ] :  undef;
#line 48 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $design_name = exists $pos{'design_name'} ? $_[ $pos{'design_name'} ] :  undef;
#line 49 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $phenotypes_fully_uploaded = exists $pos{'phenotypes_fully_uploaded'} ? $_[ $pos{'phenotypes_fully_uploaded'} ] :  undef;
#line 50 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $has_col_and_row_numbers = exists $pos{'has_col_and_row_numbers'} ? $_[ $pos{'has_col_and_row_numbers'} ] :  undef;
#line 51 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $identifier_prefix = exists $pos{'identifier_prefix'} ? $_[ $pos{'identifier_prefix'} ] :  'SGN';
#line 52 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $plot_width = exists $pos{'plot_width'} ? $_[ $pos{'plot_width'} ] :  undef;
#line 53 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $plot_length = exists $pos{'plot_length'} ? $_[ $pos{'plot_length'} ] :  undef;
#line 54 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $field_size = exists $pos{'field_size'} ? $_[ $pos{'field_size'} ] :  undef;
#line 55 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $field_trial_is_planned_to_be_genotyped = exists $pos{'field_trial_is_planned_to_be_genotyped'} ? $_[ $pos{'field_trial_is_planned_to_be_genotyped'} ] :  undef;
#line 56 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $field_trial_is_planned_to_cross = exists $pos{'field_trial_is_planned_to_cross'} ? $_[ $pos{'field_trial_is_planned_to_cross'} ] :  undef;
#line 57 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $trial_stock_type = exists $pos{'trial_stock_type'} ? $_[ $pos{'trial_stock_type'} ] :  undef;
#line 58 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $trial_stock_count = exists $pos{'trial_stock_count'} ? $_[ $pos{'trial_stock_count'} ] :  undef;
#line 59 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $management_factor_types = exists $pos{'management_factor_types'} ? $_[ $pos{'management_factor_types'} ] :  ();
#line 60 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $trial_owner = exists $pos{'trial_owner'} ? $_[ $pos{'trial_owner'} ] :  undef;
#line 61 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $latest_trial_activity = exists $pos{'latest_trial_activity'} ? $_[ $pos{'latest_trial_activity'} ] :  undef;
#line 62 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $stock_id = exists $pos{'stock_id'} ? $_[ $pos{'stock_id'} ] :  undef;
#line 63 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $stockref = exists $pos{'stockref'} ? $_[ $pos{'stockref'} ] :  undef;
#line 66 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
     $project_id = exists $pos{'project_id'} ? $_[ $pos{'project_id'} ] :  undef;
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 17 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 68 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 69 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/util/import_javascript.mas', classes => [ 'jquery.iframe-post-form', 'CXGN.Trial' , 'jstree/dist/jstree', 'CXGN.BreedersToolbox.HTMLSelect', 'moment_min', 'daterangepicker' ]   
); #line 69 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '



<br/>

' );
#line 75 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/page/page_title.mas', title=>"Trial detail for ".$trial_name   
); #line 75 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 77 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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   
); #line 77 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 79 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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"   
); #line 79 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 81 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
 my $barcode_section_title = '';
 if ($trial_stock_type eq 'family_name') {
     $barcode_section_title = 'Generate barcode labels for plots or plants or family names in this trial.';
 } elsif ($trial_stock_type eq 'cross') {
     $barcode_section_title = 'Generate barcode labels for plots or plants or cross unique ids in this trial.';
 } else {
     $barcode_section_title = 'Generate barcode labels for plots or plants or accessions in this trial.';
 }
$m->print( '
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.11.2/b-2.0.1/b-html5-2.0.1/b-print-2.0.1/fc-4.1.2/fh-3.1.9/r-2.2.9/sp-1.4.0/sl-1.3.3/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.11.2/b-2.0.1/b-html5-2.0.1/b-print-2.0.1/fc-4.1.2/fh-3.1.9/r-2.2.9/sp-1.4.0/sl-1.3.3/datatables.min.js"></script>
<script  src="https://cdn.datatables.net/buttons/2.3.2/js/dataTables.buttons.min.js"></script>
<script  src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.print.min.js"></script>
<script  src="https://cdn.datatables.net/select/1.5.0/js/dataTables.select.min.js"></script>
<script  src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script  src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script  src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script  src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.html5.min.js"></script>

<div class="row">
    <div class="col-sm-6">
        ' );
#line 102 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/page/detail_page_3_col_section.mas', icon_class => "glyphicon glyphicon-qrcode", title => $barcode_section_title, label_design_btn_id => "label_designer_link", legacy_barcode_btn_id => "generate_trial_barcode_link"   
); #line 102 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
    </div>
    <div class="col-sm-6">
        ' );
#line 105 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/page/detail_page_3_col_section.mas', icon_class => "glyphicon glyphicon-pencil", title => "Directly record phenotypes to database for this trial.", go_btn_id => "direct_phenotyping_link"   
); #line 105 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
    </div>
</div>

<div class="modal fade" id="calculate_spatial_correction_dialog" name="calculate_spatial_correction_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadLocationsDialog">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="calculate_spatial_correction_title">Calculate Spatial Correction</h4>
      </div>
      <div class="modal-body">
      <div class="container-fluid">
        ' );
#line 118 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp( { content => sub {
#line 118 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
          ' );
#line 119 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp( { content => sub {
#line 119 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
            ' );
#line 120 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/page/page_title.mas', title=>"Check data quality before running spatial analysis"   
); #line 120 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
              <div class="container-fluid">
                <p>To proceed, check presence of spatial autocorrelation. Click Confirm.</p>
                <button type="button" class="btn btn-primary" name="confirm_calculating_spatial_correction" id="confirm_calculating_spatial_correction">Confirm</button>
                <br />
                <br />
                <div id="calculate_spatial_correction_status_message"></div>
                <br />
                <button class="btn btn-main" id="check_quality_prepare_button"         onclick="Workflow.complete(this);">Accept and continue</button>
                <hr>
                <table id= "spatial_correction_needed_results_table" ></table>
              </div>
            ' );
#line 132 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
} }, '/util/workflow.mas:step', title=> "Check Data Quality"
 );
#line 132 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
          ' );
#line 133 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp( { content => sub {
#line 133 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
            ' );
#line 134 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/page/page_title.mas', title=>"Run corrections for spatially autocorrelated traits"   
); #line 134 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
              <div id="spatial_correction_results_buttons">
                <input name="include_rc_random_effects" id="include_rc_random_effects" type="checkbox" checked/> <label for="include_rc_random_effects">Include rows and columns as random effects?</label><br> <p><i>The spatial corrections model will smooth with 2D splines, but can also include rows and columns as random effects to capture more variability due to spatial autocorrelation. Be sure that subsequent analyses based on these corrections do not attempt to model spatial effects a second time.</i></p>
                <br>
                <input name="genotype_as_random" id="genotype_as_random" type="checkbox"/> <label for="genotype_as_random">Use genotype (accession) as a random effect instead of fixed?</label><br> <p><i>In general, accessions should be a fixed effect. But if the accessions of this trial are representative of genetic diversity in the crop as a whole, and are drawn randomly from a larger population of genotypes, you can model them as a random effect.</i></p>
                <br>
                <input name="nseg_ratio_select" id="nseg_ratio_select" type="range" min="1" max="100" value="33"><label for="nseg_ratio_select">Degree of smoothing:</label> &nbsp; <span id=\'nseg_ratio_readout\'>0.33</span><br> <p><i>Degree of smoothing refers to the ratio of number of spline segments to the number of rows/columns. A high degree of smoothing may oversmooth plot-level variation, but a low degree of smoothing may overfit the data and fail to smooth out field-level spatial variation. The value given is a good starting point.</i></p>
                <br>
                <table style="width:100%">
                  <tr>
                <td><button id="correct_spatial" type="button" class="btn btn-default"> Run Spatial Correction </button></td>
                <td style="float:right"><button type="button" class="btn btn-primary" name="confirm_store_spatial_correction" id="confirm_store_spatial_correction" data-toggle="modal" data-analysis_type="fitted" data-target="#generic_save_analysis_dialog" disabled>Store Spatial Correction</button></td>
                  </tr>
                </table>
              </div>
              <br />
              <hr>
              <div id="trait_spatial_selector"><select id="dropdown" style="">  <option value="">All</option></select></div>
              <br>
              <table id= "spatial_correction_new_moran_table" ></table>
              <br>
              <hr>
              <br>
              <table id= "spatial_correction_blue_results_table" ></table>
              <!-- <table id= "spatial_correction_fitted_results_table" ></table> -->
          ' );
#line 159 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
} }, '/util/workflow.mas:step', title=> "Run Spatial Analysis"
 );
#line 159 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
        ' );
#line 160 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
} }, '/util/workflow.mas', id=> "spatial_model_analysis_workflow"
 );
#line 160 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
      </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>


' );
#line 171 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
 my $subtitle = 'View and edit the spatial layout of the experiment. Also view a heatmap for phenotyped traits.';
 my $layout_buttons = '';
 if ($has_col_and_row_numbers){
     $layout_buttons = '<h3><span class="glyphicon glyphicon-ok-sign text-success"></span>&nbsp;&nbsp;&nbsp;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-primary" style="margin:3px" id="calculate_spatial_correction">Calculate Spatial Correction</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>';
 } else {
    $layout_buttons = '<h3><span class="glyphicon glyphicon-remove-sign text-danger"></span>&nbsp;&nbsp;&nbsp;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>';
 }
$m->print( '
' );
#line 179 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/page/detail_page_2_col_section.mas', trial_id => $trial_id, has_col_and_row_numbers => $has_col_and_row_numbers, has_plant_entries => $has_plant_entries, has_subplot_entries => $has_subplot_entries, 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"   
); #line 179 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 181 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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 Treatment</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   
); #line 181 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 183 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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   
); #line 183 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 185 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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   
); #line 185 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 187 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/page/detail_page_2_col_section.mas', trial_id => $trial_id, trial_name => $trial_name, site_projct_name => $site_project_name, sgn_session_id => $sgn_session_id, username=> $user_name, main_production_site_url => $main_production_site_url, trial_stock_type => $trial_stock_type, info_section_title => "<h4 style='display:inline'>Repetitive Measurements</h4>", info_section_subtitle => 'View a plot by repetitive measurements level', info_section_id => "repetitive_measurements_data", icon_class => "glyphicon glyphicon-repeat"   
); #line 187 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 189 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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"   
); #line 189 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 191 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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   
); #line 191 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 193 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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   
); #line 193 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 195 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/page/detail_page_2_col_section.mas', trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>NIRS Data</h4>", info_section_subtitle => 'View and plot NIRS data for this trial.', buttons_html => "<button class='btn btn-sm btn-primary' style='margin:3px' name='upload_high_dim_phenotypes_spreadsheet_link'>Upload NIRS</button>", icon_class => "glyphicon glyphicon-stats", info_section_id => "trial_nirs_section"   
); #line 195 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 197 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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   
); #line 197 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 199 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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"  
); #line 199 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 201 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/page/detail_page_2_col_section.mas', trial_id => $trial_id, info_section_title => "<h4 style='display:inline'>Images</h4>", info_section_subtitle => 'View images of this trial.', buttons_html => "<button class='btn btn-sm btn-primary' style='margin:3px' id='upload_images_link'>Add New Image</button> <button class='btn btn-sm btn-primary' style='margin:3px' id='image_download_button'>Download Images</button>", icon_class => "glyphicon glyphicon-camera", info_section_id => "trial_images_section"   
); #line 201 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '


' );
#line 204 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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"   
); #line 204 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 206 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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"   
); #line 206 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 208 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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"   
); #line 208 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 210 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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"   
); #line 210 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 212 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
 my $data_agreement_link = '<button class="btn btn-sm btn-primary" disabled style="margin:3px">Add/edit data agreement</button>';
 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>'; }
$m->print( '
' );
#line 215 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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   
); #line 215 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 217 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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   
); #line 217 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 218 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/folder/folder_new.mas', breeding_program_id => $breeding_program_id, breeding_program_name =>$breeding_program_name, project_type => 'field_trial'   
); #line 218 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 219 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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   
); #line 219 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 221 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/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   
); #line 221 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 222 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/download_fieldmap_dialog.mas', trial_id => $trial_id, trial_name => $trial_name   
); #line 222 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 223 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/edit_fieldMap.mas', trial_id => $trial_id, trial_name => $trial_name, trial_stock_type => $trial_stock_type   
); #line 223 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 224 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/trial_coords_upload_dialogs.mas', trial_id => $trial_id, trial_name => $trial_name   
); #line 224 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 225 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/download_layout_dialog.mas', trial_id => $trial_id, trial_name => $trial_name, has_subplot_entries => $has_subplot_entries   
); #line 225 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 226 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/add_trial_used_seedlots.mas', trial_id => $trial_id   
); #line 226 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 227 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/upload_plot_gps_dialogs.mas', trial_id => $trial_id   
); #line 227 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 228 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/add_subplots_per_plot.mas', trial_id => $trial_id, trial_name => $trial_name   
); #line 228 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 229 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/add_plants_per_plot.mas', trial_id => $trial_id, trial_name => $trial_name   
); #line 229 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 230 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/add_plants_per_subplot.mas', trial_id => $trial_id, trial_name => $trial_name   
); #line 230 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 231 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/add_trial_treatment_dialogs.mas', management_factor_types => $management_factor_types   
); #line 231 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 232 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/change_plot_accessions_dialogs.mas', trial_id => $trial_id   
); #line 232 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 233 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/download_phenotypes_dialog.mas', trial_ids => $trial_id, dialog_name => $trial_name, dialog_type => 'Trial'   
); #line 233 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 234 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/update_experimental_design_type.mas', trial_id => $trial_id, trial_name => $trial_name, design_name => $design_name   
); #line 234 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 236 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/upload_phenotype_spreadsheet.mas'  
); #line 236 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 237 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/fieldbook/upload_phenotype_fieldbook.mas'  
); #line 237 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 238 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/upload_phenotype_datacollector.mas'  
); #line 238 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 240 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/create_datacollector_dialog.mas', trial_id => $trial_id, trial_name => $trial_name, trial_stock_type => $trial_stock_type   
); #line 240 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 241 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/fieldbook/create_fieldbook_dialog.mas', trial_id => $trial_id, trial_name => $trial_name, trial_stock_type => $trial_stock_type   
); #line 241 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 242 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/create_spreadsheet_dialog.mas', trial_id => $trial_id, trial_name => $trial_name, trial_stock_type => $trial_stock_type   
); #line 242 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 243 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/set_phenotypes_fully_uploaded.mas', trial_id => $trial_id   
); #line 243 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '
' );
#line 244 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/trial/upload_soil_data_dialogs.mas', trial_id => $trial_id, trial_name => $trial_name   
); #line 244 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 246 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/add_data_agreement_dialogs.mas', trial_id => $trial_id   
); #line 246 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 248 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/breeders_toolbox/upload_images.mas'  
); #line 248 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

' );
#line 250 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->comp(   '/tools/high_dimensional_phenotypes/upload_high_dim_spreadsheet_dialogs.mas'  
); #line 250 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '

<div id="trialIDDiv" class="trialIDDivClass" style="display:none;">
' );
#line 253 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
 print $trial_id;
$m->print( '</div>


<script defer="defer">

jQuery(document).ready(function () {

  var slider = document.getElementById(\'nseg_ratio_select\');
  var nseg_val = document.getElementById(\'nseg_ratio_readout\');

  slider.oninput = function() {
    nseg_val.textContent = this.value / 100;
  }

    var can_modify = \'' );
#line 268 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print(  $user_can_modify  );
#line 268 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '\';
    // alert(\'can modify: \'+can_modify);
    if (can_modify === \'0\') {
      jQuery(\'#edit_trial_details\').prop(\'disabled\', true);
    }

    jQuery(\'#edit_trial_details\').click(function(){

        jQuery(\'#trial_details_edit_dialog\').modal("show");

        edit_trial_details();

    });

    trial_detail_page_setup_dialogs();

  jQuery(\'#delete_breeding_program_trial_association_link\').click(
     function() {
        var trial_id = get_trial_id();

	var yes = confirm("Do you really want to remove this trial from the breeding program?");
	if (yes) {
            jQuery.ajax( {
		url: \'/breeders/program/remove/' );
#line 291 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print(  $breeding_program_id  );
#line 291 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( '/\'+trial_id,
		data: { },
		async: false,
		success: function(response) {
		}
	    });
	}
    });

    jQuery(\'#custom_barcode\').click(function () {
        location.href = \'/tools/label_designer\';
    });

    jQuery(\'#direct_phenotyping_link\').click(function () {
        var  id = ' );
#line 305 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print(  $trial_id  );
#line 305 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( ';
        location.href = \'/breeders/trial_phenotyping?trial_id=\' + id + \'\';
    });

    jQuery(\'#gps_field_map_link\').click(function () {
        var  id = ' );
#line 310 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print(  $trial_id  );
#line 310 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial.mas"
$m->print( ';
        window.open(\'/tools/fieldmap?trial_id=\' + id ,\'_blank\');
    });

});



//jQuery(document).on(\'click\', \'#confirm_store_spatial_correction\',  function(e) {}
</script>
' );
;return;
},
'declared_args' => {
  '$breeding_program_id' => { default => undef },
  '$breeding_program_name' => { default => undef },
  '$country_name' => { default => ' ""' },
  '$design_name' => { default => ' undef' },
  '$expression_atlas_url' => { default => ' undef' },
  '$field_size' => { default => ' undef' },
  '$field_trial_is_planned_to_be_genotyped' => { default => ' undef' },
  '$field_trial_is_planned_to_cross' => { default => ' undef' },
  '$folder_id' => { default => ' undef' },
  '$folder_name' => { default => ' undef' },
  '$harvest_date' => { default => ' undef' },
  '$has_col_and_row_numbers' => { default => ' undef' },
  '$has_expression_atlas' => { default => ' undef' },
  '$has_plant_entries' => { default => ' undef' },
  '$has_subplot_entries' => { default => ' undef' },
  '$has_tissue_sample_entries' => { default => ' undef' },
  '$hidap_enabled' => { default => ' undef' },
  '$identifier_prefix' => { default => ' \'SGN\'' },
  '$latest_trial_activity' => { default => ' undef' },
  '$location_id' => { default => undef },
  '$location_name' => { default => undef },
  '$main_production_site_url' => { default => ' undef' },
  '$management_factor_types' => { default => ' ()' },
  '$phenotypes_fully_uploaded' => { default => ' undef' },
  '$planting_date' => { default => ' undef' },
  '$plants_per_plot' => { default => ' undef' },
  '$plot_length' => { default => ' undef' },
  '$plot_width' => { default => ' undef' },
  '$project_id' => { default => ' undef' },
  '$sgn_session_id' => { default => ' undef' },
  '$show_transplanting_date' => { default => ' undef' },
  '$site_project_name' => { default => ' undef' },
  '$stock_id' => { default => ' undef' },
  '$stockref' => { default => ' undef' },
  '$transplanting_date' => { default => ' undef' },
  '$trial_description' => { default => ' undef' },
  '$trial_id' => { default => undef },
  '$trial_name' => { default => undef },
  '$trial_owner' => { default => ' undef' },
  '$trial_stock_count' => { default => ' undef' },
  '$trial_stock_type' => { default => ' undef' },
  '$trial_type' => { default => ' undef' },
  '$trial_type_id' => { default => ' undef' },
  '$user_can_modify' => { default => ' undef' },
  '$user_name' => { default => ' undef' },
  '$year' => { default => ' undef' }
},
'load_time' => 1763102299,

)
;