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 ( $nd_geolocation );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }
#line 3 "/home/production/cxgn/sgn/mason/search/genotyping_trials.mas"
     $nd_geolocation = exists $pos{'nd_geolocation'} ? $_[ $pos{'nd_geolocation'} ] :  'not_provided';
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

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

' );
#line 8 "/home/production/cxgn/sgn/mason/search/genotyping_trials.mas"
$m->comp(   '/page/page_title.mas', title => "Genotyping Plate Search"   
); #line 8 "/home/production/cxgn/sgn/mason/search/genotyping_trials.mas"
$m->print( '

<div class="well well-sm">
    <div class="panel panel-default">
        <div class="panel-body">
            <table id="genotyping_trial_search_results" width="100%" class="table table-hover table-striped">
            <thead>
              <tr>
                  <th>Plate Name</th>
                  <th>Description</th>
                  <th>Breeding program</th>
                  <th>Folder</th>
                  <th>Year</th>
                  <th>Location</th>
                  <th>Genotyping Facility</th>
                  <th>Format</th>
                  <th>Sample Type</th>
                  <th>Download</th>
            </tr>
            </thead>
            </table>
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-body">
            <br><br>
            ' );
#line 35 "/home/production/cxgn/sgn/mason/search/genotyping_trials.mas"
$m->comp( { content => sub {
#line 35 "/home/production/cxgn/sgn/mason/search/genotyping_trials.mas"
$m->print( '
                <br>
                <div style="text-align:right" id="genotyping_trials_to_list_menu"></div>
                <div id="genotyping_trial_result_names" style="display: none;"></div>
            ' );
#line 39 "/home/production/cxgn/sgn/mason/search/genotyping_trials.mas"
} }, '/page/info_section.mas', title => 'Copy Results to a List', collapsible=>1, collapsed=>0, subtitle=>'<i>Copy the trial names currently showing in the search results table to a new or exisiting list</i>'
 );
#line 39 "/home/production/cxgn/sgn/mason/search/genotyping_trials.mas"
$m->print( '
        </div>
    </div>
</div>


<script>

jQuery(document).ready(function () {

    var trial_table = jQuery(\'#genotyping_trial_search_results\').DataTable( {
        \'ajax\': \'/ajax/tissue_samples/genotyping_trials\',
        "scrollX": true
     });

    jQuery(\'#genotyping_trial_search_results\').on( \'draw.dt\', function () {
        var name_links = trial_table.column( 0, {page:\'current\'} ).data();
        var names = [];

        for (var i = 0; i < name_links.length; i++) { //extract text from anchor tags
            names.push(name_links[i].match(/<a [^>]+>([^<]+)<\\/a>/)[1]+\'\\n\');
        }

        jQuery(\'#genotyping_trial_result_names\').html(names);
        addToListMenu(\'genotyping_trials_to_list_menu\', \'genotyping_trial_result_names\', {
            listType: \'genotyping_plates\'
        });
    });

});

</script>
' );
;return;
},
'declared_args' => {
  '$nd_geolocation' => { default => ' \'not_provided\'' }
},
'load_time' => 1763123247,

)
;