Bug 14544: QA fixes - some minor bug fixes
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / masthead.inc
1 [% USE Koha %]
2 [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
3 <div id="wrap">
4     <div id="header-region" class="noprint">
5         <div class="navbar navbar-inverse navbar-static-top">
6             <div class="navbar-inner">
7                 <div class="container-fluid">
8                     <h1 id="logo">
9                         <a class="brand" href="/cgi-bin/koha/opac-main.pl">
10                             [% IF ( LibraryNameTitle ) %]
11                                 [% LibraryNameTitle %]
12                             [% ELSE %]
13                                 Koha online
14                             [% END %]
15                         </a>
16                     </h1>
17                     [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
18                         <div id="cartDetails" class="cart-message">Your cart is empty.</div>
19                     [% END %]
20                     <ul class="nav">
21                         [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
22                             <li class="dropdown">
23                                 <a href="#" title="Collect items you are interested in" class="dropdown-toggle" id="cartmenulink" data-toggle="dropdown" role="button">
24                                     <i id="carticon" class="icon-shopping-cart icon-white"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span> <b class="caret"></b>
25                                 </a>
26                                 <ul aria-labelledby="cartmenulink" role="menu" class="dropdown-menu">
27                                     <li role="presentation">
28                                         <a href="#" id="cartmenuitem" class="cart-message" tabindex="-1" role="menuitem">Your cart is empty.</a>
29                                     </li>
30                                 </ul>
31                             </li>
32                         [% END %]
33                         [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) && ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
34                             <li class="divider-vertical"></li>
35                         [% END %]
36                         [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) %]
37                             <li class="dropdown">
38                                 <a href="#" title="Show lists" class="dropdown-toggle" id="listsmenu" data-toggle="dropdown" role="button"><i class="icon-list icon-white"></i> <span class="listslabel">Lists</span> <b class="caret"></b></a>
39                                 <ul aria-labelledby="listsmenu" role="menu" class="dropdown-menu">
40                                 [% IF some_public_shelves.count %]
41                                     <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>
42                                     [% SET number_of_public_shelves = 0 %]
43                                     [% FOREACH s IN some_public_shelves %]
44                                         <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]&amp;sortfield=[% s.sortfield %]" tabindex="-1" role="menuitem">[% s.shelfname |html %]</a></li>
45                                         [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
46                                         [% IF number_of_public_shelves >= 10 %][% LAST %][% END %]
47                                     [% END %]
48                                     [% IF some_public_shelves > 10 %]
49                                         <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>
50                                     [% END %]
51                                 [% ELSE %]
52                                     <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No public lists</a></li>
53                                 [% END %]
54                                 <li class="divider" role="presentation"></li>
55                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
56                                     <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>
57                                     [% IF loggedinusername %]
58                                         [% IF some_private_shelves.count %]
59                                             [% SET number_of_private_shelves = 0 %]
60                                             [% FOREACH s IN some_private_shelves %]
61                                                 <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]&amp;sortfield=[% s.sortfield %]" tabindex="-1" role="menuitem">[% s.shelfname |html %]</a></li>
62                                                 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
63                                                 [% IF number_of_private_shelves >= 10 %][% LAST %][% END %]
64                                             [% END %]
65                                             [% IF some_private_shelves > 10 %]
66                                                 <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>
67                                             [% END %]
68                                         [% ELSE %]
69                                             <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No private lists</a></li>
70                                             <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" tabindex="-1" role="menuitem" class="listmenulink">New list</a></li>
71                                         [% END %]
72                                     [% ELSE %]
73                                         <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>
74                                     [% END # / IF loggedinusername %]
75                                 [% END # / IF opacuserlogin %]
76                                 </ul> <!-- / .dropdown-menu -->
77                             </li> <!-- / .dropdown -->
78                         [% END # / IF virtualshelves %]
79                     </ul> <!-- / .nav -->
80                     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]<div id="listsDetails"></div>[% END %]
81                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 || opaclanguagesdisplay || EnableOpacSearchHistory %]
82                         <a id="user-menu-trigger" class="pull-right" href="#"><i class="icon-user"></i> <span class="caret"></span></a>
83                         <div id="members">
84                             <ul class="nav pull-right">
85
86                                 [% INCLUDE 'masthead-langmenu.inc' %]
87
88                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
89                                     [% UNLESS ( loggedinusername ) %]
90                                         [% IF Koha.Preference('casAuthentication') %]
91                                             [%# CAS authentication is too complicated for modal window %]
92                                             <li><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a></li>
93                                         [% ELSE %]
94                                             <li><a href="/cgi-bin/koha/opac-user.pl" class="loginModal-trigger" role="button" data-toggle="modal">Log in to your account</a></li>
95                                         [% END %]
96                                     [% END %]
97                                     [% IF ( loggedinusername ) %]
98                                         <li><p class="members navbar-text">Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% FOREACH USER_INF IN USER_INFO %][% USER_INF.title %] [% USER_INF.firstname %] [% USER_INF.surname %][% END %]</span></a></p></li>
99                                         <li class="divider-vertical"></li>
100                                     [% END %]
101                                 [% END %]
102                                 [% IF EnableOpacSearchHistory %]
103                                     <li><p class="navbar-text"><a href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a> [<a class="logout" href="/cgi-bin/koha/opac-search-history.pl?action=delete" title="Delete your search history" onclick="return confirm(MSG_DELETE_SEARCH_HISTORY);">x</a>]</p></li>
104                                     <li class="divider-vertical"></li>
105                                 [% END %]
106                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
107                                     [% IF ( loggedinusername ) %]
108                                         <li><p class="navbar-text">
109                                             [% IF persona %]
110                                                 <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1" onclick='navigator.id.logout();'>
111                                             [% ELSE %]
112                                                 <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
113                                             [% END %]
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 %]
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="span2">
139         [% IF ( opacsmallimage ) %]
140             <h1 id="libraryname" style="background-image: url('[% opacsmallimage %]');">
141         [% ELSE %]
142             <h1 id="libraryname">
143         [% END %]
144             <a href="/cgi-bin/koha/opac-main.pl">[% IF ( LibraryName ) %][% LibraryName %][% ELSE %]Koha Online Catalog[% END %]</a></h1>
145     </div> /.span2 -->
146             <div class="span12">
147                 [% IF ( OpacPublic ) %]
148                     [% UNLESS ( advsearch ) %]
149                         [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
150                             <div class="mastheadsearch librarypulldown">
151                         [% ELSE %]
152                             <div class="mastheadsearch">
153                         [% END %]
154                         [% IF Koha.Preference('OpacCustomSearch') == '' %]
155                             <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
156                                 <label for="masthead_search"> Search
157                                     [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
158                                         [% IF ( mylibraryfirst ) %]
159                                             (in [% mylibraryfirst %] only)
160                                         [% END %]
161                                     [% END %]
162                                 </label>
163
164                                 <select name="idx" id="masthead_search">
165                                 [% IF ( ms_kw ) %]
166                                     <option selected="selected" value="">Library catalog</option>
167                                 [% ELSE %]
168                                     <option value="">Library catalog</option>
169                                 [% END # /ms_kw %]
170                                 [% IF ( ms_ti ) %]
171                                     <option selected="selected" value="ti">Title</option>
172                                 [% ELSE %]
173                                     <option value="ti">Title</option>
174                                 [% END # /ms_ti %]
175                                 [% IF ( ms_au ) %]
176                                     <option selected="selected" value="au">Author</option>
177                                 [% ELSE %]
178                                     <option value="au">Author</option>
179                                 [% END # /ms_au%]
180                                 [% IF ( ms_su ) %]
181                                     <option selected="selected" value="su">Subject</option>
182                                 [% ELSE %]
183                                     <option value="su">Subject</option>
184                                 [% END # /ms_su %]
185                                 [% IF ( ms_nb ) %]
186                                     <option selected="selected" value="nb">ISBN</option>
187                                 [% ELSE %]
188                                     <option value="nb">ISBN</option>
189                                 [% END # /ms_nb%]
190                                 [% IF ( ms_se ) %]
191                                     <option selected="selected" value="se">Series</option>
192                                 [% ELSE %]
193                                     <option value="se">Series</option>
194                                 [% END # /ms_se %]
195                                 [% IF ( numbersphr ) %]
196                                     [% IF ( ms_callnum ) %]
197                                             <option selected="selected" value="callnum,phr">Call number</option>
198                                     [% ELSE %]
199                                         <option value="callnum,phr">Call number</option>
200                                     [% END #/ms_callnum %]
201                                 [% ELSE %]
202                                     [% IF ( ms_callnum ) %]
203                                         <option selected="selected" value="callnum">Call number</option>
204                                     [% ELSE %]
205                                         <option value="callnum">Call number</option>
206                                     [% END # /ms_callnum %]
207                                 [% END # /numbersphr %]
208                                 </select>
209
210                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
211                                     <div class="input-append nolibrarypulldown">
212                                 [% END %]
213                                 [% IF ( ms_value ) %]
214                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" value="[% ms_value |html %]" /><span id="translControl"></span>
215                                 [% ELSE %]
216                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" /><span id="translControl"></span>
217                                 [% END # /ms_value %]
218
219                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
220                                     <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
221                                     </div>
222                                 [% END %]
223
224                                 [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
225                                     <div class="input-append">
226                                         <select name="branch_group_limit" id="select_library">
227                                             <option value="">All libraries</option>
228                                             [% IF BranchCategoriesLoop %]<optgroup label="Libraries">[% END %]
229                                                 [% FOREACH BranchesLoo IN BranchesLoop %]
230                                                     [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
231                                                     [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
232                                                 [% END %]
233                                             [% IF BranchCategoriesLoop %]
234                                                 </optgroup>
235                                                 <optgroup label="Groups">
236                                                     [% FOREACH bc IN BranchCategoriesLoop %]
237                                                         [% IF ( bc.selected ) %]
238                                                             <option selected="selected" value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
239                                                         [% ELSE %]
240                                                             <option value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option>
241                                                         [% END # / bc.selected %]
242                                                     [% END %]
243                                                 </optgroup>
244                                             [% END # / BranchCategoriesLoop %]
245                                         </select>
246                                         <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
247                                     </div>
248                                 [% ELSE %]
249                                     [% IF ( opac_limit_override ) %]
250                                         [% IF ( opac_search_limit ) %]
251                                             <input name="limit" value="[% opac_search_limit %]" type="hidden" />
252                                         [% END %]
253                                     [% ELSE %]
254                                         [% IF ( mylibraryfirst ) %]
255                                             <input name="limit" value="branch:[% mylibraryfirst %]" type="hidden" />
256                                         [% END %]
257                                     [% END # / opac_limit_override %]
258                                 [% END # / OpacAddMastheadLibraryPulldown %]
259
260                             </form>
261                         [% ELSE # / Koha.Preference('OpacCustomSearch') == '' %]
262                             [% Koha.Preference('OpacCustomSearch') %]
263                         [% END # / Koha.Preference('OpacCustomSearch') == '' %]
264                         </div> <!-- / .mastheadsearch -->
265                     [% END # / UNLESS advsearch %]
266
267                     <div class="row-fluid">
268                             <div id="moresearches">
269                                 <ul>
270                                     <li><a href="/cgi-bin/koha/opac-search.pl">Advanced search</a></li>
271                                     [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]<li><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a></li>[% END %]
272                                     [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a></li>[% END %]
273                                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]<li><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a></li>[% END %]
274                                     [% 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 %]
275                                     [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %]
276                                     [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %]
277                                     [% IF Koha.Preference( 'OpacTopissue' ) == 1 %]<li><a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a></li>[% END %]
278                                     [% IF Koha.Preference( 'suggestion' ) == 1 %]
279                                         [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
280                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
281                                         [% ELSIF ( ( Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 ) ) %]
282                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
283                                         [% END %]
284                                     [% END %]
285                                 </ul>
286                             </div> <!-- /#moresearches -->
287                     </div> <!-- /.row-fluid -->
288
289                 [% END # / OpacPublic %]
290             </div> <!-- /.span10 -->
291             </div> <!-- /.opac-main-search -->
292         </div> <!-- / .row-fluid -->
293     </div> <!-- /.container-fluid -->
294
295     <!-- Login form hidden by default, used for modal window -->
296     <div id="loginModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="modalLoginLabel" aria-hidden="true">
297         <div class="modal-header">
298             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
299             <h3 id="modalLoginLabel">Log in to your account</h3>
300         </div>
301         <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="modalAuth">
302             <div class="modal-body">
303                     [% IF ( shibbolethAuthentication ) %]
304                     [% IF ( invalidShibLogin ) %]
305                     <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
306                     <div class="alert alert-info">
307                         <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p>
308                     </div>
309                     [% ELSE %]
310                     <h4>Shibboleth Login</h4>
311                     <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl %]">click here to login</a>.</p>
312                     <h4>Local Login</h4>
313                     [% END %]
314             [% END %]
315                     <input type="hidden" name="koha_login_context" value="opac" />
316                     <fieldset class="brief">
317                         <label for="muserid">Login:</label><input type="text" id="muserid" name="userid" />
318                         <label for="mpassword">Password:</label><input type="password" id="mpassword" name="password" />
319                     [% IF Koha.Preference( 'NoLoginInstructions' ) %]
320                         <div id="nologininstructions-modal">
321                             [% Koha.Preference( 'NoLoginInstructions' ) %]
322                         </div>
323                     [% END %]
324                         [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<div id="mpatronregistration"><p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p></div>[% END %]
325                     </fieldset>
326             </div>
327             <div class="modal-footer">
328                 <input type="submit" class="btn btn-primary" value="Log in" />
329                 <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
330             </div>
331         </form> <!-- /#auth -->
332     </div>  <!-- /#modalAuth  -->