if a variable is displayed, show trait properties section, otherwise do not.
[sgn.git] / mason / search / quick_search.mas
blob5b5a72e1726f2f1524cee04c5a92cdfb10d37f42
1 <%args>
3   $results
5   $quick_search_term
7   $show_times => 0
9   $xrefs      => {}
10   $xrefs_time => 0
12 </%args>
14 <& /page/page_title.mas, title => 'Quick search for '.encode_entities( '"'.$quick_search_term.'"' ) &>
16 <div class="page_introduction">
17   Note: The quick search does not perform exactly the same queries as
18   full searches for the various data types.  If your desired result
19   does not appear, you may want to try again with one of the advanced
20   search tools in the "search" menu.
21 </div>
23 <&| /page/info_section.mas, title => 'Exact matches' &>
25 <div class="well">
27 % if( $show_times ) {
28   <div>Site xref search time: <% sprintf('%0.1f sec', $xrefs_time) %></div>
29 % }
30 % if( @$xrefs ) {
31   <& /sitefeatures/mixed/xref_set/link.mas, xrefs => $xrefs &>
32     <hr style="border: 0; border-bottom: 1px solid #aaa; width: 90%; margin: 1.5em auto 1.2em auto"  />
33 % }
35   <div>
36     <dl>
37       <dt>Identifiers - Breeding Data</dt>
38       <dd>
39         <div style="float: left; width: 50%">
40           <% $search{accessions} %>
41           <% $search{populations} %>
42           <% $search{vectors} %>
43           <% $search{trials} %>
44         </div>
45         <div style="float: right; width: 50%">
46           <% $search{traits} %>
47           <% $search{locations} %>
48           <% $search{breeding_programs} %>
49         </div>
50         <div style="clear: both;">&nbsp;</div>
51       </dd>
52       <dt>Identifiers - Genomic Data</dt>
53       <dd >
54         <div style="float: left; width: 50%">
55           <% $search{marker} %>
56           <% $search{clone} %>
57           <% $search{est} %>
58         </div>
59         <div style="float: right; width: 50%;">
60           <% $search{unigene} %>
61           <% $search{microarray} %>
62         </div>
63       </dd>
64     </dl>
65     <span style="margin-bottom:20px;">&nbsp</span>
66   </div>
67 </div>
69 </&>
71 <&| /page/info_section.mas,
72     title => 'Fuzzy searches',
73     subtitle => 'click to view search results',
74  &>
76 <div class="well">
77   
78   <div>
79     <dl>
80     <dt>
81       <div style="float: left; width: 50%">Identifiers</div>
82       <div style="float: right; width: 50%">cDNA Libraries</div>
83     </dt>
84     <dd>
85       <div style="float: left; width: 50%">
86         <% $search{bac} %>
87         <% $search{phenotype} %>
88       </div>
89       <div style="float: right; width: 50%">
90         <% $search{locus_allele} %>
91         <% $search{library} %>
92       </div>
93       <div style="clear: both; margin-bottom: -1.7em">&nbsp;</div>
94     </dd>
95     </dl>
96   </div>
98   <hr style="border: 0; border-bottom: 1px solid #aaa; width: 90%; margin: 1.5em auto 1.2em auto"  />
100   <div>
101     <dl>
102     <dt>
103       <div style="float: left; width: 50%">People (searching by name)</div>
104       <div style="float: right; width: 50%">Annotations</div>
105     </dt>
106     <dd>
107       <div style="float: left; width: 50%">
108         <% $search{people} %>
109       </div>
110       <div style="float: right; width: 50%">
111         <% $search{manual_annotations} %>
112         <% $search{automatic_annotations} %>
113       </div>
114       <div style="clear: both; margin-bottom: -1.7em">&nbsp;</div>
115     </dd>
116     </dl>
117   </div>
119   <hr style="border: 0; border-bottom: 1px solid #aaa; width: 90%; margin: 1.5em auto 1.2em auto"  />
121   <div>
122     <dl>
123     <dt>
124       <div style="float: left; width: 50%">Images</div>
125       <div style="float: right; width: 50%">Web Pages</div>
126     </dt>
127     <dd>
128       <div style="float: left; width: 50%">
129         <% $search{image} %>
130       </div>
131       <div style="float: right; width: 50%">
132         <% $search{sgn_pages} %>
133         <% $search{external_link} %>
134         <% $search{web} %>
135       </div>
136       <div style="clear: both; margin-bottom: -1.7em">&nbsp;</div>
137     </dd>
138     </dl>
139   </div>
141 </div>
143 </&>
145 <%init>
147   use HTML::Entities;
149   my %search = %$results;
150   for my $search ( values %search ) {
151       my ( $url, $desc ) = @{$search->{result}};
152       my $time  = $show_times ? sprintf(' (%0.1f sec)', $search->{time}) : '';
153       my $html = $url ? qq|<div><a class="quicksearch_hit" href="$search->{result}[0]">$search->{result}[1]$time</a></div>|
154                       : qq|<div class="ghosted">$desc$time</div>|;
155       $search = $html;
156   }
158 </%init>