Bug 27740: (follow-up) Added User summary heading
[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 KohaNews %]
8 [% PROCESS 'i18n.inc' %]
9 [% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => lang, library => branchcode ) %]
10 [% SET OpacMainUserBlock = KohaNews.get( location => "OpacMainUserBlock", lang => lang, library => branchcode ) %]
11 [% SET OpacLoginInstructions = KohaNews.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                     <label for="news-branch">Display news for: </label>
75                     <select id="news-branch" name="branch">
76                         [% IF ( branchcode == "" ) %]
77                             <option value="" selected="selected">System-wide only</option>
78                         [% ELSE %]
79                             <option value="">System-wide only</option>
80                         [% END %]
81                         [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
82                     </select>
83                 </form>
84             [% END %]
85         [% END %]
86
87         [% IF ( koha_news ) %]
88
89             [% IF single_news_error %]
90
91                 <div class="alert alert-error">
92                     This news item does not exist.
93                 </div>
94
95             [% ELSE %]
96
97                 <div id="news" class="newscontainer">
98                     [% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %]
99                     [% FOREACH koha_new IN koha_news %]
100                         <div class="newsitem">
101                             <h4 class="newsheader">
102                                 [% IF ( news_item ) %]
103                                     [% koha_new.title | html %]
104                                 [% ELSE %]
105                                     <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>
106                                 [% END %]
107                             </h4>
108                             <div class="newsbody">[% koha_new.content | $raw %]</div>
109                             <div class="newsfooter">
110                                 Published on [% koha_new.published_on | $KohaDates %]
111                                 [% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %]
112                                     [% IF news_item %]
113                                         [% SET author = koha_new.author %]
114                                         by <span class="newsauthor_title">[% author.title | html %] </span>[% author.firstname | html %] [% author.surname | html %]
115                                     [% ELSE %]
116                                         by <span class="newsauthor_title">[% koha_new.author_title | html %] </span>[% koha_new.author_firstname | html %] [% koha_new.author_surname | html %]
117                                     [% END %]
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
125                     [% END %]
126                     [% UNLESS news_item %]
127                         <div id="rssnews-container">
128                             <!-- Logged in users have a branch code or it could be explicitly set -->
129                             <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode | uri %]">
130                                 <i class="fa fa-rss" aria-hidden="true"></i>
131                                 [% IF Branches.all.size == 1 %]
132                                     [% IF branchcode %]
133                                         RSS feed for [% Branches.GetName( branchcode ) | html %] library news
134                                     [% ELSE %]
135                                         RSS feed for library news
136                                     [% END %]
137                                 [% ELSE %]
138                                     [% IF branchcode %]
139                                         RSS feed for [% Branches.GetName( branchcode ) | html %] and system-wide library news
140                                     [% ELSE %]
141                                         RSS feed for system-wide library news
142                                     [% END %]
143                                 [% END %]
144                             </a>
145                         </div>
146                     [% END %]
147                 </div>
148
149             [% END # /IF single_news_error %]
150
151         [% ELSE %] <!-- koha news -->
152             [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
153                 <div id="news" class="newscontainer">
154                     <div class="newsitem">
155                         <div class="newsbody">No news to display.</div>
156                         <div class="newsfooter"></div>
157                     </div>
158                 </div>
159             [% END %]
160
161         [% END # IF koha_news %]
162
163         [% UNLESS news_item # Don't show under single news item %]
164             [% IF ( daily_quote ) %]
165                 <div id="daily-quote">
166                     <h2>Quote of the day</h2>
167                     <div>
168                         <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>
169                     </div>
170                 </div>
171             [% END %]
172
173             [% IF ( OpacMainUserBlock ) %]
174                 <div id="opacmainuserblock">
175                     [% PROCESS koha_news_block news => OpacMainUserBlock %]
176                 </div>
177             [% END %]
178         [% END %]
179
180         </div> <!-- / .col 6/8 -->
181
182         [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) || OpacNavRight ) %]
183             <div class="col-12 col-lg-3 order-md-2">
184                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
185                     [% UNLESS ( loggedinusername ) %]
186                         [% UNLESS ( casAuthentication || shibbolethAuthentication || Koha.Preference('opacShibOnly') ) %]
187                             <div id="login">
188                                 <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth" autocomplete="off">
189                                     <input type="hidden" name="koha_login_context" value="opac" />
190                                     <fieldset class="brief">
191                                         <legend>Log in to your account:</legend>
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 %]