Bug 14252: Move OPAC lang switcher to masthead navbar
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / masthead.inc
1 [% USE Koha %]
2 <div id="wrap">
3     <div id="header-region" class="noprint">
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="#" title="Collect items you are interested in" 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> <b class="caret"></b>
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="#" 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>
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 ( opaclanguagesdisplay ) %]
75                                 [% IF ( languages_loop && opaclanguagesdisplay ) %]
76                                     [% UNLESS ( one_language_enabled ) %]
77                                     <li class="dropdown">
78                                        <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>
79                                        <ul aria-labelledby="langmenu" role="menu" class="dropdown-menu">
80                                        [% FOREACH languages_loo IN languages_loop %]
81                                            [% IF ( languages_loo.group_enabled ) %]
82                                                [% IF ( languages_loo.plural ) %]
83                                                <li class="dropdown">
84                                                   <a data-toggle="dropdown" class="dropdown-toggle sublangs" id="show[% languages_loo.rfc4646_subtag %]" href="#">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %] <b class="caret"></b></a>
85                                                      <ul id="sub[% languages_loo.rfc4646_subtag %]" class="dropdown-menu">
86                                                      [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]
87                                                          [% IF ( sublanguages_loo.enabled ) %]
88                                                              [% IF ( sublanguages_loo.sublanguage_current ) %]
89                                                              <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 %] ([% sublanguages_loo.rfc4646_subtag %])&nbsp;<i class="icon-ok"></i></a></li>
90                                                              [% ELSE %]
91                                                              <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 %] ([% sublanguages_loo.rfc4646_subtag %])</a></li>
92                                                              [% END %]
93                                                          [% END # / IF sublanguages_loo.enabled %]
94                                                      [% END # / FOREACH sublanguages_loo %]
95                                                      </ul> <!-- languages_loo.rfc4646_subtag -->
96                                                </li> <!-- / .more -->
97                                                [% ELSE %]
98                                                    [% IF ( languages_loo.group_enabled ) %]
99                                                        [% IF ( languages_loo.current ) %]
100                                                        <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>
101                                                        [% ELSE %]
102                                                        <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>
103                                                        [% END %]
104                                                        [% END # / IF languages_loo.current %]
105                                                [% END # / IF ( languages_loo.plural ) %]
106                                            [% END # / IF ( languages_loo.group_enabled ) %]
107                                        [% END # / FOREACH languages_loo IN languages_loop %]
108                                        </ul> <!-- /# .dropdown-menu -->
109                                     </li> <!-- / .dropdown -->
110                                     [% END # / UNLESS ( one_language_enabled ) %]
111                                 [% END # / IF ( languages_loop && opaclanguagesdisplay ) %]
112                             [% END # / IF opaclanguagesdisplay %]
113                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
114                                     [% UNLESS ( loggedinusername ) %]
115                                         [% IF Koha.Preference('casAuthentication') %]
116                                             [%# CAS authentication is too complicated for modal window %]
117                                             <li><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a></li>
118                                         [% ELSE %]
119                                             <li><a href="/cgi-bin/koha/opac-user.pl" class="loginModal-trigger" role="button" data-toggle="modal">Log in to your account</a></li>
120                                         [% END %]
121                                     [% END %]
122                                     [% IF ( loggedinusername ) %]
123                                         <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>
124                                         <li class="divider-vertical"></li>
125                                     [% END %]
126                                 [% END %]
127                                 [% IF EnableOpacSearchHistory %]
128                                     <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>
129                                     <li class="divider-vertical"></li>
130                                 [% END %]
131                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
132                                     [% IF ( loggedinusername ) %]
133                                         <li><p class="navbar-text">
134                                             [% IF persona %]
135                                                 <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1" onclick='navigator.id.logout();'>
136                                             [% ELSE %]
137                                                 <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
138                                             [% END %]
139                                             Log out</a></p></li>
140                                     [% END %]
141                                 [% END %]
142                             </ul>
143                         </div> <!-- /members -->
144                     [% END # IF opacuserlogin %]
145                 </div> <!-- /container-fluid -->
146             </div> <!-- /navbar-inner -->
147         </div> <!-- /navbar -->
148
149         [% IF ( opacheader ) %]
150             <div class="container-fluid">
151                 <div class="row-fluid">
152                     <div id="opacheader">
153                         [% opacheader %]
154                     </div>
155                 </div>
156             </div>
157         [% END %]
158     </div> <!-- / header-region -->
159
160     <div class="container-fluid">
161         <div class="row-fluid">
162             <div id="opac-main-search">
163     <!--             <div class="span2">
164         [% IF ( opacsmallimage ) %]
165             <h1 id="libraryname" style="background-image: url('[% opacsmallimage %]');">
166         [% ELSE %]
167             <h1 id="libraryname">
168         [% END %]
169             <a href="/cgi-bin/koha/opac-main.pl">[% IF ( LibraryName ) %][% LibraryName %][% ELSE %]Koha Online Catalog[% END %]</a></h1>
170     </div> /.span2 -->
171             <div class="span12">
172                 [% IF ( OpacPublic ) %]
173                     [% UNLESS ( advsearch ) %]
174                         [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
175                             <div class="mastheadsearch librarypulldown">
176                         [% ELSE %]
177                             <div class="mastheadsearch">
178                         [% END %]
179                         [% IF Koha.Preference('OpacCustomSearch') == '' %]
180                             <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
181                                 <label for="masthead_search"> Search
182                                     [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
183                                         [% IF ( mylibraryfirst ) %]
184                                             (in [% mylibraryfirst %] only)
185                                         [% END %]
186                                     [% END %]
187                                 </label>
188
189                                 <select name="idx" id="masthead_search">
190                                 [% IF ( ms_kw ) %]
191                                     <option selected="selected" value="">Library catalog</option>
192                                 [% ELSE %]
193                                     <option value="">Library catalog</option>
194                                 [% END # /ms_kw %]
195                                 [% IF ( ms_ti ) %]
196                                     <option selected="selected" value="ti">Title</option>
197                                 [% ELSE %]
198                                     <option value="ti">Title</option>
199                                 [% END # /ms_ti %]
200                                 [% IF ( ms_au ) %]
201                                     <option selected="selected" value="au">Author</option>
202                                 [% ELSE %]
203                                     <option value="au">Author</option>
204                                 [% END # /ms_au%]
205                                 [% IF ( ms_su ) %]
206                                     <option selected="selected" value="su">Subject</option>
207                                 [% ELSE %]
208                                     <option value="su">Subject</option>
209                                 [% END # /ms_su %]
210                                 [% IF ( ms_nb ) %]
211                                     <option selected="selected" value="nb">ISBN</option>
212                                 [% ELSE %]
213                                     <option value="nb">ISBN</option>
214                                 [% END # /ms_nb%]
215                                 [% IF ( ms_se ) %]
216                                     <option selected="selected" value="se">Series</option>
217                                 [% ELSE %]
218                                     <option value="se">Series</option>
219                                 [% END # /ms_se %]
220                                 [% IF ( numbersphr ) %]
221                                     [% IF ( ms_callnum ) %]
222                                             <option selected="selected" value="callnum,phr">Call number</option>
223                                     [% ELSE %]
224                                         <option value="callnum,phr">Call number</option>
225                                     [% END #/ms_callnum %]
226                                 [% ELSE %]
227                                     [% IF ( ms_callnum ) %]
228                                         <option selected="selected" value="callnum">Call number</option>
229                                     [% ELSE %]
230                                         <option value="callnum">Call number</option>
231                                     [% END # /ms_callnum %]
232                                 [% END # /numbersphr %]
233                                 </select>
234
235                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
236                                     <div class="input-append nolibrarypulldown">
237                                 [% END %]
238                                 [% IF ( ms_value ) %]
239                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" value="[% ms_value |html %]" /><span id="translControl"></span>
240                                 [% ELSE %]
241                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" /><span id="translControl"></span>
242                                 [% END # /ms_value %]
243
244                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
245                                     <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
246                                     </div>
247                                 [% END %]
248
249                                 [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
250                                     <div class="input-append">
251                                         <select name="branch_group_limit" id="select_library">
252                                             <option value="">All libraries</option>
253                                             [% IF BranchCategoriesLoop %]<optgroup label="Libraries">[% END %]
254                                                 [% FOREACH BranchesLoo IN BranchesLoop %]
255                                                     [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
256                                                     [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
257                                                 [% END %]
258                                             [% IF BranchCategoriesLoop %]
259                                                 </optgroup>
260                                                 <optgroup label="Groups">
261                                                     [% FOREACH bc IN BranchCategoriesLoop %]
262                                                         [% IF ( bc.selected ) %]
263                                                             <option selected="selected" value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
264                                                         [% ELSE %]
265                                                             <option value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
266                                                         [% END # / bc.selected %]
267                                                     [% END %]
268                                                 </optgroup>
269                                             [% END # / BranchCategoriesLoop %]
270                                         </select>
271                                         <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
272                                     </div>
273                                 [% ELSE %]
274                                     [% IF ( opac_limit_override ) %]
275                                         [% IF ( opac_search_limit ) %]
276                                             <input name="limit" value="[% opac_search_limit %]" type="hidden" />
277                                         [% END %]
278                                     [% ELSE %]
279                                         [% IF ( mylibraryfirst ) %]
280                                             <input name="limit" value="branch:[% mylibraryfirst %]" type="hidden" />
281                                         [% END %]
282                                     [% END # / opac_limit_override %]
283                                 [% END # / OpacAddMastheadLibraryPulldown %]
284
285                             </form>
286                         [% ELSE # / Koha.Preference('OpacCustomSearch') == '' %]
287                             [% Koha.Preference('OpacCustomSearch') %]
288                         [% END # / Koha.Preference('OpacCustomSearch') == '' %]
289                         </div> <!-- / .mastheadsearch -->
290                     [% END # / UNLESS advsearch %]
291
292                     <div class="row-fluid">
293                             <div id="moresearches">
294                                 <ul>
295                                     <li><a href="/cgi-bin/koha/opac-search.pl">Advanced search</a></li>
296                                     [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]<li><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a></li>[% END %]
297                                     [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a></li>[% END %]
298                                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]<li><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a></li>[% END %]
299                                     [% 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 %]
300                                     [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %]
301                                     [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %]
302                                     [% IF Koha.Preference( 'OpacTopissue' ) == 1 %]<li><a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a></li>[% END %]
303                                     [% IF Koha.Preference( 'suggestion' ) == 1 %]
304                                         [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
305                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
306                                         [% ELSIF ( ( Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 ) ) %]
307                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
308                                         [% END %]
309                                     [% END %]
310                                 </ul>
311                             </div> <!-- /#moresearches -->
312                     </div> <!-- /.row-fluid -->
313
314                 [% END # / OpacPublic %]
315             </div> <!-- /.span10 -->
316             </div> <!-- /.opac-main-search -->
317         </div> <!-- / .row-fluid -->
318     </div> <!-- /.container-fluid -->
319
320     <!-- Login form hidden by default, used for modal window -->
321     <div id="loginModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="modalLoginLabel" aria-hidden="true">
322         <div class="modal-header">
323             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
324             <h3 id="modalLoginLabel">Log in to your account</h3>
325         </div>
326         <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="modalAuth">
327             <div class="modal-body">
328                     [% IF ( shibbolethAuthentication ) %]
329                     [% IF ( invalidShibLogin ) %]
330                     <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
331                     <div class="alert alert-info">
332                         <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p>
333                     </div>
334                     [% ELSE %]
335                     <h4>Shibboleth Login</h4>
336                     <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl %]">click here to login</a>.</p>
337                     <h4>Local Login</h4>
338                     [% END %]
339             [% END %]
340                     <input type="hidden" name="koha_login_context" value="opac" />
341                     <fieldset class="brief">
342                         <label for="muserid">Login:</label><input type="text" id="muserid" name="userid" />
343                         <label for="mpassword">Password:</label><input type="password" id="mpassword" name="password" />
344                     [% IF Koha.Preference( 'NoLoginInstructions' ) %]
345                         <div id="nologininstructions-modal">
346                             [% Koha.Preference( 'NoLoginInstructions' ) %]
347                         </div>
348                     [% END %]
349                         [% 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 %]
350                     </fieldset>
351             </div>
352             <div class="modal-footer">
353                 <input type="submit" class="btn btn-primary" value="Log in" />
354                 <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
355             </div>
356         </form> <!-- /#auth -->
357     </div>  <!-- /#modalAuth  -->