+ [% IF ( OpacNav || OpacNavBottom ) && (Koha.Preference( 'opacuserlogin' ) == 1 || OpacNavRight) %]
+ [% # Three-column layout with right and left sidebars %]
+ <div class="col-12 col-lg-7 order-md-1 maincontent">
+ [% ELSIF (Koha.Preference( 'opacuserlogin' ) == 1 || OpacNavRight) %]
+ [% # Two-column layout with right sidebar %]
+ <div class="col-12 col-lg-9 order-md-1 maincontent">
+ [% ELSIF ( OpacNav || OpacNavBottom ) %]
+ <div class="col-12 col-lg-10 order-md-1 maincontent">
+ [% ELSE %]
+ <div class="col order-md-1 maincontent">
+ [% END %]
+
+ <h1 class="sr-only">Koha home</h1>
+
+ [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
+ [% UNLESS news_item %]
+ <form id="news-branch-select" class="form-inline" name="news-branch-select" method="get" action="/cgi-bin/koha/opac-main.pl">
+ <legend class="sr-only">News</legend>
+ <label for="news-branch">Display news for: </label>
+ <select id="news-branch" name="branch">
+ [% IF ( branchcode == "" ) %]
+ <option value="" selected="selected">System-wide only</option>
+ [% ELSE %]
+ <option value="">System-wide only</option>
+ [% END %]
+ [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
+ </select>
+ </form>
+ [% END %]
+ [% END %]
+
+ [% IF koha_news.count %]
+
+ [% IF single_news_error %]
+
+ <div class="alert alert-error">
+ This news item does not exist.
+ </div>
+
+ [% ELSE %]
+
+ <div id="news" class="newscontainer">
+ [% SET show_author = Koha.Preference('NewsAuthorDisplay') == 'opac' || Koha.Preference('NewsAuthorDisplay') == 'both' %]
+ [% FOREACH koha_new IN koha_news %]
+ <div class="newsitem">
+ <h4 class="newsheader">
+ [% IF ( news_item ) %]
+ [% koha_new.title | html %]
+ [% ELSE %]
+ <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>
+ [% END %]
+ </h4>
+ <div class="newsbody">[% koha_new.content | $raw %]</div>
+ <div class="newsfooter">
+ Published on [% koha_new.published_on | $KohaDates %]
+ [% IF ( show_author && koha_new.author ) %]
+ by <span class="newsauthor">[% INCLUDE 'patron-title.inc' patron=koha_new.author %]</span>
+ [% END %]
+ [% IF ( news_item ) %]
+ • <a href="/cgi-bin/koha/opac-main.pl">Show all news</a>
+ [% END %]
+ </div>
+ </div>
+ [% END %]
+
+ [% UNLESS news_item %]
+ <div id="rssnews-container">
+ <!-- Logged in users have a branch code or it could be explicitly set -->
+ <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode | uri %]">
+ <i class="fa fa-rss" aria-hidden="true"></i>
+ [% IF Branches.all.size == 1 %]
+ [% IF branchcode %]
+ RSS feed for [% Branches.GetName( branchcode ) | html %] library news
+ [% ELSE %]
+ RSS feed for library news
+ [% END %]
+ [% ELSE %]
+ [% IF branchcode %]
+ RSS feed for [% Branches.GetName( branchcode ) | html %] and system-wide library news
+ [% ELSE %]
+ RSS feed for system-wide library news
+ [% END %]
+ [% END %]
+ </a>
+ </div>
+ [% END %]
+ </div>