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