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 ( $cross_id, $cross_name, $breeding_program, $progeny_count, $trial_id, $trial_name, $user_id, $identifier_prefix );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( cross_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/breeders_toolbox/cross/index.mas"
    $cross_id = $_[ $pos{'cross_id'} ];
#line 4 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
     $cross_name = exists $pos{'cross_name'} ? $_[ $pos{'cross_name'} ] :  '';
#line 5 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
     $breeding_program = exists $pos{'breeding_program'} ? $_[ $pos{'breeding_program'} ] :  undef;
#line 6 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
     $progeny_count = exists $pos{'progeny_count'} ? $_[ $pos{'progeny_count'} ] :  undef;
#line 7 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
     $trial_id = exists $pos{'trial_id'} ? $_[ $pos{'trial_id'} ] :  undef;
#line 8 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
     $trial_name = exists $pos{'trial_name'} ? $_[ $pos{'trial_name'} ] :  undef;
#line 9 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
     $user_id = exists $pos{'user_id'} ? $_[ $pos{'user_id'} ] :  undef;
#line 10 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
     $identifier_prefix = exists $pos{'identifier_prefix'} ? $_[ $pos{'identifier_prefix'} ] :  '';
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
' );
#line 12 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
' );
#line 13 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp(   '/util/import_javascript.mas', classes => ["jquery", "jqueryui", "thickbox", "CXGN.Phenome.Tools", "CXGN.Page.FormattingHelpers", "jquery.cookie", "CXGN.List", "CXGN.BreederSearch", "CXGN.BreedersToolbox.CrossDetailPage" ]   
); #line 13 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

' );
#line 15 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
 use utf8;
 $cross_name ||= "Untitled cross";
 my $basename = $cross_name."P";
 my $cross_properties = $c->config->{cross_properties};
 my @cross_props = split ',',$cross_properties;
 my $odk_crossing_data_service_name = $c->config->{odk_crossing_data_service_name};
 my $cross_additional_info_header_string = $c->config->{cross_additional_info_header};
 my @cross_additional_info_header = split ',',$cross_additional_info_header_string;
 my $cross_additional_info_string = $c->config->{cross_additional_info};
 my @cross_additional_info = split ',',$cross_additional_info_string;
$m->print( '
' );
#line 26 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp(   '/page/page_title.mas', title => "Details for cross '$cross_name'"   
); #line 26 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

' );
#line 28 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp( { content => sub {
#line 28 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

    <div class="panel panel-default">
        <div class="panel-body">
            <div class="row">
                <div class="col-sm-6">
                    ' );
#line 34 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp(   '/page/form.mas',
                        object_type=>'cross',
                        object_id=> $cross_id,
                        form_name=> 'stock_form',
                        server_side_script => '/phenome/stock/stock_ajax_form.pl',
                        form_div_name=>'stock_details',
                        js_object_name=> 'stockForm',
                        page_url => "/cross/$cross_id" ,
                        alternate_new_button => '',
                        alternate_ghosted_new_button => '',
                        alternate_delete_button => '',
                        alternate_ghosted_delete_button => ''
                      
); #line 46 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
                </div>
                <div class="col-sm-6">
                    <br /><br />
                    ' );
#line 50 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp(   '/util/barcode.mas', identifier => "$identifier_prefix"."$cross_id", text=> "$identifier_prefix stock $cross_id ($cross_name)", format=>"stock_qrcode"    
); #line 50 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
                    <br /><br />
                </div>
            </div>
        </div>
    </div>

' );
#line 57 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
} }, '/page/info_section.mas', title => "Cross information"
 );
#line 57 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

<div id="cross_name" style="visibility:hidden">
' );
#line 60 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print(  $cross_name  );
#line 60 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
</div>

<div id="cross_id" style="visibility:hidden">
' );
#line 64 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print(  $cross_id  );
#line 64 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
</div>


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

' );
#line 71 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp( { content => sub {
#line 71 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
    <div class = "well well-sm">
        <div class = "panel panel-default">
            <div class = "panel-body">
                <div style="overflow:scroll">
                    <table id = "membership_table" class="table table-hover table-striped">
                        <thead>
                            <tr>
                                <th>Crossing Experiment</th>
                                <th>Description</th>
                                <th>Family Name</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
' );
#line 89 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
} }, '/page/info_section.mas', title => 'Member of', collapsible=>1, collapsed=>0
 );
#line 89 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

' );
#line 91 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp( { content => sub {
#line 91 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
    <div class = "well well-sm">
        <div class = "panel panel-default">
            <div class = "panel-body">
                <div style="overflow:scroll">
                    <table id = "parent_information" class="table table-hover table-striped">
                        <thead>
                            <tr>
                                <th>Cross Combination</th>
                                <th>Cross Type</th>
                                <th>Female Accession</th>
                                <th>Female Ploidy</th>
                                <th>Male Accession</th>
                                <th>Male Ploidy</th>
                                <th>Female Plot</th>
                                <th>Male Plot</th>
                                <th>Female Plant</th>
                                <th>Male Plant</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
' );
#line 116 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
} }, '/page/info_section.mas', title => 'Parents', collapsible=>1, collapsed=>0
 );
#line 116 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

' );
#line 118 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
 my $edit_additional_info_link = "[Edit]";
 if ($user_id) { $edit_additional_info_link = '<a id="edit_additional_info_link">[Edit]</a>'; }
$m->print( '
<div id="edit_additional_info_dialog">
    <select id="additional_info_select">
' );
#line 123 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
 foreach my $info(@cross_additional_info){
$m->print( '        <option value="' );
#line 124 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( $info );
#line 124 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '">' );
#line 124 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( $info );
#line 124 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '</option>
' );
#line 125 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
}
$m->print( '    </select>
    <input id="additional_info_value" />
    <button id="edit_additional_info_submit" >Save</button>
</div>


' );
#line 132 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp( { content => sub {
#line 132 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
    <div class = "well well-sm">
        <div class = "panel panel-default">
            <div class = "panel-body">
                <div style="overflow:scroll">
                    <table id = "cross_additional_info" class="table table-hover table-striped">
                        <thead>
                            <tr>
' );
#line 140 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
 foreach my $additional_info(@cross_additional_info_header){
$m->print( '                                <th>' );
#line 141 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( $additional_info );
#line 141 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '</th>
' );
#line 142 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
}
$m->print( '                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
' );
#line 150 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
} }, '/page/info_section.mas', title => 'Additional Parent Info', collapsible => 1, collapsed => 0, subtitle => $edit_additional_info_link
 );
#line 150 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

' );
#line 152 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
 my $edit_link = "[Edit]";
 if ($user_id) { $edit_link = '<a id="edit_properties_link">[Edit]</a>'; }
$m->print( '
' );
#line 155 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp( { content => sub {
#line 155 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
    <div class = "well well-sm">
        <div class = "panel panel-default">
            <div class = "panel-body">
                <div style="overflow:scroll">
                <table id = "cross_properties" class="table table-hover table-striped">
                    <thead>
                        <tr>
' );
#line 163 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
 foreach my $cross_prop(@cross_props){
$m->print( '                        <th>' );
#line 164 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( $cross_prop );
#line 164 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '</th>
' );
#line 165 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
}
$m->print( '                        </tr>
                    </thead>
                </table>
                </div>
            </div>
        </div>
    </div>
 ' );
#line 173 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
} }, '/page/info_section.mas', title => 'Field Crossing Data', collapsible => 1, collapsed => 0, subtitle => $edit_link
 );
#line 173 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

<div id="edit_properties_dialog">

    <select id="properties_select">
' );
#line 178 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
 foreach my $cross_prop(@cross_props){
$m->print( '        <option value="' );
#line 179 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( $cross_prop );
#line 179 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '">' );
#line 179 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( $cross_prop );
#line 179 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '</option>
' );
#line 180 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
}
$m->print( '    </select>

    <input id="property_value" />

    <button id="property_submit" >Save</button>

    <p><b>WARNING!</b>&nbsp;Changing the parameters can have unpredicatable results in downstream analyses if they are inconsistent with other data.</p>

</div>

' );
#line 191 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp( { content => sub {
#line 191 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
    <div class = "well well-sm">
        <div class = "panel panel-default">
            <div class = "panel-body">
                <div style="overflow:scroll">
                    <table id = "cross_transactions" class="table table-hover table-striped">
                        <thead>
                            <tr>
                                <th>Transaction ID</th>
                                <th>Operator</th>
                                <th>Timestamp</th>
                                <th>Number of Flowers</th>
                                <th>Number of Fruits</th>
                                <th>Number of Seeds</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
' );
#line 212 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
} }, '/page/info_section.mas', title => 'Cross Transactions', collapsible => 1, collapsed => 0, subtitle => 'View crossing activities of this cross'
 );
#line 212 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

' );
#line 214 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
 if ($odk_crossing_data_service_name eq 'ONA') {
$m->print( '    ' );
#line 215 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp( { content => sub {
#line 215 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
        <div class="well well-sm">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div style="overflow:scroll">
                        <table id="tissue_culture_summary_table" class="table table-hover table-striped">
                            <thead>
                                <tr>
                                    <th>Embryo IDs</th>
                                    <th>Subculture IDs</th>
                                    <th>Rooting IDs</th>
                                    <th>Weaning1 IDs</th>
                                    <th>Weaning2 IDs</th>
                                    <th>Screenhouse IDs</th>
                                    <th>Hardening IDs</th>
                                    <th>Openfield IDs</th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    ' );
#line 238 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
} }, '/page/info_section.mas', id=>'tissue_culture_summary_section', title => 'Tissue culture IDs of this Cross', collapsible=>1, collapsed=>1, subtitle => 'View tissue culture IDs in each step (e.g., embryo IDs, subculture IDs, rooting IDs, weaning1 IDs)'
 );
#line 238 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '
' );
#line 239 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
 }
$m->print( '
' );
#line 241 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp(   '/breeders_toolbox/seedlots_section.mas', stock_id=>$cross_id, stock_type=>'cross', stock_uniquename=>$cross_name   
); #line 241 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

' );
#line 243 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
 my $add_progeny_link = "[add progeny]";
 if ($user_id) { $add_progeny_link= '<a id="add_more_progeny_link">[add progeny]</a>'; }
$m->print( '
' );
#line 246 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp( { content => sub {
#line 246 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

    <div id="progeny_information_div">
        [loading...]
    </div>

    <div id="add_more_progeny_dialog">
        <table>
            <tr><td>Basename</td><td><input type="input" id="basename" name="basename" value="' );
#line 254 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print(  $basename  );
#line 254 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '" /></td></tr>
            <tr><td>Start number</td><td><input type="input" id="start_number" name="start_number" size="5" value="' );
#line 255 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print(  $progeny_count + 1  );
#line 255 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '" /></td></tr>
            <tr><td>How many?</td><td><input type="input" id="progeny_count" name="progeny_count" size="5" /></td></tr>
        </table>
    </div>


' );
#line 261 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
} }, '/page/info_section.mas', title => "Progeny", collapsible => 1, collapsed => 0, subtitle => $add_progeny_link
 );
#line 261 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

' );
#line 263 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->comp( { content => sub {
#line 263 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

<button id="delete_cross_button" class="btn btn-default">Delete</button>

' );
#line 267 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
} }, '/page/info_section.mas', title => "Delete cross", collapsible => 1, collapsed => 0, subtitle => '<font color="red">Deletion cannot be undone</font>'
 );
#line 267 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '

<script>

jQuery(document).ready( function() {
    jQuery(\'#delete_cross_button\').click( function() {
        var response = confirm(\'Really delete this cross? This action cannot be undone.\');
        if (response) {
            jQuery.ajax( {
                url: \'/ajax/cross/delete\',
                data: { \'cross_id\' : ' );
#line 277 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print(  $cross_id  );
#line 277 "/home/production/cxgn/sgn/mason/breeders_toolbox/cross/index.mas"
$m->print( '},
                method: \'POST\',
                error: function(r) { alert(\'An error occurred.\'); },
                success: function(r) {
                    if (r.error) {
                        alert(r.error);
                    } else {
                        alert(\'Deletion was successful.\');
                    }
                }
            });
        }
    });
});

</script>
' );
;return;
},
'declared_args' => {
  '$breeding_program' => { default => ' undef' },
  '$cross_id' => { default => undef },
  '$cross_name' => { default => ' \'\'' },
  '$identifier_prefix' => { default => ' \'\'' },
  '$progeny_count' => { default => ' undef' },
  '$trial_id' => { default => ' undef' },
  '$trial_name' => { default => ' undef' },
  '$user_id' => { default => ' undef' }
},
'load_time' => 1763089219,

)
;