]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates-bootstrap/opac/results.tt2
lp1863252 toward geosort
[Evergreen.git] / Open-ILS / src / templates-bootstrap / 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,follow">');
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 border-bottom">
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','page']); %]">
41               [% l('&#9668; Return to Grouped Search Results') %]
42             </a>
43           </div>
44           <br/>
45           [% END %]
46         [% END %]
47         <div [%- IF ctx.metarecord %]class="hidden"[%- ELSE %]class="container-fluid"[%- END %]>
48
49             <div id="results_header_inner">
50
51                 <div id="refine_hits" class="btn btn-secondary"><a onclick="getFacety();">[% l('Refine these results') %]</a></div>
52                 <div id="return_to_hits" class="results_header_btns"><a onclick="getResulty();">[% l('Back to results') %]</a></div>
53
54
55             <div class="row">
56             <div class="col">
57                 <div class="search-options text-center">
58                     <div class="mx-auto">
59                         <!-- ===== Drop Down ===== -->
60                         <div class="search-option my-2">
61                         <label for="opac.result.sort">[% l('Sort Results') %]</label>
62                             [% INCLUDE "opac/parts/filtersort.tt2" value=CGI.param('sort') submit_on_change=1 class="form-control" %]
63                         </div>
64                         [%- IF show_more_details.default != 'hide' -%]
65
66                         <!-- ===== Buttons ===== -->
67                         <div class="search-option my-2">
68                             [% IF show_detail_view %]
69                             <a href="[% mkurl('', {detail_record_view => 0}) %]" class="btn btn-sm btn-secondary">[% l('Show Fewer Details') %]</a> [% ELSE %]
70                             <a href="[% mkurl('', {detail_record_view => 1}) %]" class="btn btn-sm btn-secondary">[% l('Show More Details') %]</a>
71                             [% END %]
72                         </div>
73                         [%- END -%]
74                          [% IF (is_advanced AND NOT is_special) AND CGI.param('qtype') %]
75                         <div class="search-option my-2">
76                             <span id="refine_search_link"> <a class="btn btn-secondary btn-sm" href="[% mkurl(ctx.opac_root _ '/advanced') %]">[%
77                                 l('Refine My Original Search')
78                             %]</a> </span>
79                         </div>
80                         [% END %]
81                     </div>
82                 </div>
83             </div>
84             </div>
85
86             <div class="row">
87             <div class="col">
88                     <!-- ===== Checkboxes ===== -->
89                     <div class="search-check">
90
91                      [%- IF !search.no_highlight %]
92
93                         <div class="search-filter m-2">
94                             <label for="no_highlight">
95                             <input type="checkbox" id="no_highlight" name="no_highlight" value="1"
96                                 onchange="search_modifier_onchange('no_highlight', this, true)"
97                                 [% CGI.param('no_highlight').size ? ' checked="checked"' : '' %] />
98                             [% l('Disable Highlighting') %]
99                             </label>
100                         </div>
101                         [% END %]
102
103                         <div class="search-filter m-2">
104                             <label for="limit_to_available">
105                             <input type="checkbox" id="limit_to_available" name="modifier" value="available"
106                             onchange="search_modifier_onchange('available', this, true)"
107                             [% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %] />
108                             [% l('Limit to Available Items') %]
109                             </label>
110                         </div>
111                         [% IF NOT metarecords.disabled %]
112
113                         <div class="search-filter m-2">
114                         <label for="metabib_search_modifier">
115                             <input type="checkbox" id="metabib_search_modifier"
116                                 name="modifier" value="metabib"
117                                 onchange="search_modifier_onchange('metabib', this, true)"
118                                 [% CGI.param('modifier').grep('metabib').size ? ' checked="checked"' : '' %] />
119                             [% l('Group By Formats and Editions') %]
120                         </label>
121                         </div>
122                     [% END %]
123                     [% IF ctx.depth_sel_checkbox %]
124
125                     <div class="search-filter m-2">
126                         <label for="depth_sel" title="[% ctx.depth_sel_tooltip | html %]">
127                             <input type="checkbox" id="depth_sel" name="depth" value="[% ctx.depth_sel_depth %]"
128                             onchange="this.form.submit()"
129                             [% CGI.param('depth') == ctx.depth_sel_depth ? ' checked="checked"' : '' %] />
130                             [% ctx.depth_sel_checkbox_label | html %]
131                         </label>
132                     </div>
133                     [% END %]
134                     [% IF ctx.exclude_electronic_checkbox %]
135
136                         <div class="search-filter m-2">
137                         <label for='opac.result.excludeelec'>
138                         <input type='checkbox' id='opac.result.excludeelec' name="fi:-search_format" value="electronic"
139                             onchange="exclude_onchange(this)"
140                             [%- CGI.param('fi:-search_format').grep('electronic').size ? ' checked="checked"' : '' %] />
141                         [% l("Exclude Electronic Resources") %]
142                         </label>
143                         </div>
144                     [% END %]
145                    </div>
146                    </div>
147
148             </div>
149             </div>
150             </div>
151         </div>
152     </div>
153     </form>
154     <div class="mx-5">
155         <div class="row">
156             <div id="results-page" class="col">
157                 [%- IF (ctx.depth_sel_checkbox OR ctx.depth_sel_button) AND CGI.param('depth') == ctx.depth_sel_depth AND ctx.depth_sel_resultshint %]
158                 <div id="results-page-depth-hint">[% ctx.depth_sel_resultshint | html %]</div>
159                 [%- END %]
160                 [% path = "opac/parts/result/" _
161                     (ctx.records.size ? "table.tt2" : "lowhits.tt2");
162                 INCLUDE $path %]
163             </div>
164         </div>
165     </div>
166 [%- END %]