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