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