Bug 32910: (follow-up) Replace v4 icon names with v6
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-main.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% USE Categories %]
6 [% USE Price %]
7 [% USE AdditionalContents %]
8 [% USE AuthClient %]
9 [% PROCESS 'i18n.inc' %]
10 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
11 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
12 [% SET OpacNavRight = AdditionalContents.get( location => "OpacNavRight", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
13 [% SET OpacMainUserBlock = AdditionalContents.get( location => "OpacMainUserBlock", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
14 [% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode || default_branch ) %]
15 [% INCLUDE 'doc-head-open.inc' %]
16 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
17 [% INCLUDE 'doc-head-close.inc' %]
18 [% BLOCK cssinclude %][% END %]
19 </head>
20 [% INCLUDE 'bodytag.inc' bodyid='opac-main' %]
21 [% INCLUDE 'masthead.inc' %]
22
23 <div class="main">
24     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
25         <ol class="breadcrumb">
26             [% IF news_item %]
27                 <li class="breadcrumb-item">
28                     <a href="/cgi-bin/koha/opac-main.pl">Home</a>
29                 </li>
30                 <li class="breadcrumb-item active">
31                     <a href="#" aria-current="page">[% news_item.title | html %]</a>
32                 </li>
33             [% ELSE %]
34                 <li class="breadcrumb-item active">
35                     <a href="#" aria-current="page">Home</a>
36                 </li>
37             [% END %]
38         </ol>
39     </nav> <!-- /#breadcrumbs -->
40
41     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
42         [% IF ( loggedinusername ) %]
43             <div id="loggedin" class="container-fluid">
44         [% ELSE %]
45             <div id="notloggedin" class="container-fluid">
46         [% END %]
47     [% ELSE %]
48         <div id="notloggedin" class="container-fluid">
49     [% END %]
50
51     <div class="row">
52         [% IF ( OpacNav ||  OpacNavBottom ) %]
53             <div class="col-12 col-lg-2 order-3 order-lg-1">
54                 <div id="navigation">
55                     [% INCLUDE 'navigation.inc' %]
56                 </div>
57             </div>
58         [% END %]
59
60         [% IF ( OpacNav ||  OpacNavBottom  ) && (Koha.Preference( 'opacuserlogin' ) == 1 || OpacNavRight) %]
61             [% #  Three-column layout with right and left sidebars %]
62             <div class="col-12 col-lg-7 order-md-1 maincontent">
63         [% ELSIF (Koha.Preference( 'opacuserlogin' ) == 1 || OpacNavRight) %]
64             [% #  Two-column layout with right sidebar %]
65             <div class="col-12 col-lg-9 order-md-1 maincontent">
66         [% ELSIF ( OpacNav ||  OpacNavBottom  ) %]
67             <div class="col-12 col-lg-10 order-md-1 maincontent">
68         [% ELSE %]
69             <div class="col order-md-1 maincontent">
70         [% END %]
71
72         <h1 class="sr-only">Koha home</h1>
73
74         [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
75             [% UNLESS news_item %]
76                 <form id="news-branch-select" class="form-inline" name="news-branch-select" method="get" action="/cgi-bin/koha/opac-main.pl">
77                     <legend class="sr-only">News</legend>
78                     <label for="news-branch">Display news for: </label>
79                     <select id="news-branch" name="branch">
80                         [% IF ( branchcode == "" ) %]
81                             <option value="" selected="selected">System-wide only</option>
82                         [% ELSE %]
83                             <option value="">System-wide only</option>
84                         [% END %]
85                         [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
86                     </select>
87                 </form>
88             [% END %]
89         [% END %]
90
91         [% IF koha_news.count %]
92
93             [% IF single_news_error %]
94
95                 <div class="alert alert-error">
96                     This news item does not exist.
97                 </div>
98
99             [% ELSE %]
100
101                 <div id="news" class="newscontainer">
102                     [% SET show_author = Koha.Preference('NewsAuthorDisplay') == 'opac' || Koha.Preference('NewsAuthorDisplay') == 'both' %]
103                     [% FOREACH koha_new IN koha_news %]
104                     [% IF koha_new.category == 'news' %]
105                         <div class="newsitem">
106                             <h4 class="newsheader">
107                                 [% IF ( news_item ) %]
108                                     [% koha_new.title | html %]
109                                 [% ELSE %]
110                                     <a name="newsitem[% koha_new.idnew | html %]" href="/cgi-bin/koha/opac-main.pl?news_id=[% koha_new.idnew | uri %]">[% koha_new.title | html %]</a>
111                                 [% END %]
112                             </h4>
113                             <div class="newsbody">[% koha_new.content | $raw %]</div>
114                             <div class="newsfooter">
115                                 Published on [% koha_new.published_on | $KohaDates %]
116                                 [% IF ( show_author && koha_new.author ) %]
117                                     by <span class="newsauthor">[% INCLUDE 'patron-title.inc' patron=koha_new.author %]</span>
118                                 [% END %]
119                                 [% IF ( news_item ) %]
120                                     &bull; <a href="/cgi-bin/koha/opac-main.pl">Show all news</a>
121                                 [% END %]
122                             </div>
123                         </div>
124                     [% END %]
125                     [% END %]
126
127                     [% UNLESS news_item %]
128                         <div id="rssnews-container">
129                             <!-- Logged in users have a branch code or it could be explicitly set -->
130                             <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode | uri %]">
131                                 <i class="fa fa-rss" aria-hidden="true"></i>
132                                 [% IF Branches.all.size == 1 %]
133                                     [% IF branchcode %]
134                                         <span>RSS feed for [% Branches.GetName( branchcode ) | html %] library news</span>
135                                     [% ELSE %]
136                                         <span>RSS feed for library news</span>
137                                     [% END %]
138                                 [% ELSE %]
139                                     [% IF branchcode %]
140                                         <span>RSS feed for [% Branches.GetName( branchcode ) | html %] and system-wide library news</span>
141                                     [% ELSE %]
142                                         <span>RSS feed for system-wide library news</span>
143                                     [% END %]
144                                 [% END %]
145                             </a>
146                         </div>
147                     [% END %]
148                 </div>
149
150             [% END # /IF single_news_error %]
151
152         [% ELSE %] <!-- koha news -->
153             [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
154                 <div id="news" class="newscontainer">
155                     <div class="newsitem">
156                         <div class="newsbody">No news to display.</div>
157                         <div class="newsfooter"></div>
158                     </div>
159                 </div>
160             [% END %]
161
162         [% END # IF koha_news %]
163
164         [% UNLESS news_item # Don't show under single news item %]
165             [% IF ( daily_quote ) %]
166                 <div id="daily-quote">
167                     <h2>Quote of the day</h2>
168                     <div>
169                         <span id="daily-quote-text">[% daily_quote.text | html %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source | html %]</span>
170                     </div>
171                 </div>
172             [% END %]
173
174             [% IF ( OpacMainUserBlock ) %]
175                 [% PROCESS koha_news_block news => OpacMainUserBlock %]
176             [% END %]
177         [% END %]
178
179         </div> <!-- / .col 6/8 -->
180
181         [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) || OpacNavRight ) %]
182             <div class="col-12 col-lg-3 order-md-2">
183                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
184                     [% UNLESS ( loggedinusername ) %]
185                         [% UNLESS ( casAuthentication || shibbolethAuthentication || Koha.Preference('opacShibOnly') ) %]
186                             <div id="login">
187                                 <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth" autocomplete="off">
188                                     <input type="hidden" name="koha_login_context" value="opac" />
189                                     <fieldset class="brief">
190                                         <legend>Log in to your account:</legend>
191                                         [% IF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %]
192                                             <a href="/cgi-bin/koha/svc/auth/googleopenidconnect" class="btn btn-light" id="openid_connect"><i class="fa-brands fa-google" aria-hidden="true"></i> Log in with Google</a>
193                                             <p>If you do not have a Google account, but do have a local account, you can still log in: </p>
194                                         [% END # /IF GoogleOpenIDConnect %]
195                                         [% SET identity_providers = AuthClient.get_providers('opac') %]
196                                         [% IF ( ! identity_providers.empty ) %]
197                                             [% FOREACH provider IN identity_providers %]
198                                                 <p class="clearfix">
199                                                     <a href="[% provider.url | url %]" class="btn btn-light col-md-12" id="provider_[% provider.code | html %]">
200                                                         [% IF provider.icon_url %]
201                                                         <img src="[% provider.icon_url | url %]"  style="max-height: 20px; max-width: 20px;"/>
202                                                         [% ELSE %]
203                                                         <i class="fa fa-user" aria-hidden="true"></i>
204                                                         [% END %]
205                                                         Log in with [% provider.description | html %]
206                                                     </a>
207                                                 </p>
208                                             [% END %]
209                                             <hr/>
210                                             <p>If you do not have an external account, but do have a local account, you can still log in: </p>
211                                         [% END # /IF  identity_providers.size %]
212                                         <div class="local-login">
213                                             <label for="userid">Login:</label>
214                                             <input class="form-control" type="text" id="userid" name="userid" autocomplete="off" />
215                                             <label for="password">Password:</label>
216                                             <input class="form-control" type="password" id="password" name="password" autocomplete="off" />
217                                             <fieldset class="action">
218                                                 <input type="submit" value="Log in" class="btn btn-primary" />
219                                             </fieldset>
220                                         </div>
221                                         [% IF ( OpacLoginInstructions ) %]
222                                             <div id="nologininstructions-main" class="nologininstructions">
223                                                 [% PROCESS koha_news_block news => OpacLoginInstructions %]
224                                             </div>
225                                         [% END %]
226                                         [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
227                                             <div id="forgotpassword-main" class="forgotpassword">
228                                                 <p><a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a></p>
229                                             </div>
230                                         [% END %]
231                                         [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
232                                             <div id="patronregistration-main" class="patronregistration">
233                                                 <p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p>
234                                             </div>
235                                         [% END %]
236                                     </fieldset>
237                                 </form>
238                             </div> <!-- /#login -->
239                         [% END # /casAuthentication %]
240                     [% ELSE %]
241                         [% IF Koha.Preference('OPACUserSummary') && dashboard_info %]
242                             <div id="user_summary">
243                                 <h2>User summary</h2>
244                                 <p>Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</span></a></p>
245                                 <ul id="user_summary_shortcuts">
246                                     [% IF checkouts && checkouts > 0 %]
247                                         <li>
248                                             <a href="/cgi-bin/koha/opac-user.pl#opac-user-checkouts">
249                                                 <span class="user_checkouts_count count_label">[% checkouts | html %]</span>
250                                                 [% tn('checkout', 'checkouts', checkouts ) | html %]
251                                             </a>
252                                         </li>
253                                     [% END %]
254                                     [% IF overdues && overdues > 0 %]
255                                         <li>
256                                             <a href="/cgi-bin/koha/opac-user.pl#opac-user-overdues">
257                                                 <span class="user_overdues_count count_label">[% overdues | html %]</span>
258                                                 [% tn('overdue', 'overdues', overdues ) | html %]
259                                             </a>
260                                         </li>
261                                     [% END %]
262                                     [% IF holds_pending && holds_pending > 0 %]
263                                         <li>
264                                             <a href="/cgi-bin/koha/opac-user.pl#opac-user-holds">
265                                                 <span class="user_holds_pending_count count_label">[% holds_pending | html %]</span>
266                                                 [% tn('hold pending', 'holds pending', holds_pending ) | html %]
267                                             </a>
268                                         </li>
269                                     [% END %]
270                                     [% IF holds_waiting && holds_waiting > 0 %]
271                                         <li>
272                                             <a href="/cgi-bin/koha/opac-user.pl#opac-user-holds">
273                                                 <span class="user_holds_waiting_count count_label">[% holds_waiting | html %]</span>
274                                                 [% tn('hold waiting', 'holds waiting', holds_waiting ) | html %]
275                                             </a>
276                                         </li>
277                                     [% END %]
278                                     [% IF total_owing && total_owing > 0 %]
279                                         <li>
280                                             <a href="/cgi-bin/koha/opac-account.pl">
281                                                 <span class="user_fines_count count_label">[% total_owing | $Price with_symbol => 1 %]</span>
282                                                 due in fines and charges
283                                             </a>
284                                         </li>
285                                     [% END %]
286                                     [% IF patron_messages && patron_messages.filter_by_unread.count > 0 || opacnote %]
287                                         [% IF opacnote %]
288                                             <li>
289                                                 <a href="/cgi-bin/koha/opac-user.pl">
290                                                     <span class="count_label">[% patron_messages.filter_by_unread.count + 1 | html %]</span>
291                                                     [% tn('message', 'messages', patron_messages.filter_by_unread.count + 1 ) | html %]
292                                                 </a>
293                                             </li>
294                                         [% ELSE %]
295                                             <li>
296                                                 <a href="/cgi-bin/koha/opac-user.pl">
297                                                     <span class="count_label">[% patron_messages.filter_by_unread.count | html %]</span>
298                                                     [% tn('message', 'messages', patron_messages.filter_by_unread.count ) | html %]
299                                                 </a>
300                                             </li>
301                                         [% END %]
302                                     [% END %]
303                                     [% IF savings %]
304                                         <li>
305                                             <a href="/cgi-bin/koha/opac-user.pl">
306                                                 <span class="count_label">[% savings | $Price with_symbol => 1 %]</span>
307                                                 total savings
308                                             </a>
309                                         </li>
310                                     [% END %]
311                                 </ul>
312                             </div>
313                         [% END %]
314                     [% END # /loggedinusername %]
315                 [% END # /opacuserlogin %]
316                 [% PROCESS koha_news_block news => OpacNavRight %]
317             </div> <!-- / .col -->
318         [% END # /opacuserlogin || OpacNavRight %]
319
320         </div> <!-- /.container-fluid -->
321     </div> <!-- /.row -->
322 </div> <!-- /.main -->
323
324 [% INCLUDE 'opac-bottom.inc' %]
325 [% BLOCK jsinclude %][% END %]