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