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