Bug 2093: Add OPAC Summary for logged-in users
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-main.tt
1 [% USE Koha %]
2 [% USE Branches %]
3 [% USE Price %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %][% END %]
8 </head>
9 [% INCLUDE 'bodytag.inc' bodyid='opac-main' %]
10 [% INCLUDE 'masthead.inc' %]
11
12 <div class="main">
13     <ul class="breadcrumb">
14         <li><a href="#">Home</a></li>
15     </ul>
16
17     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
18         [% IF ( loggedinusername ) %]
19             <div id="loggedin" class="container-fluid">
20         [% ELSE %]
21             <div id="notloggedin" class="container-fluid">
22         [% END %]
23     [% ELSE %]
24         <div id="notloggedin" class="container-fluid">
25     [% END %]
26
27     <div class="row-fluid">
28     [% IF ( OpacNav ||  OpacNavBottom ) %]
29         <div class="span2">
30             <div id="navigation">
31                 [% INCLUDE 'navigation.inc' %]
32             </div>
33         </div>
34     [% END %]
35
36     [% IF ( OpacNav ||  OpacNavBottom  ) %]
37         <div class="span7">
38     [% ELSE %]
39         <div class="span9">
40     [% END %]
41             [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
42                 <form id="news-branch-select" class="form-inline" name="news-branch-select" method="get" action="/cgi-bin/koha/opac-main.pl">
43                 <label for="news-branch">Display news for: </label>
44                 <select id="news-branch" name="branch">
45                 [% IF ( branchcode == "" ) %]
46                 <option value="" selected="selected">system-wide only</option>
47                 [% ELSE %]
48                 <option value=""         >system-wide only</option>
49                 [% END %]
50                 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
51                 </select>
52                 </form>
53             [% END %]
54
55         [% IF ( koha_news_count ) %]
56
57             <div id="news" class="newscontainer">
58                 [% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %]
59                 [% FOREACH koha_new IN koha_news %]
60                     <div class="newsitem">
61                         <a name="newsitem[% koha_new.idnew %]"></a><h4 class="newsheader">[% koha_new.title %]</h4>
62                         <div class="newsbody">[% koha_new.content %]</div>
63                         <div class="newsfooter">(published on [% koha_new.newdate %][% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %] by <span class="newsauthor_title">[% koha_new.author_title %] </span>[% koha_new.author_firstname %] [% koha_new.author_surname %][% END %])</div>
64                     </div>
65                 [% END %]
66             </div>
67             <div id="rssnews-container">
68                 <!-- Logged in users have a branch code or it could be explicitly set -->
69                 <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode %]"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png"></a>
70                 [% IF Branches.all.size == 1 %]
71                     [% IF branchcode %]
72                         RSS feed for [% Branches.GetName( branchcode ) %] library news.
73                     [% ELSE %]
74                         RSS feed for library news.
75                     [% END %]
76                 [% ELSE %]
77                     [% IF branchcode %]
78                         RSS feed for [% Branches.GetName( branchcode ) %] and system-wide library news.
79                     [% ELSE %]
80                         RSS feed for system-wide library news.
81                     [% END %]
82                 [% END %]
83             </div>
84             [% ELSE %]
85                 [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
86                     <div id="news" class="newscontainer">
87                         <div class="newsitem">
88                             <div class="newsbody">No news to display.</div>
89                             <div class="newsfooter"></div>
90                         </div>
91                     </div>
92                 [% END %]
93             [% END %]
94
95         [% IF ( display_daily_quote && daily_quote ) %]
96             <div id="daily-quote">
97                 <h3>Quote of the Day</h3>
98                 <div>
99                     <span id="daily-quote-text">[% daily_quote.text %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source %]</span>
100                 </div>
101             </div>
102         [% END %]
103
104         [% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock">[% OpacMainUserBlock %]</div>[% END %]
105         </div> <!-- / .span 7/9 -->
106
107         [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) || OpacNavRight ) %]
108             <div class="span3">
109                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
110                     [% UNLESS ( loggedinusername ) %]
111                         [% UNLESS ( casAuthentication || shibbolethAuthentication ) %]
112                             <div id="login">
113                                 <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth">
114                                     <input type="hidden" name="koha_login_context" value="opac" />
115                                     <fieldset class="brief">
116                                         <legend>Log in to your account:</legend>
117                                         <label for="userid">Login:</label><input type="text" id="userid" name="userid" />
118                                         <label for="password">Password:</label><input type="password" id="password" name="password" />
119                                     <fieldset class="action">
120                                         <input type="submit" value="Log in" class="btn" />
121                                     </fieldset>
122                                     [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<div id="patronregistration"><p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p></div>[% END %]
123                                     </fieldset>
124                                 [% IF Koha.Preference('OpacPasswordChange') && Koha.Preference('OpacResetPassword') %]
125                                     <div id="forgotpassword">
126                                         <a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
127                                     </div>
128                                 [% END %]
129                                 [% IF Koha.Preference( 'NoLoginInstructions' ) %]
130                                     <div id="nologininstructions-main">
131                                         [% Koha.Preference( 'NoLoginInstructions' ) %]
132                                     </div>
133                                 [% END %]
134                                 </form>
135                             </div> <!-- /#login -->
136                         [% END # /casAuthentication %]
137                     [% ELSE %]
138                         [% IF Koha.Preference('OPACUserSummary') %]
139                             <div id="user_summary">
140                                 <h1>Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</span></a></h1>
141                                 <ul id="user_summary_shortcuts">
142                                     [% IF checkouts && checkouts > 0 %]
143                                         <li><a href="/cgi-bin/koha/opac-user.pl">[% checkouts %] checkout(s)</a></li>
144                                     [% END %]
145                                     [% IF overdues && overdues > 0 %]
146                                         <li><a href="/cgi-bin/koha/opac-user.pl">[% overdues %] overdue(s)</a></li>
147                                     [% END %]
148                                     [% IF holds_pending && holds_pending > 0 %]
149                                         <li><a href="/cgi-bin/koha/opac-user.pl">[% holds_pending %] hold(s) pending</a></li>
150                                     [% END %]
151                                     [% IF holds_waiting && holds_waiting > 0 %]
152                                         <li><a href="/cgi-bin/koha/opac-user.pl">[% holds_waiting %] hold(s) waiting</a></li>
153                                     [% END %]
154                                     [% IF total_owing && total_owing > 0 %]
155                                         <li><a href="/cgi-bin/koha/opac-account.pl">[% total_owing | $Price %] due</a></li>
156                                     [% END %]
157                                 </ul>
158                             </div>
159                         [% END %]
160                     [% END # /loggedinusername %]
161                 [% END # /opacuserlogin %]
162                 [% IF ( OpacNavRight ) %]
163                     <div id="opacnavright">
164                         [% OpacNavRight %]
165                     </div>
166                 [% END # /OpacNavRight %]
167             </div> <!-- / .span3 -->
168         [% END # /opacuserlogin || OpacNavRight %]
169
170         </div> <!-- /.container-fluid -->
171     </div> <!-- /.row-fluid -->
172 </div> <!-- /.main -->
173
174 [% INCLUDE 'opac-bottom.inc' %]
175 [% BLOCK jsinclude %][% END %]