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

#line 1 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '
' );
#line 6 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '
' );
#line 7 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"


sub n2a {
  my ($n) = @_;
  my @a;
  while ($n > 0) {
    unshift @a, ($n-1) % 26;
    $n = int(($n-1)/26); #Edited for failing corner case
  }
  join '', map chr(ord('A') + $_), @a;
}

#line 20 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '
<center>
<br/>
<h1>File Viewer</h1>
<br/>
</center>

<div class="panel panel-info">
	<div class="panel-heading">
		<h3>File Info</h3>
	</div>
	<div class="panel-body">
		<table class="table">
		<thead>
		<tr>
		<th>Filename</th>
		<th>File Type</th>
		<th>Number of Sheets</th>
		<th>Parser</th>
		</tr>
		</thead>
		<tbody>
		<tr>
		<td>' );
#line 43 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  $filename  );
#line 43 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '</td>
		<td>' );
#line 44 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  @$file_content[0]->[0]->{type}  );
#line 44 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '</td>
		<td>' );
#line 45 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  @$file_content[0]->[0]->{sheets}  );
#line 45 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '</td>
		<td>' );
#line 46 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  @$file_content[0]->[0]->{parser}  );
#line 46 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( ' (' );
#line 46 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  @$file_content[0]->[0]->{version}  );
#line 46 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( ')</td>
		</tr>
		</tbody>
		</table>
	</div>
</div>

' );
#line 53 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 my $num_sheets = @$file_content[0]->[0]->{sheets};
$m->print( '
<div class="panel panel-info">
	<div class="panel-heading">
		<h3>File Contents</h3>
	</div>
	<div class="panel-body">

	<ul class="nav nav-tabs" role="tablist">

' );
#line 63 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 for ( my $s=1; $s<=$num_sheets; $s++) {
$m->print( '	
' );
#line 65 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 my $sheet_label = @$file_content[0]->[$s]->{label};
 $sheet_label =~ s/\s+//g;
$m->print( '
' );
#line 68 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 if ($s ==1 ){
$m->print( '		<li role="presentation" class="active"><a href="#' );
#line 69 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  $sheet_label  );
#line 69 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '" aria-controls="' );
#line 69 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  $sheet_label  );
#line 69 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '" role="tab" data-toggle="tab">' );
#line 69 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  $sheet_label  );
#line 69 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '</a></li>
' );
#line 70 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 } else {
$m->print( '		<li role="presentation"><a href="#' );
#line 71 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  $sheet_label  );
#line 71 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '" aria-controls="' );
#line 71 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  $sheet_label  );
#line 71 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '" role="tab" data-toggle="tab">' );
#line 71 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  $sheet_label  );
#line 71 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '</a></li>
' );
#line 72 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 }
$m->print( '
' );
#line 74 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 }
$m->print( '
	</ul>

	<div class="tab-content">

' );
#line 80 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 for (my $i=1; $i<=$num_sheets; $i++) {
$m->print( '
' );
#line 82 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 my $max_row = @$file_content[0]->[$i]->{maxrow};
 my $max_col = @$file_content[0]->[$i]->{maxcol};
$m->print( '
' );
#line 85 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 my $sheet_label = @$file_content[0]->[$i]->{label};
 $sheet_label =~ s/\s+//g;
$m->print( '
' );
#line 88 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 if ($i == 1) {
$m->print( '		<div role="tabpanel" class="tab-pane fade in active" id="' );
#line 89 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  $sheet_label  );
#line 89 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '">
' );
#line 90 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 } else {
$m->print( '		<div role="tabpanel" class="tab-pane fade" id="' );
#line 91 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  $sheet_label  );
#line 91 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '">
' );
#line 92 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 }
$m->print( '
			<table class="table table-hover table-bordered">
				<thead>
				<tr>

' );
#line 98 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 my $max_aa = n2a(@$file_content[0]->[$i]->{maxcol});
 foreach ('A'..$max_aa) {
$m->print( '				<th>' );
#line 100 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  @$file_content[0]->[$i]->{$_.'1'}  );
#line 100 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '</th>
' );
#line 101 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 }
$m->print( '				</tr>
				</thead>
				<tbody>

' );
#line 106 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 for (my $j=2; $j<=$max_row; $j++) {
$m->print( '
				<tr>

' );
#line 110 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 foreach ('A'..$max_aa) {
$m->print( '	
				<td>' );
#line 112 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print(  @$file_content[0]->[$i]->{$_.$j}  );
#line 112 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
$m->print( '</td>

' );
#line 114 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 }
$m->print( '				</tr>

' );
#line 117 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 }
$m->print( '
				</tbody>
			</table>
		</div>
' );
#line 122 "/home/production/cxgn/sgn/mason/breeders_toolbox/view_file.mas"
 }
$m->print( '
	</div>

</div>
</div>




' );
;return;
},
'declared_args' => {
  '$file_content' => { default => ' undef' },
  '$filename' => { default => ' undef' }
},
'load_time' => 1763107475,

)
;