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