Bug 12296: make search box customisable with OpacCustomSearch
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / masthead.inc
1 [% USE Koha %]
2 <div id="wrap">
3     <div id="header-region">
4         <div class="navbar navbar-inverse navbar-static-top">
5             <div class="navbar-inner">
6                 <div class="container-fluid">
7                     <h1 id="logo">
8                         <a class="brand" href="/cgi-bin/koha/opac-main.pl">
9                             [% IF ( LibraryNameTitle ) %]
10                                 [% LibraryNameTitle %]
11                             [% ELSE %]
12                                 Koha online
13                             [% END %]
14                         </a>
15                     </h1>
16                     [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
17                         <div id="cartDetails" class="cart-message">Your cart is empty.</div>
18                     [% END %]
19                     <ul class="nav">
20                         [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
21                             <li class="dropdown">
22                                 <a href="#" class="dropdown-toggle" id="cartmenulink" data-toggle="dropdown" role="button">
23                                     <i id="carticon" class="icon-shopping-cart icon-white"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span>
24                                 </a>
25                                 <ul aria-labelledby="cartmenulink" role="menu" class="dropdown-menu">
26                                     <li role="presentation">
27                                         <a href="#" id="cartmenuitem" class="cart-message" tabindex="-1" role="menuitem">Your cart is empty.</a>
28                                     </li>
29                                 </ul>
30                             </li>
31                         [% END %]
32                         [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) && ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
33                             <li class="divider-vertical"></li>
34                         [% END %]
35                         [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) %]
36                             <li class="dropdown">
37                                 <a href="#" class="dropdown-toggle" id="listsmenu" data-toggle="dropdown" role="button"><i class="icon-list icon-white"></i> <span class="listslabel">Lists</span> <b class="caret"></b></a>
38                                 <ul aria-labelledby="listsmenu" role="menu" class="dropdown-menu">
39                                     [% IF ( pubshelves ) %]
40                                             <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves" tabindex="-1" role="menuitem"><strong>Public lists</strong></a></li>
41                                         [% FOREACH pubshelvesloo IN pubshelvesloop %]
42                                             <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% pubshelvesloo.shelfnumber %]&amp;sortfield=[% pubshelvesloo.sortfield %]" tabindex="-1" role="menuitem">[% pubshelvesloo.shelfname |html %]</a></li>
43                                         [% END %]
44                                             <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves" tabindex="-1" role="menuitem" class="listmenulink">View All</a></li>
45                                     [% ELSE %]
46                                         <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No public lists</a></li>
47                                     [% END %]
48                                     <li class="divider" role="presentation"></li>
49                                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
50                                         <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves" tabindex="-1" role="menuitem"><strong>Your lists</strong></a></li>
51                                         [% IF ( loggedinusername ) %]
52                                             [% IF ( barshelves ) %]
53                                                 [% FOREACH barshelvesloo IN barshelvesloop %]
54                                                     <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% barshelvesloo.shelfnumber %]&amp;sortfield=[% barshelvesloo.sortfield %]" tabindex="-1" role="menuitem">[% barshelvesloo.shelfname |html %]</a></li>
55                                                 [% END %]
56                                                 <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves" tabindex="-1" role="menuitem" class="listmenulink">View all</a></li>
57                                             [% ELSE %]
58                                                 <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No private lists</a></li>
59                                                 <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves" tabindex="-1" role="menuitem" class="listmenulink">New list</a></li>
60                                             [% END %]
61                                         [% ELSE %]
62                                             <li role="presentation"><a href="/cgi-bin/koha/opac-user.pl" tabindex="-1" class="menu-inactive loginModal-trigger" role="menuitem">Log in to create your own lists</a></li>
63                                         [% END # / IF loggedinusername %]
64                                     [% END # / IF opacuserlogin %]
65                                 </ul> <!-- / .dropdown-menu -->
66                             </li> <!-- / .dropdown -->
67                         [% END # / IF virtualshelves %]
68                     </ul> <!-- / .nav -->
69                     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]<div id="listsDetails"></div>[% END %]
70                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 || EnableOpacSearchHistory %]
71                         <a id="user-menu-trigger" class="pull-right" href="#"><i class="icon-user"></i> <span class="caret"></span></a>
72                         <div id="members">
73                             <ul class="nav pull-right">
74                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
75                                     [% UNLESS ( loggedinusername ) %]
76                                         [% IF Koha.Preference('casAuthentication') %]
77                                             [%# CAS authentication is too complicated for modal window %]
78                                             <li><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a></li>
79                                         [% ELSE %]
80                                             <li><a href="/cgi-bin/koha/opac-user.pl" class="loginModal-trigger" role="button" data-toggle="modal">Log in to your account</a></li>
81                                         [% END %]
82                                     [% END %]
83                                     [% IF ( loggedinusername ) %]
84                                         <li><p class="members navbar-text">Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% FOREACH USER_INF IN USER_INFO %][% USER_INF.title %] [% USER_INF.firstname %] [% USER_INF.surname %][% END %]</span></a></p></li>
85                                         <li class="divider-vertical"></li>
86                                     [% END %]
87                                 [% END %]
88                                 [% IF EnableOpacSearchHistory %]
89                                     <li><p class="navbar-text"><a href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a> [<a class="logout" href="/cgi-bin/koha/opac-search-history.pl?action=delete" title="Delete your search history" onclick="return confirm(MSG_DELETE_SEARCH_HISTORY);">x</a>]</p></li>
90                                     <li class="divider-vertical"></li>
91                                 [% END %]
92                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
93                                     [% IF ( loggedinusername ) %]
94                                         <li><p class="navbar-text">
95                                             [% IF persona %]
96                                                 <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1" onclick='navigator.id.logout();'>
97                                             [% ELSE %]
98                                                 <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
99                                             [% END %]
100                                             Log out</a></p></li>
101                                     [% END %]
102                                 [% END %]
103                             </ul>
104                         </div> <!-- /members -->
105                     [% END # IF opacuserlogin %]
106                 </div> <!-- /container-fluid -->
107             </div> <!-- /navbar-inner -->
108         </div> <!-- /navbar -->
109
110         [% IF ( opacheader ) %]
111             <div class="container-fluid">
112                 <div class="row-fluid">
113                     <div id="opacheader">
114                         [% opacheader %]
115                     </div>
116                 </div>
117             </div>
118         [% END %]
119     </div> <!-- / header-region -->
120
121     <div class="container-fluid">
122         <div class="row-fluid">
123             <div id="opac-main-search">
124     <!--             <div class="span2">
125         [% IF ( opacsmallimage ) %]
126             <h1 id="libraryname" style="background-image: url('[% opacsmallimage %]');">
127         [% ELSE %]
128             <h1 id="libraryname">
129         [% END %]
130             <a href="/cgi-bin/koha/opac-main.pl">[% IF ( LibraryName ) %][% LibraryName %][% ELSE %]Koha Online Catalog[% END %]</a></h1>
131     </div> /.span2 -->
132             <div class="span12">
133                 [% IF ( OpacPublic ) %]
134                     [% UNLESS ( advsearch ) %]
135                         [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
136                             <div class="mastheadsearch librarypulldown">
137                         [% ELSE %]
138                             <div class="mastheadsearch">
139                         [% END %]
140                         [% IF Koha.Preference('OpacCustomSearch') == '' %]
141                             <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
142                                 <label for="masthead_search"> Search
143                                     [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
144                                         [% IF ( mylibraryfirst ) %]
145                                             (in [% mylibraryfirst %] only)
146                                         [% END %]
147                                     [% END %]
148                                 </label>
149
150                                 <select name="idx" id="masthead_search">
151                                 [% IF ( ms_kw ) %]
152                                     <option selected="selected" value="">Library catalog</option>
153                                 [% ELSE %]
154                                     <option value="">Library catalog</option>
155                                 [% END # /ms_kw %]
156                                 [% IF ( ms_ti ) %]
157                                     <option selected="selected" value="ti">Title</option>
158                                 [% ELSE %]
159                                     <option value="ti">Title</option>
160                                 [% END # /ms_ti %]
161                                 [% IF ( ms_au ) %]
162                                     <option selected="selected" value="au">Author</option>
163                                 [% ELSE %]
164                                     <option value="au">Author</option>
165                                 [% END # /ms_au%]
166                                 [% IF ( ms_su ) %]
167                                     <option selected="selected" value="su">Subject</option>
168                                 [% ELSE %]
169                                     <option value="su">Subject</option>
170                                 [% END # /ms_su %]
171                                 [% IF ( ms_nb ) %]
172                                     <option selected="selected" value="nb">ISBN</option>
173                                 [% ELSE %]
174                                     <option value="nb">ISBN</option>
175                                 [% END # /ms_nb%]
176                                 [% IF ( ms_se ) %]
177                                     <option selected="selected" value="se">Series</option>
178                                 [% ELSE %]
179                                     <option value="se">Series</option>
180                                 [% END # /ms_se %]
181                                 [% IF ( numbersphr ) %]
182                                     [% IF ( ms_callnum ) %]
183                                             <option selected="selected" value="callnum,phr">Call number</option>
184                                     [% ELSE %]
185                                         <option value="callnum,phr">Call number</option>
186                                     [% END #/ms_callnum %]
187                                 [% ELSE %]
188                                     [% IF ( ms_callnum ) %]
189                                         <option selected="selected" value="callnum">Call number</option>
190                                     [% ELSE %]
191                                         <option value="callnum">Call number</option>
192                                     [% END # /ms_callnum %]
193                                 [% END # /numbersphr %]
194                                 </select>
195
196                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
197                                     <div class="input-append nolibrarypulldown">
198                                 [% END %]
199                                 [% IF ( ms_value ) %]
200                                     <input type="text" title="Type search term" class="transl1" name="q" value="[% ms_value |html %]" /><span id="translControl"></span>
201                                 [% ELSE %]
202                                     <input type="text" title="Type search term" class="transl1" name="q" /><span id="translControl"></span>
203                                 [% END # /ms_value %]
204
205                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
206                                     <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
207                                     </div>
208                                 [% END %]
209
210                                 [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
211                                     <div class="input-append">
212                                         <select name="branch_group_limit" id="select_library">
213                                             <option value="">All libraries</option>
214                                             [% IF BranchCategoriesLoop %]<optgroup label="Libraries">[% END %]
215                                                 [% FOREACH BranchesLoo IN BranchesLoop %]
216                                                     [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
217                                                     [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
218                                                 [% END %]
219                                             [% IF BranchCategoriesLoop %]
220                                                 </optgroup>
221                                                 <optgroup label="Groups">
222                                                     [% FOREACH bc IN BranchCategoriesLoop %]
223                                                         [% IF ( bc.selected ) %]
224                                                             <option selected="selected" value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
225                                                         [% ELSE %]
226                                                             <option value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
227                                                         [% END # / bc.selected %]
228                                                     [% END %]
229                                                 </optgroup>
230                                             [% END # / BranchCategoriesLoop %]
231                                         </select>
232                                         <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
233                                     </div>
234                                 [% ELSE %]
235                                     [% IF ( opac_limit_override ) %]
236                                         [% IF ( opac_search_limit ) %]
237                                             <input name="limit" value="[% opac_search_limit %]" type="hidden" />
238                                         [% END %]
239                                     [% ELSE %]
240                                         [% IF ( mylibraryfirst ) %]
241                                             <input name="limit" value="branch:[% mylibraryfirst %]" type="hidden" />
242                                         [% END %]
243                                     [% END # / opac_limit_override %]
244                                 [% END # / OpacAddMastheadLibraryPulldown %]
245
246                             </form>
247                         [% ELSE # / Koha.Preference('OpacCustomSearch') == '' %]
248                             [% Koha.Preference('OpacCustomSearch') %]
249                         [% END # / Koha.Preference('OpacCustomSearch') == '' %]
250                         </div> <!-- / .mastheadsearch -->
251                     [% END # / UNLESS advsearch %]
252
253                     <div class="row-fluid">
254                             <div id="moresearches">
255                                 <ul>
256                                     <li><a href="/cgi-bin/koha/opac-search.pl">Advanced search</a></li>
257                                     [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]<li><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a></li>[% END %]
258                                     [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a></li>[% END %]
259                                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]<li><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a></li>[% END %]
260                                     [% 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 %]
261                                     [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %]
262                                     [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %]
263                                     [% IF Koha.Preference( 'OpacTopissue' ) == 1 %]<li><a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a></li>[% END %]
264                                     [% IF Koha.Preference( 'suggestion' ) == 1 %]
265                                         [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
266                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
267                                         [% ELSIF ( ( Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 ) ) %]
268                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
269                                         [% END %]
270                                     [% END %]
271                                 </ul>
272                             </div> <!-- /#moresearches -->
273                     </div> <!-- /.row-fluid -->
274
275                 [% END # / OpacPublic %]
276             </div> <!-- /.span10 -->
277             </div> <!-- /.opac-main-search -->
278         </div> <!-- / .row-fluid -->
279     </div> <!-- /.container-fluid -->
280
281     <!-- Login form hidden by default, used for modal window -->
282     <div id="loginModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="modalLoginLabel" aria-hidden="true">
283         <div class="modal-header">
284             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
285             <h3 id="modalLoginLabel">Log in to your account</h3>
286         </div>
287         <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="modalAuth">
288             <div class="modal-body">
289                     [% IF ( shibbolethAuthentication ) %]
290                     [% IF ( invalidShibLogin ) %]
291                     <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
292                     <div class="alert alert-info">
293                         <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p>
294                     </div>
295                     [% ELSE %]
296                     <h4>Shibboleth Login</h4>
297                     <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl %]">click here to login</a>.</p>
298                     <h4>Local Login</h4>
299                     [% END %]
300             [% END %]
301                     <input type="hidden" name="koha_login_context" value="opac" />
302                     <fieldset class="brief">
303                         <label for="muserid">Login:</label><input type="text" id="muserid" name="userid" />
304                         <label for="mpassword">Password:</label><input type="password" id="mpassword" name="password" />
305                     [% IF Koha.Preference( 'NoLoginInstructions' ) %]
306                         <div id="nologininstructions-modal">
307                             [% Koha.Preference( 'NoLoginInstructions' ) %]
308                         </div>
309                     [% END %]
310                         [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<div id="mpatronregistration"><p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p></div>[% END %]
311                     </fieldset>
312             </div>
313             <div class="modal-footer">
314                 <input type="submit" class="btn btn-primary" value="Log in" />
315                 <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
316             </div>
317         </form> <!-- /#auth -->
318     </div>  <!-- /#modalAuth  -->