}
}
- my $site = $cgi->param('loc') || $ctx->{aou_tree}->()->id;
- if (defined($cgi->param('loc')) or not $query =~ /site\(\d+\)/) {
+ my $site = $cgi->param('loc');
+ if (defined($site) and ($site ne $ctx->{aou_tree}->()->id) and not $query =~ /site\(\d+\)/) {
$query .= " site($site)";
}
- if (defined($cgi->param('depth')) or not $query =~ /depth\(\d+\)/) {
+ if (defined($cgi->param('depth')) and not $query =~ /depth\(\d+\)/) {
my $depth = defined $cgi->param('depth') ?
$cgi->param('depth') : $ctx->{find_aou}->($site)->ou_type->depth;
$query .= " depth($depth)";
propagator = '?' _ query_string;
+ is_advanced = CGI.param("_adv").size;
+
formats = [ # XXX KCLS-specific
{'code' => 'a', 'name' => 'Book', 'image' => 'media_book.jpg'},
{'code' => 'i', 'name' => 'Book on cassette', 'image' => 'media_bookoncasset.jpg'},
<td>
[% INCLUDE "default/opac/parts/qtype_selector.tt2" %]
</td>
- <td>
[% END %]
+ [% IF ctx.processed_search_query OR NOT is_advanced %]
+ <td>
<div id="search_box_wrapper">
<!-- Note: when common browsers support HTML5 placeholder text, we can remove the JS -->
<input type="text" id="search_box" name="query" value="[% is_advanced ? ctx.processed_search_query : CGI.param('query') || l("Search Keyword") | html %]"
</div>
</div>
</td>
+ [% END %]
</tr>
[% UNLESS is_advanced %]
<tr>
[% END %]
</table>
[% UNLESS took_care_of_form %]</form>[% END %]
- [% IF is_advanced %]
+ [% IF is_advanced AND CGI.param('qtype') %]
<div class="opac-auto-102">
[ <a href="[% ctx.opac_root %]/advanced?[% query_string %]">[%
- l('Click to Refine Your Search')
+ l('Click to Refine Your Original Search')
%]</a> ]
</div>
[% END %]
WRAPPER "default/opac/parts/base.tt2";
INCLUDE "default/opac/parts/topnav.tt2";
ctx.page_title = l("Search Results");
- is_advanced = CGI.param("_adv").size;
page = CGI.param('page') || 0;
page_count = POSIX.ceil(ctx.hit_count / ctx.page_size);
</div>
[% END %]
<div class="results_header_div"></div>
- [% UNLESS CGI.param('_adv') %]
+ [% UNLESS is_advanced %]
<div class="results_header_lbl">Sort by</div>
[% INCLUDE "default/opac/parts/filtersort.tt2" value=CGI.param('sort') %]
<div class="results_header_div"></div>