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

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

#line 5 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
$m->print( '
' );
#line 6 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
$m->comp(   '/util/import_javascript.mas', classes => [ 'jquery', 'jquery.dataTables' ]   
); #line 6 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
$m->print( '
' );
#line 7 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
$m->comp(   '/util/import_css.mas', paths => ['/documents/inc/datatables/jquery.dataTables.css']   
); #line 7 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
$m->print( '

<div class="well well-sm">
    <div class="panel panel-default">
        <form id="download_summary_stock_entries" action="/breeders/download_summary_stock_entries" method="POST">
            <div class="panel-body">
                <button class="btn btn-primary" id="download_summary_stock_entries_button">Download Entries</button>
                <input name ="stock_entries_trial_id" id="stock_entries_trial_id" type="hidden" value="' );
#line 14 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
$m->print(  $trial_id  );
#line 14 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
$m->print( '" />
                <input type="hidden" id="trial_stock_entries_download_token" name="trial_stock_entries_download_token" />
            </div>
        </form>
    </div>
    <div class="panel panel-default" style="overflow:scroll">
        <div class="panel-body">
                <table class="table table-hover table-bordered display nowrap" id="summary_stock_entry_table">
                    <thead>
                        <tr>
' );
#line 24 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
 if ($trial_stock_type eq 'cross') {
$m->print( '                            <th>Cross Unique ID</th>
' );
#line 26 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
 } elsif ($trial_stock_type eq 'family_name') {
$m->print( '                            <th>Family Name</th>
' );
#line 28 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
 } else {
$m->print( '                            <th>Accession</th>
' );
#line 30 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
 }
$m->print( '                            <th>Plot</th>
                            <th>Plant</th>
                            <th>Tissue Sample</th>
                        </tr>
                    </thead>
                </table>
        </div>
    </div>
</div>

<script>

jQuery(document).ready(function () {

        jQuery(\'#summary_stock_entry_table\').DataTable({
            \'destroy\': true,
            \'ajax\':\'/ajax/breeders/trial/\'+ ' );
#line 47 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
$m->print(  $trial_id  );
#line 47 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/summary_stock_entries.mas"
$m->print( ' + \'/stock_entry_summary\',
        });

        jQuery(\'#download_summary_stock_entries_button\').click(function() {
            var token = new Date().getTime();
            jQuery(\'#trial_stock_entries_download_token\').val(token);
            jQuery(\'#download_summary_stock_entries\').submit();
        });

});


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

)
;