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