a89c7bf2590020e27a1d8256093bb44f86c0bede
[working/Evergreen.git] / Open-ILS / src / templates / opac / results.tt2
1 [%- PROCESS "opac/parts/header.tt2";
2     WRAPPER "opac/parts/base.tt2";
3     INCLUDE "opac/parts/topnav.tt2";
4
5     IF is_advanced || is_special;
6         ctx.page_title = l("Search Results");
7     ELSE;
8         ctx.page_title = l("Search Results: ") _ CGI.param('query') | html;
9     END;
10
11     page = CGI.param('page');
12     page = page.match('^\d+$') ? page : 0; # verify page is a sane value
13
14     page_count = (!ctx.page_size.defined || !ctx.hit_count.defined || ctx.page_size == 0) ? 1 : POSIX.ceil(ctx.hit_count / ctx.page_size);
15
16     # We don't want search engines indexing search results
17     ctx.metalinks.push('<meta name="robots" content="noindex">');
18
19     PROCESS "opac/parts/misc_util.tt2";
20     PROCESS get_library;
21 -%]
22     <h2 class="sr-only">[% l('Search Results') %]</h2>
23     <form action="[% ctx.opac_root %]/results" method="get">
24     [% INCLUDE "opac/parts/searchbar.tt2" took_care_of_form=1 %]
25     <h3 class="sr-only">[% l('Additional search filters and navigation') %]</h3>
26     <div class="almost-content-wrapper">
27
28         [%# hide the header bar when displaying metarecord constituents
29           instead of skipping it altogether to allow the search form
30           variables to propagate %]
31         [% IF ctx.metarecord;
32           mr_attrs = {marc_xml => ctx.metarecord_master.marc_xml};
33           PROCESS get_marc_attrs args=mr_attrs %]
34           <div class="results_header_lbl">
35             [% l('Viewing Results for Grouped Record: [_1]',
36                 mr_attrs.title) | html %]
37           </div>
38           [% IF CGI.param('query') %]
39           <div>
40             <a href="[% mkurl(ctx.opac_root _ '/results', {}, ['metarecord']); %]" rel="nofollow" vocab="">
41               [% l('&#9668; Return to Grouped Search Results') %]
42             </a>
43           </div>
44           <br/>
45           [% END %]
46         [% END %]
47         <div id="results_header_bar" [%- IF ctx.metarecord %]class="hidden"[% END -%]>
48             <div id="results_header_inner">
49                 <div class="results_header_btns">
50                     <a href="[% mkurl(ctx.opac_root _ '/home', {$loc_name => loc_value}, 1) %]" rel="nofollow" vocab="">[% l('Another Search') %]</a>
51                 </div>
52                 <div class="results_header_btns">
53                     <a href="[% mkurl(ctx.opac_root _ '/advanced',{}, expert_search_parms.merge(browse_search_parms, facet_search_parms)) %]" rel="nofollow" vocab="">[% l('Advanced Search') %]</a>
54                 </div>
55                 <div id="refine_hits" class="results_header_btns result_block_visible"><a onclick="getFacety();">[% l('Refine these results') %]</a></div>
56                 <div id="return_to_hits" class="results_header_btns"><a onclick="getResulty();">[% l('Back to results') %]</a></div>
57                 [% IF ctx.mylist.size %]
58                 <div class="results_header_btns">
59                     [%- IF ctx.user; %]
60                     <a href="[% mkurl(ctx.opac_root _ '/myopac/lists') %]">[% l('View My List') %]</a>
61                     [%- ELSE %]
62                     <a href="[% mkurl(ctx.opac_root _ '/mylist') %]" rel="nofollow" vocab="">[% l('View My List') %]</a>
63                     [%- END %]
64                 </div>
65                 [% END %]
66                     <label class="results_header_lbl" for="opac.result.sort">[% l('Sort by') %]
67                     [% INCLUDE "opac/parts/filtersort.tt2" value=CGI.param('sort') submit_on_change=1 %]
68                     </label>
69
70                     [%- IF show_more_details.default != 'hide' -%]
71                     <div class='results_header_sel' id='simple-detail-view-links'>
72                         [% IF CGI.param('detail_record_view') %]
73                         <a href="[% mkurl('', {detail_record_view => ''}) %]" rel="nofollow" vocab="">[% l('Show Fewer Details') %]</a> [% ELSE %]
74                         <a href="[% mkurl('', {detail_record_view => 1}) %]" rel="nofollow" vocab="">[% l('Show More Details') %]</a>
75                         [% END %]
76                     </div>
77                     [%- END -%]
78                     <label class="results_header_lbl" for="limit_to_available">
79                         <input type="checkbox" id="limit_to_available" name="modifier" value="available"
80                             onchange="search_modifier_onchange('available', this, true)"
81                             [% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %] />
82                         [% l('Limit to Available Items') %]
83                     </label>
84                     [% IF NOT metarecords.disabled %]
85                         <label class="results_header_lbl" for="metabib_search_modifier">
86                             <input type="checkbox" id="metabib_search_modifier"
87                                 name="modifier" value="metabib"
88                                 onchange="search_modifier_onchange('metabib', this, true)"
89                                 [% CGI.param('modifier').grep('metabib').size ? ' checked="checked"' : '' %] />
90                             [% l('Group Formats and Editions') %]
91                         </label>
92                     [% END %]
93                     [% IF ctx.depth_sel_checkbox %]
94                     <label class="results_header_lbl" for="depth_sel" title="[% ctx.depth_sel_tooltip | html %]">
95                         <input type="checkbox" id="depth_sel" name="depth" value="[% ctx.depth_sel_depth %]"
96                             onchange="this.form.submit()"
97                             [% CGI.param('depth') == ctx.depth_sel_depth ? ' checked="checked"' : '' %] />
98                         [% ctx.depth_sel_checkbox_label | html %]
99                     </label>
100                     [% END %]
101                     [%- IF CGI.param('detail_record_view')
102                         OR (show_more_details.default == 'true'
103                         OR show_more_details.default == 'hide');
104                     -%]
105                         <input type="hidden" name="detail_record_view" value="1" />
106                     [% END %]
107                     [% IF ctx.exclude_electronic_checkbox %]
108                     <label class="results_header_lbl" for='opac.result.excludeelec'>
109                         <input type='checkbox' id='opac.result.excludeelec' name="fi:-search_format" value="electronic"
110                             onchange="exclude_onchange(this)"
111                             [%- CGI.param('fi:-search_format').grep('electronic').size ? ' checked="checked"' : '' %] />
112                         [% l("Exclude Electronic Resources") %]
113                     </label>
114                     [% END %]
115             </div>
116         </div>
117     </div>
118     </form>
119     <div id="content-wrapper">
120         <div id="main-content">
121             <div id="results-page">
122                 [%- IF (ctx.depth_sel_checkbox OR ctx.depth_sel_button) AND CGI.param('depth') == ctx.depth_sel_depth AND ctx.depth_sel_resultshint %]
123                 <div id="results-page-depth-hint">[% ctx.depth_sel_resultshint | html %]</div>
124                 [%- END %]
125                 [% path = "opac/parts/result/" _
126                     (ctx.records.size ? "table.tt2" : "lowhits.tt2");
127                 INCLUDE $path %]
128             </div>
129             <div class="common-full-pad"></div>
130         </div>
131         <br class="clear-both" />
132     </div>
133 [%- END %]