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

    foreach my $arg ( qw( stock_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/stock/related_stock.mas"
    $stock_id = $_[ $pos{'stock_id'} ];
#line 4 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
     $stock_uniquename = exists $pos{'stock_uniquename'} ? $_[ $pos{'stock_uniquename'} ] :  undef;
#line 5 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
     $stock_type = exists $pos{'stock_type'} ? $_[ $pos{'stock_type'} ] :  undef;
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
' );
#line 7 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
' );
#line 8 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 if ($stock_type eq 'accession' || $stock_type eq 'plant' || $stock_type eq 'plot' || $stock_type eq 'subplot' || $stock_type eq 'tissue_sample'){
$m->print( '    ' );
#line 9 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 9 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        <div class="well well-sm">
            <div class="panel panel-default">
                <div class="panel-body">
                    <table id = "trial_related_stock" class="table table-hover table-striped">
                        <thead>
                        <tr>
                            <th>Type</th>
                            <th>Name</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>

            <br>
            ' );
#line 25 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 25 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
                <br>
                <div style="text-align:right" id="trial_stocks_to_list_menu"></div>
                <div id="trial_stock_names" style="display: none;"></div>
            ' );
#line 29 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', title => 'Copy Stocks to a List', collapsible=>1, collapsed=>1, subtitle=>'<i>Copy the stock names showing in table to a new or exisiting list</i>'
 );
#line 29 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        </div>
    ' );
#line 31 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', id=>'related_stocks_in_trial', title => 'Related stocks in trial', collapsible=>1, collapsed=>1
 );
#line 31 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
' );
#line 32 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 }
$m->print( '
' );
#line 34 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 if ($stock_type eq 'plot' || $stock_type eq 'plant'){
$m->print( '    ' );
#line 35 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 35 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        <div class="well well-sm">
            <div class="panel panel-default">
                <div class="panel-body">
                    <table id = "plot_plant_related_seedlots" class="table table-hover table-striped">
                        <thead>
                            <tr>
                                <th>Transaction Type</th>
                                <th>Stock Type</th>
                                <th>Name</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>

            <br>
            ' );
#line 52 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 52 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
                <br>
                <div style="text-align:right" id="seedlots_to_list_menu"></div>
                <div id="seedlot_names" style="display: none;"></div>
            ' );
#line 56 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', title => 'Copy Stocks to a List', collapsible=>1, collapsed=>1, subtitle=>'<i>Copy the seedlot names showing in table to a new or exisiting list</i>'
 );
#line 56 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        </div>
    ' );
#line 58 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', id=>'related_seedlots', title => 'Related seedlots', collapsible=>1, collapsed=>1
 );
#line 58 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
' );
#line 59 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 }
$m->print( '
' );
#line 61 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 if ($stock_type eq 'accession') {
$m->print( '    ' );
#line 62 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp(   '/breeders_toolbox/seedlots_section.mas', stock_id=>$stock_id, stock_type=>$stock_type, stock_uniquename=>$stock_uniquename   
); #line 62 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
' );
#line 63 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 }
$m->print( '
' );
#line 65 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 if ($stock_type eq 'accession' || $stock_type eq 'plant' || $stock_type eq 'plot' || $stock_type eq 'subplot'){
$m->print( '
    ' );
#line 67 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 67 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        <div class="well well-sm">
            <div class="panel panel-default">
                <div class="panel-body">
                    <table id = "tissue_sample" class="table table-hover table-striped">
                        <thead>
                        <tr>
                            <th>Type</th>
                            <th>Name</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>

            <br>
            ' );
#line 83 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 83 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
                <br>
                <div style="text-align:right" id="tissue_samples_to_list_menu"></div>
                <div id="tissue_sample_names" style="display: none;"></div>
            ' );
#line 87 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', title => 'Copy Stocks to a List', collapsible=>1, collapsed=>1, subtitle=>'<i>Copy the stock names showing in table to a new or exisiting list</i>'
 );
#line 87 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        </div>
    ' );
#line 89 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', id=>'related_stock_tissues', title => 'Related tissue samples', collapsible=>1, collapsed=>1
 );
#line 89 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '

' );
#line 91 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 }
$m->print( '
' );
#line 93 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 if ($stock_type eq 'accession'){
$m->print( '
    ' );
#line 95 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 95 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        <div class="well well-sm">
            <div class="panel panel-default">
                <div class="panel-body">
                    <table id = "progenies" class="table table-hover table-striped">
                        <thead>
                        <tr>
                            <th>As female or male parent</th>
			    <th>Cross type</th>
                            <th>Progeny name</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>

            <br>
            ' );
#line 112 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 112 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
                <br>
                <div style="text-align:right" id="progenies_to_list_menu"></div>
                <div id="progeny_names" style="display: none;"></div>
            ' );
#line 116 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', title => 'Copy Stocks to a List', collapsible=>1, collapsed=>1, subtitle=>'<i>Copy the stock names showing in table to a new or exisiting list</i>'
 );
#line 116 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        </div>
    ' );
#line 118 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', id=>'related_stock_progenies', title => 'Progenies of this Accession (as female or male parent)', collapsible=>1, collapsed=>1
 );
#line 118 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '


' );
#line 121 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 121 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        <div class="well well-sm">
            <div class="panel panel-default">
                <div class="panel-body">
                    <table id = "parents" class="table table-hover table-striped">
                        <thead>
                        <tr>
                            <th>Female Parent</th>
                            <th>Male Parent</th>
                            <th>Cross Type</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>

        </div>
    ' );
#line 138 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', id=>'related_stock_parents', title => 'Parents of this Accession', collapsible=>1, collapsed=>1
 );
#line 138 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '




    ' );
#line 143 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 143 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        <div class="well well-sm">
            <div class="panel panel-default">
                <div class="panel-body">
                    <table id = "siblings" class="table table-hover table-striped">
                        <thead>
                        <tr>
                            <th>Accession Name</th>
                            <th>Female Parent</th>
                            <th>Male Parent</th>
                            <th>Cross Type</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>

            <br>
            ' );
#line 161 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 161 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
                <br>
                <div style="text-align:right" id="siblings_to_list_menu"></div>
                <div id="sibling_names" style="display: none;"></div>
            ' );
#line 165 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', title => 'Copy siblings to a List', collapsible=>1, collapsed=>1, subtitle=>'<i>Copy the sibling names showing in table to a new or exisiting list</i>'
 );
#line 165 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        </div>
    ' );
#line 167 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', id=>'related_stock_siblings', title => 'Siblings of this Accession', collapsible=>1, collapsed=>1
 );
#line 167 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '

' );
#line 169 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 }
$m->print( '
' );
#line 171 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 if ($stock_type eq 'accession' || $stock_type eq 'backcross population' || $stock_type eq 'f2 population' || $stock_type eq 'mutant population' || $stock_type eq 'population' || $stock_type eq 'training population'){
$m->print( '
    ' );
#line 173 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 173 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        <div class="well well-sm">
            <div class="panel panel-default">
                <div class="panel-body">
                    <table id = "group" class="table table-hover table-striped">
                        <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>

            <br>
            ' );
#line 189 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->comp( { content => sub {
#line 189 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
                <br>
                <div style="text-align:right" id="groups_and_members_to_list_menu"></div>
                <div id="group_and_member_names" style="display: none;"></div>
            ' );
#line 193 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', title => 'Copy Stocks to a List', collapsible=>1, collapsed=>1, subtitle=>'<i>Copy the stock names showing in table to a new or exisiting list</i>'
 );
#line 193 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '
        </div>
    ' );
#line 195 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
} }, '/page/info_section.mas', id=>'related_stock_groups', title => 'Groups / members', collapsible=>1, collapsed=>1
 );
#line 195 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( '

' );
#line 197 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
 }
$m->print( '

<script>

jQuery(document).ready(function(){


    jQuery(\'#related_stocks_in_trial_onswitch\').one("click", function(){
        var trial_stock_table = jQuery(\'#trial_related_stock\').DataTable({
            \'order\': false,
            \'ajax\':\'/stock/\'+ ' );
#line 208 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print(  $stock_id  );
#line 208 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( ' + \'/datatables/trial_related_stock\',
            "fnInitComplete": function(oSettings, json) {
                //console.log(json);
                if (!isLoggedIn()) {
                    jQuery(\'#trial_stocks_to_list_menu\').html("<div class=\'well well-sm\'><h3>Please login to use lists!</h3></div>");
                } else {
                    var html = "";
                    for(var i=0; i<json.data.length; i++){
                        html += json.data[i][2]+"\\n";
                    }
                    jQuery("#trial_stock_names").html(html);
                    addToListMenu("trial_stocks_to_list_menu", "trial_stock_names", {
                        selectText: true,
                        listType:\'null\'
                    });
                }
            }
        });
    });

    jQuery(\'#related_seedlots_onswitch\').one("click", function(){
        var related_seedlots_table = jQuery(\'#plot_plant_related_seedlots\').DataTable({
            \'order\': false,
            \'ajax\':\'/stock/\'+ ' );
#line 231 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print(  $stock_id  );
#line 231 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( ' + \'/datatables/plot_plant_related_seedlots\',
            "fnInitComplete": function(oSettings, json) {
                //console.log(json);
                if (!isLoggedIn()) {
                    jQuery(\'#seedlots_to_list_menu\').html("<div class=\'well well-sm\'><h3>Please login to use lists!</h3></div>");
                } else {
                    var html = "";
                    for(var i=0; i<json.data.length; i++){
                        html += json.data[i][3]+"\\n";
                    }
                    jQuery("#seedlot_names").html(html);
                    addToListMenu("seedlots_to_list_menu", "seedlot_names", {
                        selectText: true,
                        listType:\'seedlots\'
                    });
                }
            }
        });
    });

    jQuery(\'#related_stock_progenies_onswitch\').one("click", function(){
        var progeny_table = jQuery(\'#progenies\').DataTable({
            \'ordering\': false,
            \'ajax\':\'/stock/\'+ ' );
#line 254 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print(  $stock_id  );
#line 254 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( ' + \'/datatables/progenies\',
            "fnInitComplete": function(oSettings, json) {
                //console.log(json);
                if (!isLoggedIn()) {
                    jQuery(\'#progenies_to_list_menu\').html("<div class=\'well well-sm\'><h3>Please login to use lists!</h3></div>");
                } else {
                    var html = "";
                    for(var i=0; i<json.data.length; i++){
                        html += json.data[i][3]+"\\n";
                    }
                    jQuery("#progeny_names").html(html);
                    addToListMenu("progenies_to_list_menu", "progeny_names", {
                        selectText: true,
                        listType:\'accessions\'
                    });
                }
            }
        });
    });

    jQuery(\'#related_stock_groups_onswitch\').one("click", function(){
        var group_and_member_table = jQuery(\'#group\').DataTable({
            \'ajax\':\'/stock/\'+ ' );
#line 276 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print(  $stock_id  );
#line 276 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( ' + \'/datatables/group_and_member\',
            "fnInitComplete": function(oSettings, json) {
                //console.log(json);
                if (!isLoggedIn()) {
                    jQuery(\'#groups_and_members_to_list_menu\').html("<div class=\'well well-sm\'><h3>Please login to use lists!</h3></div>");
                } else {
                    var html = "";
                    for(var i=0; i<json.data.length; i++){
                        html += json.data[i][2]+"\\n";
                    }
                    jQuery("#group_and_member_names").html(html);
                    addToListMenu("groups_and_members_to_list_menu", "group_and_member_names", {
                        selectText: true,
                        listType:\'null\'
                    });
                }
            }
        });
    });

    jQuery(\'#related_stock_tissues_onswitch\').one("click", function(){
        var tissue_sample_table = jQuery(\'#tissue_sample\').DataTable({
            \'ajax\':\'/stock/\'+ ' );
#line 298 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print(  $stock_id  );
#line 298 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( ' + \'/datatables/stock_for_tissue\',
            "fnInitComplete": function(oSettings, json) {
                //console.log(json);
                if (!isLoggedIn()) {
                    jQuery(\'#tissue_samples_to_list_menu\').html("<div class=\'well well-sm\'><h3>Please login to use lists!</h3></div>");
                } else {
                    var html = "";
                    for(var i=0; i<json.data.length; i++){
                        html += json.data[i][2]+"\\n";
                    }
                    jQuery("#tissue_sample_names").html(html);
                    addToListMenu("tissue_samples_to_list_menu", "tissue_sample_names", {
                        selectText: true,
                        listType:\'tissue_samples\'
                    });
                }
            }
        });
    });


    jQuery(\'#related_stock_siblings_onswitch\').one("click", function(){
        var siblings_table = jQuery(\'#siblings\').DataTable({
            \'ordering\': false,
            \'ajax\':\'/stock/\'+ ' );
#line 322 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print(  $stock_id  );
#line 322 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( ' + \'/datatables/siblings\',
            "fnInitComplete": function(oSettings, json) {
                //console.log(json);
                if (!isLoggedIn()) {
                    jQuery(\'#siblings_to_list_menu\').html("<div class=\'well well-sm\'><h3>Please login to use lists!</h3></div>");
                } else {
                    var html = "";
                    for(var i=0; i<json.data.length; i++){
                        html += json.data[i][4]+"\\n";
                    }
                    jQuery("#sibling_names").html(html);
                    addToListMenu("siblings_to_list_menu", "sibling_names", {
                        selectText: true,
                        listType:\'accessions\'
                    });
                }
            }
        });
    });

        jQuery(\'#related_stock_parents_onswitch\').one("click", function(){
        var siblings_table = jQuery(\'#parents\').DataTable({
            \'ordering\': false,
            \'ajax\':\'/stock/\'+ ' );
#line 345 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print(  $stock_id  );
#line 345 "/home/production/cxgn/sgn/mason/stock/related_stock.mas"
$m->print( ' + \'/datatables/parents\',
            // "fnInitComplete": function(oSettings, json) {
            //     //console.log(json);
            //     if (!isLoggedIn()) {
            //         jQuery(\'#siblings_to_list_menu\').html("<div class=\'well well-sm\'><h3>Please login to use lists!</h3></div>");
            //     } else {
            //         var html = "";
            //         for(var i=0; i<json.data.length; i++){
            //             html += json.data[i][4]+"\\n";
            //         }
            //         jQuery("#sibling_names").html(html);
            //         addToListMenu("siblings_to_list_menu", "sibling_names", {
            //             selectText: true,
            //             listType:\'accessions\'
            //         });
            //     }
            // }
        });
    });


});


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

)
;