Bug 17530: Use can_article_request to control sidebar link
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / masthead.inc
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Branches %]
4 [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
5 <div id="wrap">
6     <div id="header-region" class="noprint">
7         <div class="navbar navbar-inverse navbar-static-top">
8             <div class="navbar-inner">
9                 <div class="container-fluid">
10                     <h1 id="logo">
11                         <a class="brand" href="/cgi-bin/koha/opac-main.pl">
12                             [% IF ( LibraryNameTitle ) %]
13                                 [% LibraryNameTitle | html %]
14                             [% ELSE %]
15                                 Koha online
16                             [% END %]
17                         </a>
18                     </h1>
19                     [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
20                         <div id="cartDetails" class="cart-message">Your cart is empty.</div>
21                     [% END %]
22                     <ul class="nav">
23                         [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
24                             <li class="dropdown">
25                                 <a href="#" title="Collect items you are interested in" class="dropdown-toggle" id="cartmenulink" data-toggle="dropdown" role="button">
26                                     <i id="carticon" class="fa fa-shopping-cart fa-icon-white"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span> <b class="caret"></b>
27                                 </a>
28                                 <ul aria-labelledby="cartmenulink" role="menu" class="dropdown-menu">
29                                     <li role="presentation">
30                                         <a href="#" id="cartmenuitem" class="cart-message" tabindex="-1" role="menuitem">Your cart is empty.</a>
31                                     </li>
32                                 </ul>
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 | html %]&amp;sortfield=[% s.sortfield | html %]" 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 | html %][% 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                                 [% ELSE %]
54                                     <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No public lists</a></li>
55                                 [% END %]
56                                 <li class="divider" role="presentation"></li>
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 | html %]&amp;sortfield=[% s.sortfield | html %]" 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 | html %][% 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                                         [% IF Koha.Preference('casAuthentication') %]
76                                             [%# CAS authentication is too complicated for modal window %]
77                                             <li role="presentation"><a href="/cgi-bin/koha/opac-user.pl" tabindex="-1" class="menu-inactive" role="menuitem">Log in to create your own lists</a></li>
78                                         [% ELSE %]
79                                             <li role="presentation"><a href="/cgi-bin/koha/opac-user.pl" tabindex="-1" class="menu-inactive loginModal-trigger" role="menuitem">Log in to create your own lists</a></li>
80                                         [% END %]
81                                     [% END # / IF loggedinusername %]
82                                 [% END # / IF opacuserlogin %]
83                                 </ul> <!-- / .dropdown-menu -->
84                             </li> <!-- / .dropdown -->
85                         [% END # / IF virtualshelves %]
86                     </ul> <!-- / .nav -->
87                     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]<div id="listsDetails"></div>[% END %]
88                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 || opaclanguagesdisplay || EnableOpacSearchHistory %]
89                         <a id="user-menu-trigger" class="pull-right" href="#"><i class="fa fa-user fa-icon-white"></i> <span class="caret"></span></a>
90                         <div id="members">
91                             <ul class="nav pull-right">
92
93                                 [% INCLUDE 'masthead-langmenu.inc' %]
94
95                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
96                                     [% UNLESS ( loggedinusername ) %]
97                                         [% IF Koha.Preference('casAuthentication') %]
98                                             [%# CAS authentication is too complicated for modal window %]
99                                             <li><a class="login-link" href="/cgi-bin/koha/opac-user.pl">Log in to your account</a></li>
100                                         [% ELSIF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %]
101                                             <li><a class="login-link" href="/cgi-bin/koha/svc/auth/googleopenidconnect" role="button" data-toggle="modal">Log in to your account</a></li>
102                                         [% ELSE %]
103                                             <li><a href="/cgi-bin/koha/opac-user.pl" class="login-link loginModal-trigger" role="button" data-toggle="modal">Log in to your account</a></li>
104                                         [% END %]
105                                     [% END %]
106                                     [% IF ( loggedinusername ) %]
107                                         <li><p class="members navbar-text">Welcome, <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 %]" >[% INCLUDE 'patron-title.inc' patron = logged_in_user no_html = 1 %]</span></a></p></li>
108                                         <li class="divider-vertical"></li>
109                                     [% END %]
110                                 [% END %]
111                                 [% IF EnableOpacSearchHistory %]
112                                     <li><p class="navbar-text"><a class="login-link" href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a> [<a class="logout clearsh" href="/cgi-bin/koha/opac-search-history.pl?action=delete" title="Delete your search history">x</a>]</p></li>
113                                     <li class="divider-vertical"></li>
114                                 [% END %]
115                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
116                                     [% IF ( loggedinusername ) %]
117                                         <li><p class="navbar-text">
118                                             <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
119                                             Log out</a></p></li>
120                                     [% END %]
121                                 [% END %]
122                             </ul>
123                         </div> <!-- /members -->
124                     [% END # IF opacuserlogin %]
125                 </div> <!-- /container-fluid -->
126             </div> <!-- /navbar-inner -->
127         </div> <!-- /navbar -->
128
129         [% IF ( opacheader ) %]
130             <div class="container-fluid">
131                 <div class="row-fluid">
132                     <div id="opacheader">
133                         [% opacheader | $raw %]
134                     </div>
135                 </div>
136             </div>
137         [% END %]
138     </div> <!-- / header-region -->
139
140     <div class="container-fluid">
141         <div class="row-fluid">
142             <div id="opac-main-search">
143             <div class="span12">
144                 [% IF ( OpacPublic ) %]
145                     [% UNLESS ( advsearch ) %]
146                         [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
147                             <div class="mastheadsearch librarypulldown">
148                         [% ELSE %]
149                             <div class="mastheadsearch">
150                         [% END %]
151                         [% IF Koha.Preference('OpacCustomSearch') == '' %]
152                             <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
153                                 <label for="masthead_search"> Search
154                                     [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
155                                         [% IF ( mylibraryfirst ) %]
156                                             (in [% Branches.GetName( mylibraryfirst ) | html %] only)
157                                         [% END %]
158                                     [% END %]
159                                 </label>
160
161                                 <select name="idx" id="masthead_search">
162                                 [% IF ( ms_kw ) %]
163                                     <option selected="selected" value="">Library catalog</option>
164                                 [% ELSE %]
165                                     <option value="">Library catalog</option>
166                                 [% END # /ms_kw %]
167                                 [% IF ( ms_ti ) %]
168                                     <option selected="selected" value="ti">Title</option>
169                                 [% ELSE %]
170                                     <option value="ti">Title</option>
171                                 [% END # /ms_ti %]
172                                 [% IF ( ms_au ) %]
173                                     <option selected="selected" value="au">Author</option>
174                                 [% ELSE %]
175                                     <option value="au">Author</option>
176                                 [% END # /ms_au%]
177                                 [% IF ( ms_su ) %]
178                                     <option selected="selected" value="su">Subject</option>
179                                 [% ELSE %]
180                                     <option value="su">Subject</option>
181                                 [% END # /ms_su %]
182                                 [% IF ( ms_nb ) %]
183                                     <option selected="selected" value="nb">ISBN</option>
184                                 [% ELSE %]
185                                     <option value="nb">ISBN</option>
186                                 [% END # /ms_nb%]
187                                 [% IF ( ms_se ) %]
188                                     <option selected="selected" value="se">Series</option>
189                                 [% ELSE %]
190                                     <option value="se">Series</option>
191                                 [% END # /ms_se %]
192                                 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
193                                     [% IF ( ms_callnum ) %]
194                                             <option selected="selected" value="callnum,phr">Call number</option>
195                                     [% ELSE %]
196                                         <option value="callnum,phr">Call number</option>
197                                     [% END #/ms_callnum %]
198                                 [% ELSE %]
199                                     [% IF ( ms_callnum ) %]
200                                         <option selected="selected" value="callnum">Call number</option>
201                                     [% ELSE %]
202                                         <option value="callnum">Call number</option>
203                                     [% END # /ms_callnum %]
204                                 [% END # /IF OPACNumbersPreferPhrase %]
205                                 </select>
206
207                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
208                                     <div class="input-append nolibrarypulldown">
209                                 [% END %]
210                                 [% IF ( ms_value ) %]
211                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" value="[% ms_value | html %]" /><span id="translControl"></span>
212                                 [% ELSE %]
213                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" /><span id="translControl"></span>
214                                 [% END # /ms_value %]
215
216                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
217                                     <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
218                                     </div>
219                                 [% END %]
220
221                                 [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
222                                     <div class="input-append">
223                                         <select name="branch_group_limit" id="select_library">
224                                             <option value="">All libraries</option>
225
226                                             [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]
227
228                                             [% FOREACH library IN Branches.all( selected => opac_name ) %]
229                                                 [% IF library.selected %]
230                                                     <option selected="selected" value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
231                                                 [% ELSE %]
232                                                     <option value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
233                                                 [% END %]
234                                             [% END %]
235
236                                             [% IF LibrarySearchGroups %]
237                                                 </optgroup>
238                                                 <optgroup label="Groups">
239                                                     [% FOREACH lsg IN LibrarySearchGroups %]
240                                                         [% IF lsg.id == opac_name %]
241                                                             <option selected="selected" value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
242                                                         [% ELSE %]
243                                                             <option value="multibranchlimit-[% lsg.id | html %]">[% lsg.title | html %]</option>
244                                                         [% END # / bc.selected %]
245                                                     [% END %]
246                                                 </optgroup>
247                                             [% END # / BranchCategoriesLoop %]
248                                         </select>
249                                         <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
250                                     </div>
251                                 [% ELSE %]
252                                     [% IF ( opac_limit_override ) %]
253                                         [% IF ( opac_search_limit ) %]
254                                             <input name="limit" value="[% opac_search_limit | html %]" type="hidden" />
255                                         [% END %]
256                                     [% ELSE %]
257                                         [% IF ( mylibraryfirst ) %]
258                                             <input name="limit" value="branch:[% mylibraryfirst | html %]" type="hidden" />
259                                         [% END %]
260                                     [% END # / opac_limit_override %]
261                                 [% END # / OpacAddMastheadLibraryPulldown %]
262
263                             </form>
264                         [% ELSE # / Koha.Preference('OpacCustomSearch') == '' %]
265                             [% Koha.Preference('OpacCustomSearch') | $raw %]
266                         [% END # / Koha.Preference('OpacCustomSearch') == '' %]
267                         </div> <!-- / .mastheadsearch -->
268                     [% END # / UNLESS advsearch %]
269
270                     <div class="row-fluid">
271                             <div id="moresearches">
272                                 <ul>
273                                     <li><a href="/cgi-bin/koha/opac-search.pl">Advanced search</a></li>
274                                     [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]<li><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a></li>[% END %]
275                                     [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a></li>[% END %]
276                                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]<li><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a></li>[% END %]
277                                     [% 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 %]
278                                     [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %]
279                                     [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %]
280                                     [% IF Koha.Preference( 'OpacTopissue' ) == 1 %]<li><a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a></li>[% END %]
281                                     [% IF Koha.Preference( 'suggestion' ) == 1 %]
282                                         [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
283                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
284                                         [% ELSIF ( ( Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 ) ) %]
285                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
286                                         [% END %]
287                                     [% END %]
288                                 </ul>
289                             </div> <!-- /#moresearches -->
290                     </div> <!-- /.row-fluid -->
291
292                 [% END # / OpacPublic %]
293             </div> <!-- /.span10 -->
294             </div> <!-- /.opac-main-search -->
295         </div> <!-- / .row-fluid -->
296     </div> <!-- /.container-fluid -->
297
298     <!-- Login form hidden by default, used for modal window -->
299     <div id="loginModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="modalLoginLabel" aria-hidden="true">
300         <div class="modal-header">
301             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
302             <h3 id="modalLoginLabel">Log in to your account</h3>
303         </div>
304         <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="modalAuth">
305             <input type="hidden" name="has-search-query" id="has-search-query" value="" />
306             <div class="modal-body">
307                 [% IF ( shibbolethAuthentication ) %]
308                     [% IF ( invalidShibLogin ) %]
309                         <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
310                         <div class="alert alert-info">
311                             <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p>
312                         </div>
313                     [% ELSE %]
314                         <h4>Shibboleth login</h4>
315                         <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl | html %]">click here to login</a>.</p>
316                         <h4>Local Login</h4>
317                     [% END %]
318                 [% END %]
319                 <input type="hidden" name="koha_login_context" value="opac" />
320                 <fieldset class="brief">
321                     <label for="muserid">Login:</label><input type="text" id="muserid" name="userid" />
322                     <label for="mpassword">Password:</label><input type="password" id="mpassword" name="password" />
323                     [% IF Koha.Preference( 'OpacLoginInstructions' ) %]
324                         <div id="nologininstructions-modal" class="nologininstructions">
325                             [% Koha.Preference( 'OpacLoginInstructions' ) | $raw %]
326                         </div>
327                     [% END %]
328                     [% IF Koha.Preference('OpacPasswordChange') && Koha.Preference('OpacResetPassword') %]
329                         <div id="forgotpassword-modal" class="forgotpassword">
330                             <a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
331                         </div>
332                     [% END %]
333                     [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
334                         <div id="patronregistration-modal" class="patronregistration">
335                             <p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p>
336                         </div>
337                     [% END %]
338                 </fieldset>
339             </div>
340             <div class="modal-footer">
341                 <input type="submit" class="btn btn-primary" value="Log in" />
342             </div>
343         </form> <!-- /#auth -->
344     </div>  <!-- /#modalAuth  -->