LP#1406451: Prevent some catalogue pages from being indexed
[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     metalinks = '<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']); %]">
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) %]">[% 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)) %]">[% 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') %]">[% 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                     <div class='results_header_sel' id='simple-detail-view-links'>
71                         [% IF CGI.param('detail_record_view') %]
72                         <a href="[% mkurl('', {detail_record_view => ''}) %]">[% l('Show Fewer Details') %]</a> [% ELSE %]
73                         <a href="[% mkurl('', {detail_record_view => 1}) %]">[% l('Show More Details') %]</a>
74                         [% END %]
75                     </div>
76
77                     <label class="results_header_lbl" for="limit_to_available">
78                         <input type="checkbox" id="limit_to_available" name="modifier" value="available"
79                             onchange="search_modifier_onchange('available', this, true)"
80                             [% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %] />
81                         [% l('Limit to available items') %]
82                     </label>
83                     [% IF NOT metarecords.disabled %]
84                         <label class="results_header_lbl" for="metabib_search_modifier">
85                             <input type="checkbox" id="metabib_search_modifier"
86                                 name="modifier" value="metabib"
87                                 onchange="search_modifier_onchange('metabib', this, true)"
88                                 [% CGI.param('modifier').grep('metabib').size ? ' checked="checked"' : '' %] />
89                             [% l('Group Formats and Editions') %]
90                         </label>
91                     [% END %]
92                     [% IF CGI.param('detail_record_view') %]
93                         <input type="hidden" name="detail_record_view" value="1" />
94                     [% END %]
95             </div>
96         </div>
97     </div>
98     </form>
99     <div id="content-wrapper">
100         <div id="main-content">
101             <div id="results-page">
102                 [% path = "opac/parts/result/" _
103                     (ctx.records.size ? "table.tt2" : "lowhits.tt2");
104                 INCLUDE $path %]
105             </div>
106             <div class="common-full-pad"></div>    
107         </div>
108         <br class="clear-both" />
109     </div>
110 [%- END %]