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