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 ( @projects, @locations );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }
#line 7 "/home/production/cxgn/sgn/mason/barcode/index.mas"
     @projects = exists $pos{'projects'} ? HTML::Mason::Tools::coerce_to_array( $_[ $pos{'projects'} ], '@projects') :  ()   # [ id, name, description ]
;
#line 8 "/home/production/cxgn/sgn/mason/barcode/index.mas"
     @locations = exists $pos{'locations'} ? HTML::Mason::Tools::coerce_to_array( $_[ $pos{'locations'} ], '@locations') :  ()  # [ id, description ]
;
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->print( '
' );
#line 5 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->print( '
' );
#line 10 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->print( '
' );
#line 11 "/home/production/cxgn/sgn/mason/barcode/index.mas"

use DateTime;
my $dt = DateTime->from_epoch( epoch=>time );
my $date = join "/", ($dt->year, $dt->month, $dt->day);
#line 16 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->print( '
' );
#line 17 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->comp(   '/page/page_title.mas', title=>"Barcode Tools"   
); #line 17 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->print( '

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

<div class="well well-sm">
<div class="row">
  <div class="col-md-1 col-lg-1">
  </div>
  <div class="col-md-10 col-lg-10">

<form class="form-horizontal" role="form" action="/barcode/generate">
  <div class="form-group form-group-sm">
    <label class="col-sm-2 control-label">Barcode Text: </label>
    <div class="col-sm-10">
      <input type="text" class="form-control" name="text" />
    </div>
  </div>
  <div class="form-group form-group-sm">
    <label class="col-sm-2 control-label">Small: </label>
    <div class="col-sm-10">
      <input type="radio" name="size" value="small" checked="1" />
    </div>
  </div>
  <div class="form-group form-group-sm">
    <label class="col-sm-2 control-label">Large: </label>
    <div class="col-sm-10">
      <input type="radio" name="size" value="large" />
    </div>
  </div>

  <button style="float:right" type="submit" class="btn btn-info btn-sm" type="submit" value="Generate barcode">Generate Barcode</button>
</form>

<br/>

  </div>
  <div class="col-md-1 col-lg-1">
  </div>
</div>
</div>

' );
#line 58 "/home/production/cxgn/sgn/mason/barcode/index.mas"
} }, '/page/info_section.mas', title=>'Generate Barcode', collapsible=>1, collapsed=>1
 );
#line 58 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->print( '

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

<div class="well well-sm">
<div class="row">
  <div class="col-md-1 col-lg-1">
  </div>
  <div class="col-md-10 col-lg-10">

<form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/barcode/stock/download/pdf" >
  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Enter a List of Stock Names: </label>
    <div class="col-sm-8">
      <textarea class="form-control" id="stock_names" name="stock_names" ></textarea>
    </div>
  </div>
  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Or Paste From a List: </label>
    <div class="col-sm-8">
      <div id="list_menu_location_1"></div>
<script defer="defer">
  jQuery(document).ready(function() {
      pasteListMenu(\'stock_names\', \'list_menu_location_1\');

      $(document).on(\'change\', \'#select_barcode_type\', function () {
          var barcode_type = jQuery("#select_barcode_type").val();
          if (barcode_type == "2D") {
              jQuery("#2D_fieldbook_option").show();
          }
          else if (barcode_type == "1D") {
            jQuery("#2D_fieldbook_option").hide();
          }
      });

      jQuery(\'#custom_barcode_link\').click(function () {
          location.href = \'/tools/label_designer\';
      });

      $(document).on(\'change\', \'#select_print_format\', function () {
          var format = jQuery("#select_print_format").val();
          if (format == "32A4") {
            var label_row = 10;
            var label_cols = 4;
            var tops_margin = 12;
            var left_margin = 17;
            var bottom_margin = 12;
            var right_margin = 10;
          }
          if (format == "32_unique") {
            var label_row = 10;
            var label_cols = 4;
            var tops_margin = 12;
            var left_margin = 17;
            var bottom_margin = 12;
            var right_margin = 10;
          }
          else if (format == "CASS") {
          var label_row = 10;
          var label_cols = 2;
          var tops_margin = 10;
          var left_margin = 112;
          var bottom_margin = 13;
          var right_margin = 20;
          }
          else if (format == "MUSA") {
          var label_row = 10;
          var label_cols = 2;
          var tops_margin = 10;
          var left_margin = 112;
          var bottom_margin = 13;
          var right_margin = 20;
          }
          else if (format == "NCSU") {
          var label_row = 10;
          var label_cols = 3;
          var tops_margin = 12;
          var left_margin = 10;
          var bottom_margin = 12;
          var right_margin = 10;
          var text = \'year,location\';
          }
          else if (format == "20A4") {
          var label_row = 10;
          var label_cols = 2;
          var tops_margin = 12;
          var left_margin = 10;
          var bottom_margin = 12;
          var right_margin = 10;
          }
          else if (format == "IITA-3") {
          var label_row = 20;
          var label_cols = 3;
          var tops_margin = 13;
          var left_margin = 130;
          var bottom_margin = 11;
          var right_margin = 10;
          }
          else if (format == "IITA-2") {
          var label_row = 20;
          var label_cols = 2;
          var tops_margin = 13;
          var left_margin = 130;
          var bottom_margin = 11;
          var right_margin = 10;
          }
          else if (format == "crossing") {
          var label_row = 1;
          var label_cols = 1;
          var tops_margin = 5;
          var left_margin = 2;
          var bottom_margin = 0;
          var right_margin = 0;
          }
          jQuery("#text_margin").empty();
          jQuery("#text_margin").val(text);
          jQuery("#label_rows").empty();
          jQuery("#label_rows").val(label_row);
          jQuery("#label_cols").empty();
          jQuery("#label_cols").val(label_cols);
          jQuery("#select_barcode_type").prop(\'selectedIndex\',1);
          jQuery("#page_format").prop(\'selectedIndex\',0);
          jQuery("#tops_margin").empty();
          jQuery("#tops_margin").val(tops_margin);
          jQuery("#left_margin").empty();
          jQuery("#left_margin").val(left_margin);
          jQuery("#bottom_margin").empty();
          jQuery("#bottom_margin").val(bottom_margin);
          jQuery("#right_margin").empty();
          jQuery("#right_margin").val(right_margin);
      });
  });
</script>
    </div>
  </div>

  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Barcode Type: </label>
    <div class="col-sm-8">
        <select class="form-control" id="select_barcode_type" name="select_barcode_type">
          <option value="2D">2D Barcode</option>
          <option value="1D">1D Barcode</option>
        </select>
    </div>
  </div>

  <div id="2D_fieldbook_option" >
  <div class="form-group form-group-sm" >
    <label class="col-sm-4 control-label">Enable 2D Barcode For FieldBook: </label>
    <div class="col-sm-8">
      <input type="checkbox" id="enable_fieldbook_2d_barcode" name="enable_fieldbook_2d_barcode" value="enable_fieldbook_2d_barcode" checked/>
    </div>
  </div>
  </div>

  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Printing Format (Optional): </label>
    <div class="col-sm-8">
        <select class="form-control" id="select_print_format" name="select_print_format">
          <!--<option selected disabled>select printing format</option>-->
          <option value="">select printing format</option>
          <option value="20A4">20 label Size Sticker Paper</option>
          <option value="32A4">32 label Size Sticker Paper</option>
          <option value="32_unique">32 Unique label Size Sticker Paper</option>
          <option value="CASS">CASS printing format</option>
          <option value="crossing">CROSS</option>
          <option value="IITA-2">IITA-2-barcode</option>
          <option value="IITA-3">IITA-3-barcode</option>
          <option value="MUSA">MUSA printing format</option>
          <option value="NCSU">NCSU printing format</option>
        </select>
    </div>
  </div>

  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Or Upload <font size="3" color="#5bc0de">Tab-delimited Text File</font> With Stock Names: </label>
    <div class="col-sm-8">
      <input type="file" name="stock_names_file" />
    </div>
  </div>
  <div class="form-group form-group-sm" style="display: none">
    <label class="col-sm-4 control-label">Print Duplicate Labels Per Row: </label>
    <div class="col-sm-8">
      <input type="checkbox" name="duplicate_labels_per_row" checked="1" disabled="1" />
    </div>
  </div>
    <!--<div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Print Field Information For Plots: </label>
    <div class="col-sm-8">
      <input type="checkbox" name="plots" value="plots" /> &nbsp; &nbsp; &nbsp; Useful for Printing Field Information of Trials.
    </div>
  </div>-->
  <!--<div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Print Parents For Nurseries: </label>
    <div class="col-sm-8">
      <input type="checkbox" name="nursery" value="nursery" /> &nbsp; &nbsp; &nbsp; Useful for Printing Pedigree Information for Nurseries.
    </div>
  </div>-->

  ' );
#line 257 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->comp(   '/barcode/printer_settings.mas'  
); #line 257 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->print( '

  <button style="float:right" type="submit" class="btn btn-info btn-sm" type="submit" value="Download Barcodes">Download Barcodes</button>
  <button style="float:right" class="btn btn-default btn-sm" type="reset" >Clear</button>
</form>

<br/>

  </div>
  <div class="col-md-1 col-lg-1">
  </div>
</div>
</div>

<br/>

' );
#line 273 "/home/production/cxgn/sgn/mason/barcode/index.mas"
} }, '/page/info_section.mas', title=>'Download Stock Barcodes', collapsible=>1, collapsed=>0, subtitle=>'<button type="button" class="btn btn-primary" name="custom_barcode_link" id="custom_barcode_link">Design Custom Barcode</button>'
 );
#line 273 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->print( '

<!-- phenotyping barcode -->

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

<div class="well well-sm">
<div class="row">
  <div class="col-md-1 col-lg-1">
  </div>
  <div class="col-md-10 col-lg-10">

<form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/barcode/stock/download/plot_QRcode" >
  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Enter a List of Stock Names: </label>
    <div class="col-sm-8">
      <textarea class="form-control" id="stock_names_2" name="stock_names_2" ></textarea>
    </div>
  </div>
  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Or Paste From a List: </label>
    <div class="col-sm-8">
      <div id="list_menu_location_2"></div>
<script defer="defer">
  jQuery(document).ready(function() {
      pasteListMenu(\'stock_names_2\', \'list_menu_location_2\', \'paste\', \'plots\');
  });

</script>
    </div>
  </div>
  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Or Upload <font size="3" color="#5bc0de">Tab-delimited Text File</font> With Stock Names: </label>
    <div class="col-sm-8">
      <input type="file" name="stock_names_file_2" />
    </div>
  </div>

  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Add Text to Label, e.g. location: </label>
    <div class="col-sm-8">
        <input class="form-control" id="select_barcode_text" name="select_barcode_text"></input>
    </div>
  </div>

<!--  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Print Duplicate Labels Per Row: </label>
    <div class="col-sm-8">
      <input type="checkbox" name="duplicate_labels_per_row" checked="1" disabled="1" />
    </div>
    </div> -->

' );
#line 325 "/home/production/cxgn/sgn/mason/barcode/index.mas"
#  <& /barcode/printer_settings.mas &> #%
$m->print( '
  <button style="float:right" type="submit" class="btn btn-info btn-sm" type="submit" value="Download Barcodes">Download Barcodes</button>
  <button style="float:right" class="btn btn-default btn-sm" type="reset" >Clear</button>
</form>

<br/>

  </div>
  <div class="col-md-1 col-lg-1">
  </div>
</div>
</div>

<br/>

' );
#line 341 "/home/production/cxgn/sgn/mason/barcode/index.mas"
} }, '/page/info_section.mas', title=>'Download Plot Phenotyping Barcodes', collapsible=>1, collapsed=>0
 );
#line 341 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->print( '

<!-- Trial barcode -->

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

<div class="well well-sm">
<div class="row">
  <div class="col-md-1 col-lg-1">
  </div>
  <div class="col-md-10 col-lg-10">

<form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="/barcode/trial/download/trial_QRcode" >
  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Enter a List of Trial Names: </label>
    <div class="col-sm-8">
      <textarea class="form-control" id="trial_names_2" name="trial_names_2" ></textarea>
    </div>
  </div>
  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Or Paste From a List: </label>
    <div class="col-sm-8">
      <div id="list_menu_location_3"></div>
<script defer="defer">
  jQuery(document).ready(function() {
      pasteListMenu(\'trial_names_2\', \'list_menu_location_3\', \'paste\', \'trials\');
  });

</script>
    </div>
  </div>
  <div class="form-group form-group-sm">
    <label class="col-sm-4 control-label">Or Upload <font size="3" color="#5bc0de">Tab-delimited Text File</font> With Trial Names: </label>
    <div class="col-sm-8">
      <input type="file" name="trial_names_file_2" />
    </div>
  </div>

  <button style="float:right" type="submit" class="btn btn-info btn-sm" type="submit" value="Download Barcodes">Download Barcodes</button>
  <button style="float:right" class="btn btn-default btn-sm" type="reset" >Clear</button>
</form>

<br/>

  </div>
  <div class="col-md-1 col-lg-1">
  </div>
</div>
</div>

<br/>

' );
#line 393 "/home/production/cxgn/sgn/mason/barcode/index.mas"
} }, '/page/info_section.mas', title=>'Download Trial Barcodes', collapsible=>1, collapsed=>0
 );
#line 393 "/home/production/cxgn/sgn/mason/barcode/index.mas"
$m->print( '

' );
#line 395 "/home/production/cxgn/sgn/mason/barcode/index.mas"
#<&| /page/info_section.mas, title=>'Generate unique barcodes', collapsible=>1, collapsed=>0 &>
$m->print( '
' );
#line 397 "/home/production/cxgn/sgn/mason/barcode/index.mas"
#<form action="/barcode/unique" >
$m->print( '
' );
#line 399 "/home/production/cxgn/sgn/mason/barcode/index.mas"
#  Number of label pages to print <input type="text" name="label_pages" /><br /><br />
$m->print( '
' );
#line 401 "/home/production/cxgn/sgn/mason/barcode/index.mas"
#  <& /barcode/printer_settings.mas &>
#    <br />
#  <input type="submit" value="Generate barcodes" />
#  </form>
$m->print( '
' );
#line 406 "/home/production/cxgn/sgn/mason/barcode/index.mas"
#</& >
;return;
},
'declared_args' => {
  '@locations' => { default => ' ()  # [ id, description ]' },
  '@projects' => { default => ' ()   # [ id, name, description ]' }
},
'load_time' => 1763123543,

)
;