92ae43ce7e0b1c8ce81e43ade3c922ec8a7ac993
[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     PROCESS "opac/parts/misc_util.tt2";
17     PROCESS get_library;
18 -%]
19     <h2 class="sr-only">[% l('Search Results') %]</h2>
20     <form action="[% ctx.opac_root %]/results" method="get">
21     [% INCLUDE "opac/parts/searchbar.tt2" took_care_of_form=1 %]
22     <h3 class="sr-only">[% l('Additional search filters and navigation') %]</h3>
23     <div class="almost-content-wrapper">
24
25         [%# hide the header bar when displaying metarecord constituents 
26           instead of skipping it altogether to allow the search form
27           variables to propagate %]
28         [% IF ctx.metarecord;
29           mr_attrs = {marc_xml => ctx.metarecord_master.marc_xml};
30           PROCESS get_marc_attrs args=mr_attrs %]
31           <div class="results_header_lbl">
32             [% l('Viewing Results for Grouped Record: [_1]', 
33                 mr_attrs.title) | html %]
34           </div>
35           [% IF CGI.param('query') %]
36           <div>
37             <a href="[% mkurl(ctx.opac_root _ '/results', {}, ['metarecord']); %]">
38               [% l('&#9668; Return to Grouped Search Results') %]
39             </a>
40           </div>
41           <br/>
42           [% END %]
43         [% END %]
44         <div id="results_header_bar" [%- IF ctx.metarecord %]class="hidden"[% END -%]>
45             <div id="results_header_inner">
46                 <div class="results_header_btns">
47                     <a href="[% mkurl(ctx.opac_root _ '/home', {$loc_name => loc_value}, 1) %]">[% l('Another Search') %]</a>
48                 </div>
49                 <div class="results_header_btns">
50                     <a href="[% mkurl(ctx.opac_root _ '/advanced',{}, expert_search_parms.merge(browse_search_parms, facet_search_parms)) %]">[% l('Advanced Search') %]</a>
51                 </div>
52                 <div id="refine_hits" class="results_header_btns result_block_visible"><a onclick="getFacety();">[% l('Refine these results') %]</a></div>
53                 <div id="return_to_hits" class="results_header_btns"><a onclick="getResulty();">[% l('Back to results') %]</a></div>
54                 [% IF ctx.mylist.size %]
55                 <div class="results_header_btns">
56                     [%- IF ctx.user; %]
57                     <a href="[% mkurl(ctx.opac_root _ '/myopac/lists') %]">[% l('View My List') %]</a>
58                     [%- ELSE %]
59                     <a href="[% mkurl(ctx.opac_root _ '/mylist') %]">[% l('View My List') %]</a>
60                     [%- END %]
61                 </div>
62                 [% END %]
63                     <label class="results_header_lbl" for="opac.result.sort">[% l('Sort by') %]
64                     [% INCLUDE "opac/parts/filtersort.tt2" value=CGI.param('sort') submit_on_change=1 %]
65                     </label>
66
67                     <div class='results_header_sel' id='simple-detail-view-links'>
68                         [% IF CGI.param('detail_record_view') %]
69                         <a href="[% mkurl('', {detail_record_view => ''}) %]">[% l('Show Fewer Details') %]</a> [% ELSE %]
70                         <a href="[% mkurl('', {detail_record_view => 1}) %]">[% l('Show More Details') %]</a>
71                         [% END %]
72                     </div>
73
74                     <label class="results_header_lbl" for="limit_to_available">
75                         <input type="checkbox" id="limit_to_available" name="modifier" value="available"
76                             onchange="search_modifier_onchange('available', this, true)"
77                             [% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %] />
78                         [% l('Limit to available items') %]
79                     </label>
80                     [% IF NOT metarecords.disabled %]
81                         <label class="results_header_lbl" for="metabib_search_modifier">
82                             <input type="checkbox" id="metabib_search_modifier"
83                                 name="modifier" value="metabib"
84                                 onchange="search_modifier_onchange('metabib', this, true)"
85                                 [% CGI.param('modifier').grep('metabib').size ? ' checked="checked"' : '' %] />
86                             [% l('Group Formats and Editions') %]
87                         </label>
88                     [% END %]
89                     [% IF CGI.param('detail_record_view') %]
90                         <input type="hidden" name="detail_record_view" value="1" />
91                     [% END %]
92             </div>
93         </div>
94     </div>
95     </form>
96     <div id="content-wrapper">
97         <div id="main-content">
98             <div id="results-page">
99                 [% path = "opac/parts/result/" _
100                     (ctx.records.size ? "table.tt2" : "lowhits.tt2");
101                 INCLUDE $path %]
102             </div>
103             <div class="common-full-pad"></div>    
104         </div>
105         <br class="clear-both" />
106     </div>
107 [%- END %]