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 );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( trial_id ) )
    {
        HTML::Mason::Exception::Params->throw
            ( error => "no value sent for required parameter '$arg'" )
                unless exists $pos{$arg};
    }
#line 3 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/design.mas"
    $trial_id = $_[ $pos{'trial_id'} ];
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/design.mas"
$m->print( '
' );
#line 5 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/design.mas"
$m->print( '
' );
#line 6 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/design.mas"
$m->comp(   '/util/import_javascript.mas', classes => [  ]   
); #line 6 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/design.mas"
$m->print( '


<div id="trial_design_html" >
<div class="well">
[LOADING...]
<br/>
</div>
</div>

<script>

jQuery(document).ready(function () {

	jQuery.ajax ( {
		url : \'/ajax/breeders/trial/\'+' );
#line 21 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/design.mas"
$m->print(  $trial_id  );
#line 21 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/design.mas"
$m->print( '+\'/design\',
		success: function(response){
			if (!response.design_type) {
				jQuery(\'#trial_design_html\').empty();
				var html = "<div class=\'well well-sm\'>There is no design data for this trial.</div>";
					jQuery(\'#trial_design_html\').html(html);
	    	} else {
				var trial_design_html = "<table class=\'table table-hover table-condensed table-bordered table-striped\' id=\'trial_controls_table\'><thead><tr><th>Attribute</th><th>Value</th></tr></thead><tbody><tr><td>Design</td><td><b>"+response.design_type+"</b></td></tr><tr><td>Number of Blocks</td><td>"+response.num_blocks+"</td></tr><tr><td>Number of Replicates</td><td>"+response.num_reps+"</td></tr><tr><td>Plot Length</td><td>"+response.plot_length+"</td></tr><tr><td>Plot Width</td><td>"+response.plot_width+"</td></tr><tr><td>Subplots Per Plot</td><td>"+response.subplots_per_plot+"</td></tr><tr><td>Plants Per Plot</td><td>"+response.plants_per_plot+"</td></tr></tbody></table>";
				jQuery(\'#trial_design_html\').empty();
				jQuery(\'#trial_design_html\').html(trial_design_html);
			}
		},
		error: function(response){
			alert("Error retrieving design.");
		}
	});
});

</script>
' );
;return;
},
'declared_args' => {
  '$trial_id' => { default => undef }
},
'load_time' => 1763102299,

)
;