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