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 2 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/trial_seedlots_count.mas"
    $trial_id = $_[ $pos{'trial_id'} ];
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 4 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/trial_seedlots_count.mas"
$m->print( '
' );
#line 5 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/trial_seedlots_count.mas"
$m->comp(   '/util/import_javascript.mas', classes => [ 'jquery', 'jquery.iframe-post-form' ]   
); #line 5 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/trial_seedlots_count.mas"
$m->print( '


<script>


jQuery(document).ready(function(){
  jQuery(\'#trial_design_section_onswitch\').one("click", function(){
    jQuery.ajax ( {
        url : \'/ajax/breeders/trial/\'+' );
#line 14 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/trial_seedlots_count.mas"
$m->print(  $trial_id  );
#line 14 "/home/production/cxgn/sgn/mason/breeders_toolbox/trial/trial_seedlots_count.mas"
$m->print( '+\'/seedlots\',
        success: function(response){
              //console.log(response);
              //alert(response.seedlots[0].length);
              //console.log(response.seedlots);
              var html = \'\';
              html += \'Number of seedlots: \';
               html += response.seedlots[0].length;
              jQuery("#seedlots_counts").html(html);
          },
          error: function(response){
              alert(\'Error displaying seedlots count\');
          }

      });
    });
});


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

)
;