Bug 24746: Duplicate id in opacheader markup
[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                     <h1 id="logo">
16                         <a class="brand" href="/cgi-bin/koha/opac-main.pl">
17                             [% IF ( LibraryNameTitle ) %]
18                                 [% LibraryNameTitle | html %]
19                             [% ELSE %]
20                                 Koha online
21                             [% END %]
22                         </a>
23                     </h1>
24                     [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
25                         <div id="cartDetails" class="cart-message">Your cart is empty.</div>
26                     [% END %]
27                     <ul class="nav">
28                         [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
29                             <li>
30                                 <a href="#" title="Collect items you are interested in" id="cartmenulink" role="button">
31                                     <i id="carticon" class="fa fa-shopping-cart fa-icon-white"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span>
32                                 </a>
33                             </li>
34                         [% END %]
35                         [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) && ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
36                             <li class="divider-vertical"></li>
37                         [% END %]
38                         [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) %]
39                             <li class="dropdown">
40                                 <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>
41                                 <ul aria-labelledby="listsmenu" role="menu" class="dropdown-menu">
42                                 [% IF some_public_shelves.count %]
43                                     <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>
44                                     [% SET number_of_public_shelves = 0 %]
45                                     [% FOREACH s IN some_public_shelves %]
46                                         <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>
47                                         [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
48                                         [% IF number_of_public_shelves >= 10 %][% LAST %][% END %]
49                                     [% END %]
50                                     [% IF some_public_shelves > 10 %]
51                                         <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>
52                                     [% END %]
53                                 [% END %]
54                                 [% IF some_public_shelves.count > 0 %]
55                                     <li class="divider" role="presentation"></li>
56                                 [% END %]
57                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
58                                     <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>
59                                     [% IF loggedinusername %]
60                                         [% IF some_private_shelves.count %]
61                                             [% SET number_of_private_shelves = 0 %]
62                                             [% FOREACH s IN some_private_shelves %]
63                                                 <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>
64                                                 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
65                                                 [% IF number_of_private_shelves >= 10 %][% LAST %][% END %]
66                                             [% END %]
67                                             [% IF some_private_shelves > 10 %]
68                                                 <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>
69                                             [% END %]
70                                         [% ELSE %]
71                                             <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No private lists</a></li>
72                                         [% END %]
73                                             <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem" class="listmenulink">New list</a></li>
74                                     [% ELSE %]
75                                         <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>
76                                     [% END # / IF loggedinusername %]
77                                 [% END # / IF opacuserlogin %]
78                                 </ul> <!-- / .dropdown-menu -->
79                             </li> <!-- / .dropdown -->
80                         [% END # / IF virtualshelves %]
81                     </ul> <!-- / .nav -->
82
83                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 ||  Koha.Preference( 'EnableOpacSearchHistory') || Koha.Preference( 'opaclanguagesdisplay' ) %]
84
85                         <div id="members" class="pull-right">
86                             [% IF ( Koha.Preference( 'opaclanguagesdisplay' ) ) %]
87                                 [% INCLUDE 'masthead-langmenu.inc' %]
88                             [% END %]
89                             <ul class="nav">
90                                 <li class="dropdown">
91                                     [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
92                                         [% IF ( loggedinusername ) %]
93                                             <a href="#" class="dropdown-toggle" id="user-menu" data-toggle="dropdown" role="button">
94                                                 <i class="fa fa-user fa-icon-white fa-fw"></i>
95                                                 <span class="userlabel">Welcome, [% INCLUDE 'patron-title.inc' patron = logged_in_user no_html = 1 %]</span>
96                                                 <b class="caret"></b>
97                                             </a>
98                                         [% ELSE %]
99                                             [% IF Koha.Preference('casAuthentication') %]
100                                                 [%# CAS authentication is too complicated for modal window %]
101                                                     <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>
102                                             [% ELSIF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %]
103                                                 <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>
104                                             [% ELSE %]
105                                                 <a href="/cgi-bin/koha/opac-user.pl" class="login-link loginModal-trigger" 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                                             [% END %]
107                                         [% END %]
108                                     [% END %]
109
110                                     [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 && loggedinusername ) %]
111                                         <ul aria-labelledby="user-menu" role="menu" class="dropdown-menu dropdown-menu-right">
112                                             <li role="presentation">
113                                                 <div id="loggedinuser-menu">
114                                                     <p>
115                                                         <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>
116                                                     </p>
117                                                     [% IF Koha.Preference( 'EnableOpacSearchHistory' ) %]
118                                                         <p class="search_history">
119                                                             <a tabindex="-1" role="menuitem" class="login-link" href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a>
120                                                             <span class="divider-vertical"></span>
121                                                             <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>
122                                                         </p>
123                                                     [% END %]
124                                                     <p>
125                                                         <a tabindex="-1" role="menuitem" class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
126                                                         Log out</a>
127                                                     </p>
128                                                 </div>
129                                             </li>
130                                         </ul>
131                                     [% END %]
132                                 </li>
133                                 [% IF ( !Koha.Preference( 'opacuserlogin') || !loggedinusername ) %]
134                                     [% IF Koha.Preference( 'EnableOpacSearchHistory' ) %]
135                                         <li class="search_history">
136                                             <a href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a>
137                                             <span class="divider-vertical"></span>
138                                             <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>
139                                         </li>
140                                     [% END %]
141                                 [% END %]
142                             </ul>
143                         </div> <!-- /members -->
144                     [% END # IF opacuserlogin || EnableOpacSearchHistory || opaclanguagesdisplay %]
145
146                 </div> <!-- /container-fluid -->
147             </div> <!-- /navbar-inner -->
148         </div> <!-- /navbar -->
149
150         [% IF ( OpacHeader ) %]
151             <div class="container-fluid">
152                 <div class="row-fluid">
153                     [% PROCESS koha_news_block news => OpacHeader %]
154                 </div>
155             </div>
156         [% END %]
157
158     </div> <!-- / header-region -->
159
160     <div class="container-fluid">
161         <div class="row-fluid">
162             <div id="opac-main-search">
163             <div class="span12">
164                 [% IF ( OpacPublic ) %]
165                     [% UNLESS ( advsearch ) %]
166                         [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
167                             <div class="mastheadsearch librarypulldown">
168                         [% ELSE %]
169                             <div class="mastheadsearch">
170                         [% END %]
171                         [% IF Koha.Preference('OpacCustomSearch') == '' %]
172                             <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
173                                 <label for="masthead_search"> Search
174                                     [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
175                                         [% IF ( mylibraryfirst ) %]
176                                             (in [% Branches.GetName( mylibraryfirst ) | html %] only)
177                                         [% END %]
178                                     [% END %]
179                                 </label>
180
181                                 <select name="idx" id="masthead_search">
182                                 [% IF ( ms_kw ) %]
183                                     <option selected="selected" value="">Library catalog</option>
184                                 [% ELSE %]
185                                     <option value="">Library catalog</option>
186                                 [% END # /ms_kw %]
187                                 [% IF ( ms_ti ) %]
188                                     <option selected="selected" value="ti">Title</option>
189                                 [% ELSE %]
190                                     <option value="ti">Title</option>
191                                 [% END # /ms_ti %]
192                                 [% IF ( ms_au ) %]
193                                     <option selected="selected" value="au">Author</option>
194                                 [% ELSE %]
195                                     <option value="au">Author</option>
196                                 [% END # /ms_au%]
197                                 [% IF ( ms_su ) %]
198                                     <option selected="selected" value="su">Subject</option>
199                                 [% ELSE %]
200                                     <option value="su">Subject</option>
201                                 [% END # /ms_su %]
202                                 [% IF ( ms_nb ) %]
203                                     <option selected="selected" value="nb">ISBN</option>
204                                 [% ELSE %]
205                                     <option value="nb">ISBN</option>
206                                 [% END # /ms_nb%]
207                                 [% IF ( ms_ns ) %]
208                                     <option selected="selected" value="ns">ISSN</option>
209                                 [% ELSE %]
210                                     <option value="ns">ISSN</option>
211                                 [% END # /ms_ns%]
212                                 [% IF ( ms_se ) %]
213                                     <option selected="selected" value="se">Series</option>
214                                 [% ELSE %]
215                                     <option value="se">Series</option>
216                                 [% END # /ms_se %]
217                                 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
218                                     [% IF ( ms_callnumcommaphr ) %]
219                                         <option selected="selected" value="callnum,phr">Call number</option>
220                                     [% ELSE %]
221                                         <option value="callnum,phr">Call number</option>
222                                     [% END #/ms_callnumcommaphr %]
223                                 [% ELSE %]
224                                     [% IF ( ms_callnum ) %]
225                                         <option selected="selected" value="callnum">Call number</option>
226                                     [% ELSE %]
227                                         <option value="callnum">Call number</option>
228                                     [% END # /ms_callnum %]
229                                 [% END # /IF OPACNumbersPreferPhrase %]
230                                 </select>
231
232                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
233                                     <div class="input-append nolibrarypulldown">
234                                 [% END %]
235                                 [% IF ( ms_value ) %]
236                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" value="[% ms_value | html %]" /><span id="translControl"></span>
237                                 [% ELSE %]
238                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" /><span id="translControl"></span>
239                                 [% END # /ms_value %]
240
241                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
242                                     <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
243                                     </div>
244                                 [% END %]
245
246                                 [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
247                                     <div class="input-append">
248                                         <select name="branch_group_limit" id="select_library">
249                                             <option value="">All libraries</option>
250
251                                             [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]
252
253                                             [% FOREACH library IN Branches.all( selected => opac_name ) %]
254                                                 [% IF library.selected %]
255                                                     <option selected="selected" value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
256                                                 [% ELSE %]
257                                                     <option value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
258                                                 [% END %]
259                                             [% END %]
260
261                                             [% IF LibrarySearchGroups %]
262                                                 </optgroup>
263                                                 <optgroup label="Groups">
264                                                     [% FOREACH lsg IN LibrarySearchGroups %]
265                                                         [% IF lsg.id == opac_name %]
266                                                             <option selected="selected" value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
267                                                         [% ELSE %]
268                                                             <option value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
269                                                         [% END # / bc.selected %]
270                                                     [% END %]
271                                                 </optgroup>
272                                             [% END # / BranchCategoriesLoop %]
273                                         </select>
274                                         <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
275                                     </div>
276                                 [% ELSE %]
277                                     [% IF ( opac_limit_override ) %]
278                                         [% IF ( opac_search_limit ) %]
279                                             [% IF ( multibranchlimit = opac_search_limit.match( 'branch:(multibranchlimit-\d+)' ) ) %]
280                                                 <input name="branch_group_limit" value="[% multibranchlimit.0 | html %]" type="hidden" />
281                                             [% ELSE %]
282                                                 <input name="limit" value="[% opac_search_limit | html %]" type="hidden" />
283                                             [% END %]
284                                         [% END %]
285                                     [% ELSE %]
286                                         [% IF ( mylibraryfirst ) %]
287                                             <input name="limit" value="branch:[% mylibraryfirst | html %]" type="hidden" />
288                                         [% END %]
289                                     [% END # / opac_limit_override %]
290                                 [% END # / OpacAddMastheadLibraryPulldown %]
291
292                             </form>
293                         [% ELSE # / Koha.Preference('OpacCustomSearch') == '' %]
294                             [% Koha.Preference('OpacCustomSearch') | $raw %]
295                         [% END # / Koha.Preference('OpacCustomSearch') == '' %]
296                         </div> <!-- / .mastheadsearch -->
297                     [% END # / UNLESS advsearch %]
298
299                     <div class="row-fluid">
300                             <div id="moresearches">
301                                 <ul>
302                                     <li><a href="/cgi-bin/koha/opac-search.pl">Advanced search</a></li>
303                                     [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]<li><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a></li>[% END %]
304                                     [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a></li>[% END %]
305                                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]<li><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a></li>[% END %]
306                                     [% 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 %]
307                                     [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %]
308                                     [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %]
309                                     [% IF Koha.Preference( 'OpacTopissue' ) == 1 %]<li><a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a></li>[% END %]
310                                     [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' && Koha.Preference( 'OpacBrowseSearch' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browse.pl">Browse search</a></li>[% END %]
311                                     [% IF Koha.Preference( 'suggestion' ) == 1 %]
312                                         [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
313                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
314                                         [% ELSIF ( ( Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 ) ) %]
315                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">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  -->