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