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

    foreach my $arg ( qw( results quick_search_term ) )
    {
        HTML::Mason::Exception::Params->throw
            ( error => "no value sent for required parameter '$arg'" )
                unless exists $pos{$arg};
    }
#line 3 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
    $results = $_[ $pos{'results'} ];
#line 5 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
    $quick_search_term = $_[ $pos{'quick_search_term'} ];
#line 7 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
     $show_times = exists $pos{'show_times'} ? $_[ $pos{'show_times'} ] :  0;
#line 9 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
     $xrefs = exists $pos{'xrefs'} ? $_[ $pos{'xrefs'} ] :  {};
#line 10 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
     $xrefs_time = exists $pos{'xrefs_time'} ? $_[ $pos{'xrefs_time'} ] :  0;
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 145 "/home/production/cxgn/sgn/mason/search/quick_search.mas"


  use HTML::Entities;

  my %search = %$results;
  for my $search ( values %search ) {
      my ( $url, $desc ) = @{$search->{result}};
      my $time  = $show_times ? sprintf(' (%0.1f sec)', $search->{time}) : '';
      my $html = $url ? qq|<div><a class="quicksearch_hit" href="$search->{result}[0]">$search->{result}[1]$time</a></div>|
                      : qq|<div class="ghosted">$desc$time</div>|;
      $search = $html;
  }

#line 13 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
' );
#line 14 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->comp(   '/page/page_title.mas', title => 'Quick search for '.encode_entities( '"'.$quick_search_term.'"' )   
); #line 14 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '

<div class="page_introduction">
  Note: The quick search does not perform exactly the same queries as
  full searches for the various data types.  If your desired result
  does not appear, you may want to try again with one of the advanced
  search tools in the "search" menu.
</div>

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

<div class="well">

' );
#line 27 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
 if( $show_times ) {
$m->print( '  <div>Site xref search time: ' );
#line 28 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  sprintf('%0.1f sec', $xrefs_time)  );
#line 28 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '</div>
' );
#line 29 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
 }
 if( @$xrefs ) {
$m->print( '  ' );
#line 31 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->comp(   '/sitefeatures/mixed/xref_set/link.mas', xrefs => $xrefs   
); #line 31 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
    <hr style="border: 0; border-bottom: 1px solid #aaa; width: 90%; margin: 1.5em auto 1.2em auto"  />
' );
#line 33 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
 }
$m->print( '
  <div>
    <dl>
      <dt>Identifiers - Breeding Data</dt>
      <dd>
	<div style="float: left; width: 50%">
	  ' );
#line 40 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{accessions}  );
#line 40 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
	  ' );
#line 41 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{populations}  );
#line 41 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
	  ' );
#line 42 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{vectors}  );
#line 42 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
	  ' );
#line 43 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{trials}  );
#line 43 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
	</div>
	<div style="float: right; width: 50%">
	  ' );
#line 46 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{traits}  );
#line 46 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
	  ' );
#line 47 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{locations}  );
#line 47 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
	  ' );
#line 48 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{breeding_programs}  );
#line 48 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
	</div>
	<div style="clear: both;">&nbsp;</div>
      </dd>
      <dt>Identifiers - Genomic Data</dt>
      <dd >
	<div style="float: left; width: 50%">
          ' );
#line 55 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{marker}  );
#line 55 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
          ' );
#line 56 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{clone}  );
#line 56 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
          ' );
#line 57 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{est}  );
#line 57 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
	</div>
	<div style="float: right; width: 50%;">
	  ' );
#line 60 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{unigene}  );
#line 60 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
	  ' );
#line 61 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{microarray}  );
#line 61 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
	</div>
      </dd>
    </dl>
    <span style="margin-bottom:20px;">&nbsp</span>
  </div>
</div>

' );
#line 69 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
} }, '/page/info_section.mas', title => 'Exact matches'
 );
#line 69 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '

' );
#line 71 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->comp( { content => sub {
#line 74 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '

<div class="well">
  
  <div>
    <dl>
    <dt>
      <div style="float: left; width: 50%">Identifiers</div>
      <div style="float: right; width: 50%">cDNA Libraries</div>
    </dt>
    <dd>
      <div style="float: left; width: 50%">
        ' );
#line 86 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{bac}  );
#line 86 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
        ' );
#line 87 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{phenotype}  );
#line 87 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
      </div>
      <div style="float: right; width: 50%">
	' );
#line 90 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{locus_allele}  );
#line 90 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
        ' );
#line 91 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{library}  );
#line 91 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
      </div>
      <div style="clear: both; margin-bottom: -1.7em">&nbsp;</div>
    </dd>
    </dl>
  </div>

  <hr style="border: 0; border-bottom: 1px solid #aaa; width: 90%; margin: 1.5em auto 1.2em auto"  />

  <div>
    <dl>
    <dt>
      <div style="float: left; width: 50%">People (searching by name)</div>
      <div style="float: right; width: 50%">Annotations</div>
    </dt>
    <dd>
      <div style="float: left; width: 50%">
        ' );
#line 108 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{people}  );
#line 108 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
      </div>
      <div style="float: right; width: 50%">
        ' );
#line 111 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{manual_annotations}  );
#line 111 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
        ' );
#line 112 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{automatic_annotations}  );
#line 112 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
      </div>
      <div style="clear: both; margin-bottom: -1.7em">&nbsp;</div>
    </dd>
    </dl>
  </div>

  <hr style="border: 0; border-bottom: 1px solid #aaa; width: 90%; margin: 1.5em auto 1.2em auto"  />

  <div>
    <dl>
    <dt>
      <div style="float: left; width: 50%">Images</div>
      <div style="float: right; width: 50%">Web Pages</div>
    </dt>
    <dd>
      <div style="float: left; width: 50%">
        ' );
#line 129 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{image}  );
#line 129 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
      </div>
      <div style="float: right; width: 50%">
        ' );
#line 132 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{sgn_pages}  );
#line 132 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
        ' );
#line 133 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{external_link}  );
#line 133 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
        ' );
#line 134 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print(  $search{web}  );
#line 134 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
      </div>
      <div style="clear: both; margin-bottom: -1.7em">&nbsp;</div>
    </dd>
    </dl>
  </div>

</div>

' );
#line 143 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
} }, '/page/info_section.mas',
    title => 'Fuzzy searches',
    subtitle => 'click to view search results',
 );
#line 143 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '

' );
#line 159 "/home/production/cxgn/sgn/mason/search/quick_search.mas"
$m->print( '
' );
;return;
},
'declared_args' => {
  '$quick_search_term' => { default => undef },
  '$results' => { default => undef },
  '$show_times' => { default => ' 0' },
  '$xrefs' => { default => ' {}' },
  '$xrefs_time' => { default => ' 0' }
},
'load_time' => 1763081206,

)
;