Bug 24155: Make weighting an option on advanced search
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / masthead.inc
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Branches %]
4 [% USE Categories %]
5 [% USE KohaNews %]
6 [% PROCESS 'html_helpers.inc' %]
7 [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
8 [% SET OpacHeader = KohaNews.get( location => "opacheader", lang => lang, library => branchcode, blocktitle => 0 ) %]
9 [% SET OpacCustomSearch = KohaNews.get( location => "OpacCustomSearch", lang => lang, library => branchcode, blocktitle => 0 ) %]
10 [% SET OpacLoginInstructions = KohaNews.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %]
11
12 <div id="wrapper">
13     <div id="header-region" class="noprint">
14         <nav class="navbar navbar-expand">
15             <button id="scrolltocontent">Skip to main content</button>
16             <h1 id="logo">
17                 <a class="navbar-brand" href="/cgi-bin/koha/opac-main.pl">
18                     [% IF ( LibraryNameTitle ) %]
19                         [% LibraryNameTitle | html %]
20                     [% ELSE %]
21                         Koha online
22                     [% END %]
23                 </a>
24             </h1>
25             [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
26                 <div id="cartDetails" class="cart-message">Your cart is empty.</div>
27             [% END %]
28             <ul id="cart-list-nav" class="navbar-nav">
29                 [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
30                     <li class="nav-item">
31                         <a href="#" class="nav-link" title="Collect items you are interested in" id="cartmenulink" role="button">
32                             <i id="carticon" class="fa fa-shopping-cart fa-icon-black" aria-hidden="true"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span>
33                         </a>
34                     </li>
35                 [% END %]
36                 <li class="divider-vertical"></li>
37                 [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) %]
38                     <li class="nav-item dropdown">
39                         <a href="#" title="Show lists" class="nav-link dropdown-toggle" id="listsmenu" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"
40                             ><i class="fa fa-list fa-icon-black" aria-hidden="true"></i> <span class="listslabel">Lists</span>
41                         </a>
42                         <div aria-labelledby="listsmenu" role="menu" class="dropdown-menu">
43                             [% IF some_public_shelves.count %]
44                                 <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=2" tabindex="-1" role="menuitem"><strong>Public lists</strong></a>
45                                 [% SET number_of_public_shelves = 0 %]
46                                 [% FOREACH s IN some_public_shelves %]
47                                     <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | uri %]&amp;sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a>
48                                     [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
49                                     [% IF number_of_public_shelves >= 10 %][% LAST %][% END %]
50                                 [% END %]
51                                 [% IF some_public_shelves > 10 %]
52                                     <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=2" tabindex="-1" role="menuitem">View All</a>
53                                 [% END %]
54                             [% END %]
55                             [% IF some_public_shelves.count > 0 %]
56                                 <div class="dropdown-divider"></div>
57                             [% END %]
58                             [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
59                                 <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" tabindex="-1" role="menuitem"><strong>Your lists</strong></a>
60                                 [% IF loggedinusername %]
61                                     [% IF some_private_shelves.count %]
62                                         [% SET number_of_private_shelves = 0 %]
63                                         [% FOREACH s IN some_private_shelves %]
64                                             <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | uri %]&amp;sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a>
65                                             [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
66                                             [% IF number_of_private_shelves >= 10 %][% LAST %][% END %]
67                                         [% END %]
68                                         [% IF some_private_shelves > 10 %]
69                                             <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" tabindex="-1" role="menuitem">View All</a>
70                                         [% END %]
71                                     [% ELSE %]
72                                         <a class="dropdown-item disabled" href="#" tabindex="-1" role="menuitem">No private lists</a>
73                                     [% END %]
74                                         <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">New list</a>
75                                 [% ELSE %]
76                                     <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">Log in to create your own lists</a>
77                                 [% END # / IF loggedinusername %]
78                             [% END # / IF opacuserlogin %]
79                         </div> <!-- / .dropdown-menu -->
80                     </li> <!-- / .nav-item.dropdown -->
81                 [% END # / IF virtualshelves %]
82             </ul> <!-- / .navbar-nav -->
83
84             [% IF Koha.Preference( 'opacuserlogin' ) == 1 ||  Koha.Preference( 'EnableOpacSearchHistory') || Koha.Preference( 'opaclanguagesdisplay' ) %]
85                 [% IF ( Koha.Preference( 'opaclanguagesdisplay' ) ) %]
86                     [% INCLUDE 'masthead-langmenu.inc' %]
87                 [% END %]
88                 <ul id="members" class="navbar-nav">
89                     <li class="nav-item dropdown">
90                         [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
91                             [% IF ( loggedinusername ) %]
92                                 <a href="#" class="dropdown-toggle" id="user-menu" data-toggle="dropdown" role="button">
93                                     <i class="fa fa-user fa-icon-black fa-fw" aria-hidden="true"></i>
94                                     <span class="userlabel">Welcome, [% INCLUDE 'patron-title.inc' patron = logged_in_user no_html = 1 %]</span>
95                                 </a>
96                             [% ELSE %]
97                                 [% IF Koha.Preference('casAuthentication') %]
98                                     [%# CAS authentication is too complicated for modal window %]
99                                         <a class="nav-link login-link" href="/cgi-bin/koha/opac-user.pl"><i class="fa fa-user fa-icon-black fa-fw" aria-hidden="true"></i> <span class="userlabel">Log in to your account</span></a>
100                                 [% ELSIF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %]
101                                     <a class="nav-link login-link" href="/cgi-bin/koha/svc/auth/googleopenidconnect" role="button" data-toggle="modal"><i class="fa fa-user fa-icon-black fa-fw" aria-hidden="true"></i> <span class="userlabel">Log in to your account</span></a>
102                                 [% ELSE %]
103                                     <a href="/cgi-bin/koha/opac-user.pl" class="nav-link login-link loginModal-trigger"><i class="fa fa-user fa-icon-black fa-fw" aria-hidden="true"></i> <span class="userlabel">Log in to your account</span></a>
104                                 [% END %]
105                             [% END %]
106                         [% END %]
107
108                         [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 && loggedinusername ) %]
109                             <div aria-labelledby="user-menu" role="menu" class="dropdown-menu dropdown-menu-right">
110                                 <div id="loggedinuser-menu">
111                                     <p>
112                                         <a class="login-link" href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername" data-borrowernumber="[% logged_in_user.borrowernumber | html %]" data-branchcode="[% logged_in_user.branchcode | html %]" >Your account</span></a>
113                                     </p>
114                                     [% IF Koha.Preference( 'EnableOpacSearchHistory' ) %]
115                                         <p>
116                                             <a tabindex="-1" role="menuitem" class="login-link" href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a>
117                                             <span class="divider-vertical"></span>
118                                             <a class="clearsh" href="/cgi-bin/koha/opac-search-history.pl?action=delete" title="Delete your search history"><i class="fa fa-trash" aria-hidden="true"></i> Clear</a>
119                                         </p>
120                                     [% END %]
121                                     <a tabindex="-1" role="menuitem" class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">Log out</a>
122                                 </div>
123                             </div>
124                         [% END %]
125                     </li>
126                     [% IF ( !Koha.Preference( 'opacuserlogin') || !loggedinusername ) %]
127                         [% IF Koha.Preference( 'EnableOpacSearchHistory' ) %]
128                             <li class="nav-item search_history">
129                                 <a class="nav-link login-link" href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a>
130                             </li>
131                             <li class="divider-vertical"></li>
132                             <li class="nav-item">
133                                 <a class="nav-link logout clearsh" href="/cgi-bin/koha/opac-search-history.pl?action=delete" title="Delete your search history"><i class="fa fa-trash" aria-hidden="true"></i> Clear</a>
134                             </li>
135                         [% END %]
136                     [% END %]
137                 </ul>
138             [% END # IF opacuserlogin || EnableOpacSearchHistory || opaclanguagesdisplay %]
139         </nav> <!-- /navbar -->
140
141         [% IF ( OpacHeader ) %]
142             <div class="container-fluid">
143                 <div class="row">
144                     <div class="col">
145                         [% PROCESS koha_news_block news => OpacHeader %]
146                     </div>
147                 </div>
148             </div>
149         [% END %]
150
151     </div> <!-- / header-region -->
152
153     [% IF ( OpacPublic ) %]
154         <div class="container-fluid">
155             [% UNLESS ( advsearch ) %]
156                 <div class="row">
157                     <div class="col">
158                             <div id="opac-main-search">
159                                 [% IF Koha.Preference('OpacCustomSearch') == '' %]
160                                     <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform">
161                                         <input type="hidden" name="weight_search" value="1">
162                                         <div class="form-row align-items-center">
163                                             <div class="col-sm-auto order-1 order-sm-1">
164                                                 <label for="masthead_search"> Search
165                                                     [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
166                                                         [% IF ( mylibraryfirst ) %]
167                                                             (in [% Branches.GetName( mylibraryfirst ) | html %] only)
168                                                         [% END %]
169                                                     [% END %]
170                                                 </label>
171                                             </div>
172                                             <div class="col-sm-auto order-2 order-sm-2">
173                                                 <select name="idx" id="masthead_search" class="form-control">
174                                                     [% IF ( ms_kw ) %]
175                                                         <option selected="selected" value="">Library catalog</option>
176                                                     [% ELSE %]
177                                                         <option value="">Library catalog</option>
178                                                     [% END # /ms_kw %]
179                                                     [% IF ( ms_ti ) %]
180                                                         <option selected="selected" value="ti">Title</option>
181                                                     [% ELSE %]
182                                                         <option value="ti">Title</option>
183                                                     [% END # /ms_ti %]
184                                                     [% IF ( ms_au ) %]
185                                                         <option selected="selected" value="au">Author</option>
186                                                     [% ELSE %]
187                                                         <option value="au">Author</option>
188                                                     [% END # /ms_au%]
189                                                     [% IF ( ms_su ) %]
190                                                         <option selected="selected" value="su">Subject</option>
191                                                     [% ELSE %]
192                                                         <option value="su">Subject</option>
193                                                     [% END # /ms_su %]
194                                                     [% IF ( ms_nb ) %]
195                                                         <option selected="selected" value="nb">ISBN</option>
196                                                     [% ELSE %]
197                                                         <option value="nb">ISBN</option>
198                                                     [% END # /ms_nb%]
199                                                     [% IF ( ms_ns ) %]
200                                                         <option selected="selected" value="ns">ISSN</option>
201                                                     [% ELSE %]
202                                                         <option value="ns">ISSN</option>
203                                                     [% END # /ms_ns%]
204                                                     [% IF ( ms_se ) %]
205                                                         <option selected="selected" value="se">Series</option>
206                                                     [% ELSE %]
207                                                         <option value="se">Series</option>
208                                                     [% END # /ms_se %]
209                                                     [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
210                                                         [% IF ( ms_callnumcommaphr ) %]
211                                                             <option selected="selected" value="callnum,phr">Call number</option>
212                                                         [% ELSE %]
213                                                             <option value="callnum,phr">Call number</option>
214                                                         [% END #/ms_callnumcommaphr %]
215                                                     [% ELSE %]
216                                                         [% IF ( ms_callnum ) %]
217                                                             <option selected="selected" value="callnum">Call number</option>
218                                                         [% ELSE %]
219                                                             <option value="callnum">Call number</option>
220                                                         [% END # /ms_callnum %]
221                                                     [% END # /IF OPACNumbersPreferPhrase %]
222                                                 </select>
223                                             </div> <!-- /.col-sm-auto -->
224
225                                             <div class="col order-4 order-sm-3">
226                                                 [% IF ( ms_value ) %]
227                                                     <input type="text" title="Type search term" class="transl1 form-control" id="translControl1" name="q" value="[% ms_value | html %]" /><span id="translControl"></span>
228                                                 [% ELSE %]
229                                                     <input type="text" title="Type search term" class="transl1 form-control" id="translControl1" name="q" /><span id="translControl"></span>
230                                                 [% END # /ms_value %]
231                                             </div> <!-- /.col -->
232
233                                             [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
234                                                 <div class="col-sm order-3 order-sm-4">
235                                                     <select name="branch_group_limit" id="select_library" class="form-control">
236                                                         <option value="">All libraries</option>
237
238                                                         [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]
239
240                                                         [% FOREACH library IN Branches.all( selected => opac_name ) %]
241                                                             [% IF library.selected %]
242                                                                 <option selected="selected" value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
243                                                             [% ELSE %]
244                                                                 <option value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
245                                                             [% END %]
246                                                         [% END %]
247
248                                                         [% IF LibrarySearchGroups %]
249                                                             </optgroup>
250                                                             <optgroup label="Groups">
251                                                                 [% FOREACH lsg IN LibrarySearchGroups %]
252                                                                     [% IF lsg.id == opac_name %]
253                                                                         <option selected="selected" value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
254                                                                     [% ELSE %]
255                                                                         <option value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
256                                                                     [% END # / bc.selected %]
257                                                                 [% END %]
258                                                             </optgroup>
259                                                         [% END # / BranchCategoriesLoop %]
260                                                     </select> <!-- /#select_library -->
261                                                 </div> <!-- /.col-sm-auto -->
262                                                 <div class="col-sm-auto order-5">
263                                                     <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
264                                                 </div>
265                                             [% ELSE %]
266                                                 [% IF ( opac_limit_override ) %]
267                                                     [% IF ( opac_search_limit ) %]
268                                                         [% IF ( multibranchlimit = opac_search_limit.match( 'branch:(multibranchlimit-\d+)' ) ) %]
269                                                             <input name="branch_group_limit" value="[% multibranchlimit.0 | html %]" type="hidden" />
270                                                         [% ELSE %]
271                                                             <input name="limit" value="[% opac_search_limit | html %]" type="hidden" />
272                                                         [% END %]
273                                                     [% END %]
274                                                 [% ELSE %]
275                                                     [% IF ( mylibraryfirst ) %]
276                                                         <input name="limit" value="branch:[% mylibraryfirst | html %]" type="hidden" />
277                                                     [% END %]
278                                                 [% END # / opac_limit_override %]
279                                                 <div class="order-5 col-sm-auto">
280                                                     <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
281                                                 </div>
282                                             [% END # / OpacAddMastheadLibraryPulldown %]
283                                         </div> <!-- /.form-row -->
284                                     </form>
285                                 [% ELSE # / Koha.Preference('OpacCustomSearch') == '' %]
286                                     [% Koha.Preference('OpacCustomSearch') | $raw %]
287                                 [% END # / Koha.Preference('OpacCustomSearch') == '' %]
288                             </div><!-- /#opac-main-search -->
289                     </div> <!-- /.col -->
290                 </div> <!-- /.row -->
291             [% END # / UNLESS advsearch %]
292
293             <div class="row">
294                 <ul class="nav" id="moresearches">
295                     <li class="nav-item">
296                         <a href="/cgi-bin/koha/opac-search.pl">Advanced search</a>
297                     </li>
298                     [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]
299                         <li class="nav-item">
300                             <a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>
301                         </li>
302                     [% END %]
303                     [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]
304                         <li class="nav-item">
305                             <a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a>
306                         </li>
307                     [% END %]
308                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
309                         <li class="nav-item">
310                             <a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a>
311                         </li>
312                     [% END %]
313                     [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]
314                         <li class="nav-item">
315                             <a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a>
316                         </li>
317                     [% END %]
318                     [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]
319                         <li class="nav-item">
320                             <a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a>
321                         </li>
322                     [% END %]
323                     [% IF Koha.Preference( 'OpacCloud' ) == 1 %]
324                         <li class="nav-item">
325                             <a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a>
326                         </li>
327                     [% END %]
328                     [% IF Koha.Preference( 'OpacTopissue' ) == 1 %]
329                         <li class="nav-item">
330                             <a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a>
331                         </li>
332                     [% END %]
333                     [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' && Koha.Preference( 'OpacBrowseSearch' ) == 1 %]
334                         <li class="nav-item">
335                             <a href="/cgi-bin/koha/opac-browse.pl">Browse search</a>
336                         </li>
337                     [% END %]
338                     [% IF Koha.Preference( 'suggestion' ) == 1 %]
339                         [% IF Koha.Preference( 'AnonSuggestions' ) == 1 || Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
340                             <li class="nav-item">
341                                 <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">Purchase suggestions</a>
342                             </li>
343                         [% END %]
344                     [% END %]
345                     <li class="nav-item">
346                         <a id="library_page" href="/cgi-bin/koha/opac-library.pl">
347                             [% IF ( singleBranchMode ) %]
348                                 Library
349                             [% ELSE %]
350                                 Libraries
351                             [% END %]
352                         </a>
353                     </li>
354                     [% Koha.Preference('OpacMoreSearches') | $raw %]
355                 </ul> <!-- /.nav#moresearches -->
356             </div> <!-- /.row -->
357         </div> <!-- /.container-fluid -->
358     [% END # / OpacPublic %]
359
360     <!-- Login form hidden by default, used for modal window -->
361     <div id="loginModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="modalLoginLabel" aria-hidden="true">
362         <div class="modal-dialog">
363             <div class="modal-content">
364                 <div class="modal-header">
365                     <h2 class="modal-title" id="modalLoginLabel">Log in to your account</h2>
366                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
367                         <span aria-hidden="true">&times;</span>
368                     </button>
369                 </div>
370                 <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="modalAuth">
371                     <input type="hidden" name="has-search-query" id="has-search-query" value="" />
372                     <div class="modal-body">
373                         [% IF ( shibbolethAuthentication ) %]
374                             [% IF ( invalidShibLogin ) %]
375                                 <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
376                                 <div class="alert alert-info">
377                                     <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p>
378                                 </div>
379                             [% ELSE %]
380                                 <h3>Shibboleth login</h3>
381                                 <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl | $raw %]">click here to login</a>.</p>
382                                 <h3>Local Login</h3>
383                             [% END %]
384                         [% END %]
385                         <input type="hidden" name="koha_login_context" value="opac" />
386                         <fieldset class="brief">
387                             <label for="muserid">Login:</label><input type="text" id="muserid" name="userid" />
388                             <label for="mpassword">Password:</label><input type="password" id="mpassword" name="password" />
389                             [% IF Koha.Preference( 'OpacLoginInstructions' ) %]
390                                 <div id="nologininstructions-modal" class="nologininstructions">
391                                     [% Koha.Preference( 'OpacLoginInstructions' ) | $raw %]
392                                 </div>
393                             [% END %]
394                             [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
395                                 <div id="forgotpassword-modal" class="forgotpassword">
396                                     <a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
397                                 </div>
398                             [% END %]
399                             [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
400                                 <div id="patronregistration-modal" class="patronregistration">
401                                     <p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p>
402                                 </div>
403                             [% END %]
404                         </fieldset>
405                     </div>
406                     <div class="modal-footer">
407                         <input type="submit" class="btn btn-primary" value="Log in" />
408                     </div>
409                 </form> <!-- /#auth -->
410             </div> <!-- /.modal-content -->
411         </div> <!-- /.modal-dialog -->
412     </div>  <!-- /#modalAuth  -->