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

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

#line 5 "/home/production/cxgn/sgn/mason/stock/trials.mas"
$m->print( '
' );
#line 6 "/home/production/cxgn/sgn/mason/stock/trials.mas"
$m->comp(   '/util/import_javascript.mas', classes => [ 'jquery', 'jquery.dataTables' ]   
); #line 6 "/home/production/cxgn/sgn/mason/stock/trials.mas"
$m->print( '

<div class="panel panel-default">
	<div class="panel-body panel-body-sm">
		<b> Trials </b>
		<br/> <br/>
		<table class="table table-hover table-bordered" id="trial_summary_data">
			<thead>
			  <tr>
				<th>Trial name</th>
				<th>Location</th>
				<th>Details</th>
			  </tr>
			</thead>
		</table>
	</div>
</div>

' );
#line 24 "/home/production/cxgn/sgn/mason/stock/trials.mas"
 if ($type_name eq "accession") {
$m->print( '<div class="panel panel-default">
	<div class="panel-body panel-body-sm">
		<b> Stored Analyses </b>
		<br/> <br/>
		<table class="table table-hover table-bordered" id="analysis_usage_data">
			<thead>
				<tr>
					<th>Name</th>
				</tr>
			</thead>
		</table>
	</div>
</div>
' );
#line 38 "/home/production/cxgn/sgn/mason/stock/trials.mas"
 }
$m->print( '
' );
#line 40 "/home/production/cxgn/sgn/mason/stock/trials.mas"
$m->comp(   '/util/import_css.mas', paths => ['/documents/inc/datatables/jquery.dataTables.css']   
); #line 40 "/home/production/cxgn/sgn/mason/stock/trials.mas"
$m->print( '

<script>

    jQuery(document).ready(function () {
        jQuery(\'#stock_trials_section_onswitch\').click(function(){
            jQuery(\'#trial_summary_data\').DataTable( {
                \'destroy\': true,
                \'ajax\': \'/stock/\'+ ' );
#line 48 "/home/production/cxgn/sgn/mason/stock/trials.mas"
$m->print(  $stock_id  );
#line 48 "/home/production/cxgn/sgn/mason/stock/trials.mas"
$m->print( ' + \'/datatables/trials\',
            });
' );
#line 50 "/home/production/cxgn/sgn/mason/stock/trials.mas"
 if ($type_name eq "accession") {
$m->print( '			jQuery(\'#analysis_usage_data\').DataTable( {
                \'destroy\': true,
                \'ajax\': \'/stock/\'+ ' );
#line 53 "/home/production/cxgn/sgn/mason/stock/trials.mas"
$m->print(  $stock_id  );
#line 53 "/home/production/cxgn/sgn/mason/stock/trials.mas"
$m->print( ' + \'/datatables/stored_analyses\',
            });
' );
#line 55 "/home/production/cxgn/sgn/mason/stock/trials.mas"
 }
$m->print( '        });
    });

</script>' );
;return;
},
'declared_args' => {
  '$stock_id' => { default => undef },
  '$type_name' => { default => undef }
},
'load_time' => 1763448495,

)
;