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