Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt
Kyle M Hall 432deab9ed Bug 7843: (QA followup) Make news selection persistant
This patch makes the following changes:
1) If there is no logged in patron, the RSS link states it is for
   system-wide news.
2) If a patron is logged in, the RSS link states it is for system-wide
   news *and* news for the patron's home library.
3) The patron's home branch code is embedded in the RSS feed url so
   he or she no longer needs to be logged in for us to know what branch's
   news to pull.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 16:33:21 -03:00

113 lines
5.2 KiB
Text

[% USE Koha %]
[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-main' %]
[% INCLUDE 'masthead.inc' %]
<div class="main">
<ul class="breadcrumb">
<li><a href="#">Home</a></li>
</ul>
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
[% IF ( loggedinusername ) %]
<div id="loggedin" class="container-fluid">
[% ELSE %]
<div id="notloggedin" class="container-fluid">
[% END %]
[% ELSE %]
<div id="notloggedin" class="container-fluid">
[% END %]
<div class="row-fluid">
[% IF ( OpacNav || OpacNavBottom ) %]
<div class="span2">
<div id="navigation">
[% INCLUDE 'navigation.inc' %]
</div>
</div>
[% END %]
[% IF ( OpacNav || OpacNavBottom ) %]
<div class="span7">
[% ELSE %]
<div class="span9">
[% END %]
[% IF ( koha_news_count ) %]
<div id="news" class="newscontainer">
[% FOREACH koha_new IN koha_news %]
<div class="newsitem">
<a name="newsitem[% koha_new.idnew %]"></a><h4 class="newsheader">[% koha_new.title %]</h4>
<div class="newsbody">[% koha_new.new %]</div>
<div class="newsfooter">(published on [% koha_new.newdate %])</div>
</div>
[% END %]
</div>
<div id="rssnews-container">
[% SET branchcode = Branches.GetLoggedInBranchcode() %]
<a href="[% OPACBaseURL %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode %]"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png"></a>
RSS feed for [% IF ( loggedinusername ) %][% Branches.GetName( branchcode ) %] <i>and</i> [% END %] system-wide library news.
</div>
[% END %]
[% IF ( display_daily_quote && daily_quote ) %]
<div id="daily-quote">
<h3>Quote of the Day</h3>
<div>
<span id="daily-quote-text">[% daily_quote.text %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source %]</span>
</div>
</div>
[% END %]
[% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock">[% OpacMainUserBlock %]</div>[% END %]
</div> <!-- / .span 7/9 -->
[% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) || OpacNavRight ) %]
<div class="span3">
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
[% UNLESS ( loggedinusername ) %]
[% UNLESS ( casAuthentication || shibbolethAuthentication ) %]
<div id="login">
<form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth">
<input type="hidden" name="koha_login_context" value="opac" />
<fieldset class="brief">
<legend>Log in to your account:</legend>
<label for="userid">Login:</label><input type="text" id="userid" name="userid" />
<label for="password">Password:</label><input type="password" id="password" name="password" />
<fieldset class="action">
<input type="submit" value="Log in" class="btn" />
</fieldset>
[% 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 %]
</fieldset>
[% IF Koha.Preference( 'NoLoginInstructions' ) %]
<div id="nologininstructions-main">
[% Koha.Preference( 'NoLoginInstructions' ) %]
</div>
[% END %]
</form>
</div> <!-- /#login -->
[% END # /casAuthentication %]
[% IF persona %]
<a href="#" class="persona-button" id="browserid" ><span>Sign in with your email</span></a>
[% END # /persona %]
[% END # / loggedinusername %]
[% END # /opacuserlogin %]
[% IF ( OpacNavRight ) %]
<div id="opacnavright">
[% OpacNavRight %]
</div>
[% END # /OpacNavRight %]
</div> <!-- / .span3 -->
[% END # /opacuserlogin || OpacNavRight %]
</div> <!-- /.container-fluid -->
</div> <!-- /.row-fluid -->
</div> <!-- /.main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %][% END %]