Bug 22807: Add 'Skip to content' option
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / masthead.inc
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Branches %]
4 [% USE Categories %]
5 [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
6 <div id="wrap">
7     <div id="header-region" class="noprint">
8         <div class="navbar navbar-inverse navbar-static-top">
9             <div class="navbar-inner">
10                 <div class="container-fluid">
11                     <button id="scrolltocontent" class="sr-only sr-only-focusable pull-left nav btn btn-danger" type="button">Skip to main content</button>
12                     <h1 id="logo">
13                         <a class="brand" href="/cgi-bin/koha/opac-main.pl">
14                             [% IF ( LibraryNameTitle ) %]
15                                 [% LibraryNameTitle | html %]
16                             [% ELSE %]
17                                 Koha online
18                             [% END %]
19                         </a>
20                     </h1>
21                     [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
22                         <div id="cartDetails" class="cart-message">Your cart is empty.</div>
23                     [% END %]
24                     <ul class="nav">
25                         [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
26                             <li>
27                                 <a href="#" title="Collect items you are interested in" id="cartmenulink" role="button">
28                                     <i id="carticon" class="fa fa-shopping-cart fa-icon-white"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span>
29                                 </a>
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="fa fa-list fa-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 some_public_shelves.count %]
40                                     <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>
41                                     [% SET number_of_public_shelves = 0 %]
42                                     [% FOREACH s IN some_public_shelves %]
43                                         <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>
44                                         [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
45                                         [% IF number_of_public_shelves >= 10 %][% LAST %][% END %]
46                                     [% END %]
47                                     [% IF some_public_shelves > 10 %]
48                                         <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>
49                                     [% END %]
50                                 [% END %]
51                                 [% IF some_public_shelves.count > 0 %]
52                                     <li class="divider" role="presentation"></li>
53                                 [% END %]
54                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
55                                     <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>
56                                     [% IF loggedinusername %]
57                                         [% IF some_private_shelves.count %]
58                                             [% SET number_of_private_shelves = 0 %]
59                                             [% FOREACH s IN some_private_shelves %]
60                                                 <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>
61                                                 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
62                                                 [% IF number_of_private_shelves >= 10 %][% LAST %][% END %]
63                                             [% END %]
64                                             [% IF some_private_shelves > 10 %]
65                                                 <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>
66                                             [% END %]
67                                         [% ELSE %]
68                                             <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No private lists</a></li>
69                                         [% END %]
70                                             <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem" class="listmenulink">New list</a></li>
71                                     [% ELSE %]
72                                         [% IF Koha.Preference('casAuthentication') %]
73                                             [%# CAS authentication is too complicated for modal window %]
74                                             <li role="presentation"><a href="/cgi-bin/koha/opac-user.pl" tabindex="-1" class="menu-inactive" role="menuitem">Log in to create your own lists</a></li>
75                                         [% ELSE %]
76                                             <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>
77                                         [% END %]
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"></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"></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"></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"></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"></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"></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                     <div id="opacheader">
156                         [% opacheader | $raw %]
157                     </div>
158                 </div>
159             </div>
160         [% END %]
161     </div> <!-- / header-region -->
162
163     <div class="container-fluid">
164         <div class="row-fluid">
165             <div id="opac-main-search">
166             <div class="span12">
167                 [% IF ( OpacPublic ) %]
168                     [% UNLESS ( advsearch ) %]
169                         [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
170                             <div class="mastheadsearch librarypulldown">
171                         [% ELSE %]
172                             <div class="mastheadsearch">
173                         [% END %]
174                         [% IF Koha.Preference('OpacCustomSearch') == '' %]
175                             <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
176                                 <label for="masthead_search"> Search
177                                     [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
178                                         [% IF ( mylibraryfirst ) %]
179                                             (in [% Branches.GetName( mylibraryfirst ) | html %] only)
180                                         [% END %]
181                                     [% END %]
182                                 </label>
183
184                                 <select name="idx" id="masthead_search">
185                                 [% IF ( ms_kw ) %]
186                                     <option selected="selected" value="">Library catalog</option>
187                                 [% ELSE %]
188                                     <option value="">Library catalog</option>
189                                 [% END # /ms_kw %]
190                                 [% IF ( ms_ti ) %]
191                                     <option selected="selected" value="ti">Title</option>
192                                 [% ELSE %]
193                                     <option value="ti">Title</option>
194                                 [% END # /ms_ti %]
195                                 [% IF ( ms_au ) %]
196                                     <option selected="selected" value="au">Author</option>
197                                 [% ELSE %]
198                                     <option value="au">Author</option>
199                                 [% END # /ms_au%]
200                                 [% IF ( ms_su ) %]
201                                     <option selected="selected" value="su">Subject</option>
202                                 [% ELSE %]
203                                     <option value="su">Subject</option>
204                                 [% END # /ms_su %]
205                                 [% IF ( ms_nb ) %]
206                                     <option selected="selected" value="nb">ISBN</option>
207                                 [% ELSE %]
208                                     <option value="nb">ISBN</option>
209                                 [% END # /ms_nb%]
210                                 [% IF ( ms_ns ) %]
211                                     <option selected="selected" value="ns">ISSN</option>
212                                 [% ELSE %]
213                                     <option value="ns">ISSN</option>
214                                 [% END # /ms_ns%]
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 ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
221                                     [% IF ( ms_callnumcommaphr ) %]
222                                         <option selected="selected" value="callnum,phr">Call number</option>
223                                     [% ELSE %]
224                                         <option value="callnum,phr">Call number</option>
225                                     [% END #/ms_callnumcommaphr %]
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 # /IF OPACNumbersPreferPhrase %]
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
254                                             [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]
255
256                                             [% FOREACH library IN Branches.all( selected => opac_name ) %]
257                                                 [% IF library.selected %]
258                                                     <option selected="selected" value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
259                                                 [% ELSE %]
260                                                     <option value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
261                                                 [% END %]
262                                             [% END %]
263
264                                             [% IF LibrarySearchGroups %]
265                                                 </optgroup>
266                                                 <optgroup label="Groups">
267                                                     [% FOREACH lsg IN LibrarySearchGroups %]
268                                                         [% IF lsg.id == opac_name %]
269                                                             <option selected="selected" value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
270                                                         [% ELSE %]
271                                                             <option value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
272                                                         [% END # / bc.selected %]
273                                                     [% END %]
274                                                 </optgroup>
275                                             [% END # / BranchCategoriesLoop %]
276                                         </select>
277                                         <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
278                                     </div>
279                                 [% ELSE %]
280                                     [% IF ( opac_limit_override ) %]
281                                         [% IF ( opac_search_limit ) %]
282                                             [% IF ( multibranchlimit = opac_search_limit.match( 'branch:(multibranchlimit-\d+)' ) ) %]
283                                                 <input name="branch_group_limit" value="[% multibranchlimit.0 | html %]" type="hidden" />
284                                             [% ELSE %]
285                                                 <input name="limit" value="[% opac_search_limit | html %]" type="hidden" />
286                                             [% END %]
287                                         [% END %]
288                                     [% ELSE %]
289                                         [% IF ( mylibraryfirst ) %]
290                                             <input name="limit" value="branch:[% mylibraryfirst | html %]" type="hidden" />
291                                         [% END %]
292                                     [% END # / opac_limit_override %]
293                                 [% END # / OpacAddMastheadLibraryPulldown %]
294
295                             </form>
296                         [% ELSE # / Koha.Preference('OpacCustomSearch') == '' %]
297                             [% Koha.Preference('OpacCustomSearch') | $raw %]
298                         [% END # / Koha.Preference('OpacCustomSearch') == '' %]
299                         </div> <!-- / .mastheadsearch -->
300                     [% END # / UNLESS advsearch %]
301
302                     <div class="row-fluid">
303                             <div id="moresearches">
304                                 <ul>
305                                     <li><a href="/cgi-bin/koha/opac-search.pl">Advanced search</a></li>
306                                     [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]<li><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a></li>[% END %]
307                                     [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a></li>[% END %]
308                                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]<li><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a></li>[% END %]
309                                     [% 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 %]
310                                     [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %]
311                                     [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %]
312                                     [% IF Koha.Preference( 'OpacTopissue' ) == 1 %]<li><a href="/cgi-bin/koha/opac-topissues.pl">Most popular</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                                     [% Koha.Preference('OpacMoreSearches') | $raw %]
319                                 </ul>
320                             </div> <!-- /#moresearches -->
321                     </div> <!-- /.row-fluid -->
322
323                 [% END # / OpacPublic %]
324             </div> <!-- /.span10 -->
325             </div> <!-- /.opac-main-search -->
326         </div> <!-- / .row-fluid -->
327     </div> <!-- /.container-fluid -->
328
329     <!-- Login form hidden by default, used for modal window -->
330     <div id="loginModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="modalLoginLabel" aria-hidden="true">
331         <div class="modal-header">
332             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
333             <h3 id="modalLoginLabel">Log in to your account</h3>
334         </div>
335         <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="modalAuth">
336             <input type="hidden" name="has-search-query" id="has-search-query" value="" />
337             <div class="modal-body">
338                 [% IF ( shibbolethAuthentication ) %]
339                     [% IF ( invalidShibLogin ) %]
340                         <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
341                         <div class="alert alert-info">
342                             <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p>
343                         </div>
344                     [% ELSE %]
345                         <h4>Shibboleth login</h4>
346                         <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl | $raw %]">click here to login</a>.</p>
347                         <h4>Local Login</h4>
348                     [% END %]
349                 [% END %]
350                 <input type="hidden" name="koha_login_context" value="opac" />
351                 <fieldset class="brief">
352                     <label for="muserid">Login:</label><input type="text" id="muserid" name="userid" />
353                     <label for="mpassword">Password:</label><input type="password" id="mpassword" name="password" />
354                     [% IF Koha.Preference( 'OpacLoginInstructions' ) %]
355                         <div id="nologininstructions-modal" class="nologininstructions">
356                             [% Koha.Preference( 'OpacLoginInstructions' ) | $raw %]
357                         </div>
358                     [% END %]
359                     [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
360                         <div id="forgotpassword-modal" class="forgotpassword">
361                             <a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
362                         </div>
363                     [% END %]
364                     [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
365                         <div id="patronregistration-modal" class="patronregistration">
366                             <p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p>
367                         </div>
368                     [% END %]
369                 </fieldset>
370             </div>
371             <div class="modal-footer">
372                 <input type="submit" class="btn btn-primary" value="Log in" />
373             </div>
374         </form> <!-- /#auth -->
375     </div>  <!-- /#modalAuth  -->