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