Bug 28679: Unable to click "Log in to your account" when GoogleOpenIDConnect is enabled
[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 [% SET OpacCustomSearch = KohaNews.get( location => "OpacCustomSearch", lang => lang, library => branchcode, blocktitle => 0 ) %]
10 [% SET OpacLoginInstructions = KohaNews.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %]
11
12 <div id="wrapper">
13     <div id="header-region" class="noprint">
14         <nav class="navbar navbar-expand">
15             <button id="scrolltocontent">Skip to main content</button>
16             <div id="logo">
17             <a class="navbar-brand" href="/cgi-bin/koha/opac-main.pl">
18                 [% IF ( LibraryNameTitle ) %]
19                     [% LibraryNameTitle | html %]
20                 [% ELSE %]
21                     Koha online
22                 [% END %]
23             </a>
24             </div>
25             [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
26                 <div id="cartDetails" class="cart-message">Your cart is empty.</div>
27             [% END %]
28             <ul id="cart-list-nav" class="navbar-nav">
29                 [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
30                     <li class="nav-item js-show">
31                         <a href="#" class="nav-link" title="Collect items you are interested in" id="cartmenulink" role="button">
32                             <i id="carticon" class="fa fa-shopping-cart fa-icon-black" aria-hidden="true"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span>
33                         </a>
34                     </li>
35                 [% END %]
36                 <li class="divider-vertical"></li>
37                 [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) %]
38                     <li class="nav-item dropdown">
39                         <a href="/cgi-bin/koha/opac-shelves.pl" title="Show lists" class="nav-link dropdown-toggle" id="listsmenu" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"
40                             ><i class="fa fa-list fa-icon-black" aria-hidden="true"></i> <span class="listslabel">Lists</span>
41                         </a>
42                         <div aria-labelledby="listsmenu" role="menu" class="dropdown-menu">
43                             [% IF some_public_shelves.count %]
44                                 <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=2" tabindex="-1" role="menuitem"><strong>Public lists</strong></a>
45                                 [% SET number_of_public_shelves = 0 %]
46                                 [% FOREACH s IN some_public_shelves %]
47                                     <a class="dropdown-item" 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>
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                                     <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=2" tabindex="-1" role="menuitem">View All</a>
53                                 [% END %]
54                             [% END %]
55                             [% IF some_public_shelves.count > 0 %]
56                                 <div class="dropdown-divider"></div>
57                             [% END %]
58                             [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
59                                 <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" tabindex="-1" role="menuitem"><strong>Your lists</strong></a>
60                                 [% IF loggedinusername %]
61                                     [% IF some_private_shelves.count %]
62                                         [% SET number_of_private_shelves = 0 %]
63                                         [% FOREACH s IN some_private_shelves %]
64                                             <a class="dropdown-item" 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>
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                                             <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" tabindex="-1" role="menuitem">View All</a>
70                                         [% END %]
71                                     [% ELSE %]
72                                         <a class="dropdown-item disabled" href="#" tabindex="-1" role="menuitem">No private lists</a>
73                                     [% END %]
74                                         <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">New list</a>
75                                 [% ELSE %]
76                                     <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">Log in to create your own lists</a>
77                                 [% END # / IF loggedinusername %]
78                             [% END # / IF opacuserlogin %]
79                         </div> <!-- / .dropdown-menu -->
80                     </li> <!-- / .nav-item.dropdown -->
81                 [% END # / IF virtualshelves %]
82             </ul> <!-- / .navbar-nav -->
83
84             [% IF Koha.Preference( 'opacuserlogin' ) == 1 ||  Koha.Preference( 'EnableOpacSearchHistory') || Koha.Preference( 'opaclanguagesdisplay' ) %]
85                 [% IF ( Koha.Preference( 'opaclanguagesdisplay' ) ) %]
86                     [% INCLUDE 'masthead-langmenu.inc' %]
87                 [% END %]
88                 <ul id="members" class="navbar-nav">
89                     <li class="nav-item dropdown">
90                         [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
91                             [% IF ( loggedinusername ) %]
92                                 <a href="/cgi-bin/koha/opac-user.pl" class="dropdown-toggle" id="user-menu" data-toggle="dropdown" role="button">
93                                     <i class="fa fa-user fa-icon-black fa-fw" aria-hidden="true"></i>
94                                     <span class="userlabel">Welcome, [% INCLUDE 'patron-title.inc' patron = logged_in_user no_html = 1 %]</span>
95                                 </a>
96                             [% ELSE %]
97                                 [% IF Koha.Preference('casAuthentication') %]
98                                     [%# CAS authentication is too complicated for modal window %]
99                                         <a class="nav-link login-link" href="/cgi-bin/koha/opac-user.pl"><i class="fa fa-user fa-icon-black fa-fw" aria-hidden="true"></i> <span class="userlabel">Log in to your account</span></a>
100                                 [% ELSIF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %]
101                                     <a class="nav-link login-link" href="/cgi-bin/koha/svc/auth/googleopenidconnect"><i class="fa fa-user fa-icon-black fa-fw" aria-hidden="true"></i> <span class="userlabel">Log in to your account</span></a>
102                                 [% ELSE %]
103                                     <a href="/cgi-bin/koha/opac-user.pl" class="nav-link login-link loginModal-trigger"><i class="fa fa-user fa-icon-black fa-fw" aria-hidden="true"></i> <span class="userlabel">Log in to your account</span></a>
104                                 [% END %]
105                             [% END %]
106                         [% END %]
107
108                         [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 && loggedinusername ) %]
109                             <div aria-labelledby="user-menu" role="menu" class="dropdown-menu dropdown-menu-right">
110                                 <div id="loggedinuser-menu">
111                                     <p>
112                                         <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 %]" data-categorycode="[% logged_in_user.categorycode | html %]">Your account</span></a>
113                                     </p>
114                                     [% IF Koha.Preference( 'EnableOpacSearchHistory' ) %]
115                                         <p>
116                                             <a tabindex="-1" role="menuitem" class="login-link" href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a>
117                                             <span class="divider-vertical"></span>
118                                             <a class="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>
119                                         </p>
120                                     [% END %]
121                                     <a tabindex="-1" role="menuitem" class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">Log out</a>
122                                 </div>
123                             </div>
124                         [% END %]
125                     </li>
126                     [% IF ( !Koha.Preference( 'opacuserlogin') || !loggedinusername ) %]
127                         [% IF Koha.Preference( 'EnableOpacSearchHistory' ) %]
128                             <li class="nav-item search_history">
129                                 <a class="nav-link login-link" href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a>
130                             </li>
131                             <li class="divider-vertical"></li>
132                             <li class="nav-item">
133                                 <a class="nav-link 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>
134                             </li>
135                         [% END %]
136                     [% END %]
137                 </ul>
138             [% END # IF opacuserlogin || EnableOpacSearchHistory || opaclanguagesdisplay %]
139         </nav> <!-- /navbar -->
140
141         [% IF ( OpacHeader ) %]
142             <div class="container-fluid">
143                 <div class="row">
144                     <div class="col">
145                         [% PROCESS koha_news_block news => OpacHeader %]
146                     </div>
147                 </div>
148             </div>
149         [% END %]
150
151     </div> <!-- / header-region -->
152
153     [% IF ( OpacPublic ) %]
154         <div class="container-fluid">
155             [% UNLESS ( advsearch ) %]
156                 <div class="row">
157                     <div class="col">
158                             <div id="opac-main-search">
159                                 [% IF ( OpacCustomSearch ) %]
160                                     [% PROCESS koha_news_block news => OpacCustomSearch %]
161                                 [% ELSE %]
162                                     <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform">
163                                         <div class="form-row align-items-center">
164                                             <div class="col-sm-auto order-1 order-sm-1">
165                                                 <label for="masthead_search"> Search
166                                                     [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
167                                                         [% IF ( mylibraryfirst ) %]
168                                                             (in [% Branches.GetName( mylibraryfirst ) | html %] only)
169                                                         [% END %]
170                                                     [% END %]
171                                                 </label>
172                                             </div>
173                                             <div class="col-sm-auto order-2 order-sm-2">
174                                                 <select name="idx" id="masthead_search" class="form-control">
175                                                     [% IF ( ms_kw ) %]
176                                                         <option selected="selected" value="">Library catalog</option>
177                                                     [% ELSE %]
178                                                         <option value="">Library catalog</option>
179                                                     [% END # /ms_kw %]
180                                                     [% IF ( ms_ti ) %]
181                                                         <option selected="selected" value="ti">Title</option>
182                                                     [% ELSE %]
183                                                         <option value="ti">Title</option>
184                                                     [% END # /ms_ti %]
185                                                     [% IF ( ms_au ) %]
186                                                         <option selected="selected" value="au">Author</option>
187                                                     [% ELSE %]
188                                                         <option value="au">Author</option>
189                                                     [% END # /ms_au%]
190                                                     [% IF ( ms_su ) %]
191                                                         <option selected="selected" value="su">Subject</option>
192                                                     [% ELSE %]
193                                                         <option value="su">Subject</option>
194                                                     [% END # /ms_su %]
195                                                     [% IF ( ms_nb ) %]
196                                                         <option selected="selected" value="nb">ISBN</option>
197                                                     [% ELSE %]
198                                                         <option value="nb">ISBN</option>
199                                                     [% END # /ms_nb%]
200                                                     [% IF ( ms_ns ) %]
201                                                         <option selected="selected" value="ns">ISSN</option>
202                                                     [% ELSE %]
203                                                         <option value="ns">ISSN</option>
204                                                     [% END # /ms_ns%]
205                                                     [% IF ( ms_se ) %]
206                                                         <option selected="selected" value="se">Series</option>
207                                                     [% ELSE %]
208                                                         <option value="se">Series</option>
209                                                     [% END # /ms_se %]
210                                                     [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
211                                                         [% IF ( ms_callnumcommaphr ) %]
212                                                             <option selected="selected" value="callnum,phr">Call number</option>
213                                                         [% ELSE %]
214                                                             <option value="callnum,phr">Call number</option>
215                                                         [% END #/ms_callnumcommaphr %]
216                                                     [% ELSE %]
217                                                         [% IF ( ms_callnum ) %]
218                                                             <option selected="selected" value="callnum">Call number</option>
219                                                         [% ELSE %]
220                                                             <option value="callnum">Call number</option>
221                                                         [% END # /ms_callnum %]
222                                                     [% END # /IF OPACNumbersPreferPhrase %]
223                                                 </select>
224                                             </div> <!-- /.col-sm-auto -->
225
226                                             <div class="col order-4 order-sm-3">
227                                                 [% IF ( ms_value ) %]
228                                                     <input type="text" title="Type search term" class="transl1 form-control" id="translControl1" name="q" value="[% ms_value | html %]" /><span id="translControl"></span>
229                                                 [% ELSE %]
230                                                     <input type="text" title="Type search term" class="transl1 form-control" id="translControl1" name="q" /><span id="translControl"></span>
231                                                 [% END # /ms_value %]
232                                             </div> <!-- /.col -->
233
234                                             [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
235                                                 <div class="col-sm col-md-3 col-lg-2 order-3 order-sm-4">
236                                                     <select name="branch_group_limit" id="select_library" class="form-control">
237                                                         <option value="">All libraries</option>
238
239                                                         [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]
240
241                                                         [% FOREACH library IN Branches.all( selected => opac_name ) %]
242                                                             [% IF library.selected %]
243                                                                 <option selected="selected" value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
244                                                             [% ELSE %]
245                                                                 <option value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
246                                                             [% END %]
247                                                         [% END %]
248
249                                                         [% IF LibrarySearchGroups %]
250                                                             </optgroup>
251                                                             <optgroup label="Groups">
252                                                                 [% FOREACH lsg IN LibrarySearchGroups %]
253                                                                     [% IF lsg.id == opac_name %]
254                                                                         <option selected="selected" value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
255                                                                     [% ELSE %]
256                                                                         <option value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
257                                                                     [% END # / bc.selected %]
258                                                                 [% END %]
259                                                             </optgroup>
260                                                         [% END # / BranchCategoriesLoop %]
261                                                     </select> <!-- /#select_library -->
262                                                 </div> <!-- /.col-sm-auto -->
263                                                 <div class="col-sm-auto order-5">
264                                                     <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
265                                                 </div>
266                                             [% ELSE %]
267                                                 [% IF ( opac_limit_override ) %]
268                                                     [% IF ( opac_search_limit ) %]
269                                                         [% IF ( multibranchlimit = opac_search_limit.match( 'branch:(multibranchlimit-\d+)' ) ) %]
270                                                             <input name="branch_group_limit" value="[% multibranchlimit.0 | html %]" type="hidden" />
271                                                         [% ELSE %]
272                                                             <input name="limit" value="[% opac_search_limit | html %]" type="hidden" />
273                                                         [% END %]
274                                                     [% END %]
275                                                 [% ELSE %]
276                                                     [% IF ( mylibraryfirst ) %]
277                                                         <input name="limit" value="branch:[% mylibraryfirst | html %]" type="hidden" />
278                                                     [% END %]
279                                                 [% END # / opac_limit_override %]
280                                                 <div class="order-5 col-sm-auto">
281                                                     <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
282                                                 </div>
283                                             [% END # / OpacAddMastheadLibraryPulldown %]
284                                         </div> <!-- /.form-row -->
285                                         <input type="hidden" name="weight_search" value="1">
286                                     </form>
287                                 [% END # / ( OpacCustomSearch ) %]
288                             </div><!-- /#opac-main-search -->
289                     </div> <!-- /.col -->
290                 </div> <!-- /.row -->
291             [% END # / UNLESS advsearch %]
292
293             <div class="row">
294                 <ul class="nav" id="moresearches">
295                     <li class="nav-item">
296                         <a href="/cgi-bin/koha/opac-search.pl">Advanced search</a>
297                     </li>
298                     [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]
299                         <li class="nav-item">
300                             <a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>
301                         </li>
302                     [% END %]
303                     [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]
304                         <li class="nav-item">
305                             <a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a>
306                         </li>
307                     [% END %]
308                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
309                         <li class="nav-item">
310                             <a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a>
311                         </li>
312                     [% END %]
313                     [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACComments' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]
314                         <li class="nav-item">
315                             <a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a>
316                         </li>
317                     [% END %]
318                     [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]
319                         <li class="nav-item">
320                             <a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a>
321                         </li>
322                     [% END %]
323                     [% IF Koha.Preference( 'OpacCloud' ) == 1 %]
324                         <li class="nav-item">
325                             <a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a>
326                         </li>
327                     [% END %]
328                     [% IF Koha.Preference( 'OpacTopissue' ) == 1 %]
329                         <li class="nav-item">
330                             <a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a>
331                         </li>
332                     [% END %]
333                     [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' && Koha.Preference( 'OpacBrowseSearch' ) == 1 %]
334                         <li class="nav-item">
335                             <a href="/cgi-bin/koha/opac-browse.pl">Browse search</a>
336                         </li>
337                     [% END %]
338                     [% IF Koha.Preference( 'suggestion' ) == 1 %]
339                         [% IF Koha.Preference( 'AnonSuggestions' ) == 1 || Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]
340                             <li class="nav-item">
341                                 <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">Purchase suggestions</a>
342                             </li>
343                         [% END %]
344                     [% END %]
345                     <li class="nav-item">
346                         <a id="library_page" href="/cgi-bin/koha/opac-library.pl">
347                             [% IF ( singleBranchMode ) %]
348                                 Library
349                             [% ELSE %]
350                                 Libraries
351                             [% END %]
352                         </a>
353                     </li>
354                     [% Koha.Preference('OpacMoreSearches') | $raw %]
355                 </ul> <!-- /.nav#moresearches -->
356             </div> <!-- /.row -->
357         </div> <!-- /.container-fluid -->
358     [% END # / OpacPublic %]
359
360     <!-- Login form hidden by default, used for modal window -->
361     <div id="loginModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="modalLoginLabel" aria-hidden="true">
362         <div class="modal-dialog">
363             <div class="modal-content">
364                 <div class="modal-header">
365                     <h2 class="modal-title" id="modalLoginLabel">Log in to your account</h2>
366                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
367                         <span aria-hidden="true">&times;</span>
368                     </button>
369                 </div>
370                 <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="modalAuth">
371                     <input type="hidden" name="has-search-query" id="has-search-query" value="" />
372                     <div class="modal-body">
373                         [% IF ( shibbolethAuthentication ) %]
374                             [% IF ( invalidShibLogin ) %]
375                                 <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
376                                 <div class="alert alert-info">
377                                     <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p>
378                                 </div>
379                             [% ELSE %]
380                                 <h3>Shibboleth login</h3>
381                                 <p><a href="[% shibbolethLoginUrl | $raw %]">Log in using a Shibboleth account</a>.</p>
382                                 [% UNLESS Koha.Preference('opacShibOnly') %]
383                                     <h3>Local Login</h3>
384                                 [% END %]
385                             [% END %]
386                         [% END %]
387                         [% UNLESS Koha.Preference('opacShibOnly') %]
388                             <input type="hidden" name="koha_login_context" value="opac" />
389                             <fieldset class="brief">
390                                 <label for="muserid">Login:</label><input type="text" id="muserid" name="userid" />
391                                 <label for="mpassword">Password:</label><input type="password" id="mpassword" name="password" />
392                                 [% IF OpacLoginInstructions %]
393                                     <div id="nologininstructions-modal" class="nologininstructions">
394                                         [% PROCESS koha_news_block news => OpacLoginInstructions %]
395                                     </div>
396                                 [% END %]
397                                 [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
398                                     <div id="forgotpassword-modal" class="forgotpassword">
399                                         <a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
400                                     </div>
401                                 [% END %]
402                                 [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
403                                     <div id="patronregistration-modal" class="patronregistration">
404                                         <p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p>
405                                     </div>
406                                 [% END %]
407                             </fieldset>
408                         [% END %]
409                     </div>
410                     [% UNLESS Koha.Preference('opacShibOnly') %]
411                         <div class="modal-footer">
412                             <input type="submit" class="btn btn-primary" value="Log in" />
413                         </div>
414                     [% END %]
415                 </form> <!-- /#auth -->
416             </div> <!-- /.modal-content -->
417         </div> <!-- /.modal-dialog -->
418     </div>  <!-- /#modalAuth  -->