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