Bug 28955: (follow-up) Set to fall back
[srvgit] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-main.tt
index 8956068..2b5abed 100644 (file)
@@ -4,11 +4,13 @@
 [% USE Branches %]
 [% USE Categories %]
 [% USE Price %]
-[% USE KohaNews %]
+[% USE AdditionalContents %]
 [% PROCESS 'i18n.inc' %]
-[% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => lang, library => branchcode ) %]
-[% SET OpacMainUserBlock = KohaNews.get( location => "OpacMainUserBlock", lang => lang, library => branchcode ) %]
-[% SET OpacLoginInstructions = KohaNews.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %]
+[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
+[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
+[% SET OpacNavRight = AdditionalContents.get( location => "OpacNavRight", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
+[% SET OpacMainUserBlock = AdditionalContents.get( location => "OpacMainUserBlock", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
+[% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode || default_branch ) %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'masthead.inc' %]
 
 <div class="main">
-    <nav aria-label="breadcrumb">
-        <ul class="breadcrumb">
+    <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
+        <ol class="breadcrumb">
             [% IF news_item %]
                 <li class="breadcrumb-item">
                     <a href="/cgi-bin/koha/opac-main.pl">Home</a>
                 </li>
-                <li class="breadcrumb-item active" aria-current="page">
-                    [% news_item.title | html %]
+                <li class="breadcrumb-item active">
+                    <a href="#" aria-current="page">[% news_item.title | html %]</a>
                 </li>
             [% ELSE %]
-                <li class="breadcrumb-item active" aria-current="page">
-                    <a href="/cgi-bin/koha/opac-main.pl">Home</a>
+                <li class="breadcrumb-item active">
+                    <a href="#" aria-current="page">Home</a>
                 </li>
             [% END %]
-        </ul>
-    </nav>
+        </ol>
+    </nav> <!-- /#breadcrumbs -->
 
     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
         [% IF ( loggedinusername ) %]
@@ -71,6 +73,7 @@
         [% 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 == "" ) %]
@@ -84,7 +87,7 @@
             [% END %]
         [% END %]
 
-        [% IF ( koha_news ) %]
+        [% IF koha_news.count %]
 
             [% IF single_news_error %]
 
@@ -95,7 +98,7 @@
             [% ELSE %]
 
                 <div id="news" class="newscontainer">
-                    [% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %]
+                    [% SET show_author = Koha.Preference('NewsAuthorDisplay') == 'opac' || Koha.Preference('NewsAuthorDisplay') == 'both' %]
                     [% FOREACH koha_new IN koha_news %]
                         <div class="newsitem">
                             <h4 class="newsheader">
                             <div class="newsbody">[% koha_new.content | $raw %]</div>
                             <div class="newsfooter">
                                 Published on [% koha_new.published_on | $KohaDates %]
-                                [% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %]
-                                    [% IF news_item %]
-                                        [% SET author = koha_new.author %]
-                                        by <span class="newsauthor_title">[% author.title | html %] </span>[% author.firstname | html %] [% author.surname | html %]
-                                    [% ELSE %]
-                                        by <span class="newsauthor_title">[% koha_new.author_title | html %] </span>[% koha_new.author_firstname | html %] [% koha_new.author_surname | html %]
-                                    [% END %]
+                                [% IF ( show_author && koha_new.author ) %]
+                                    by <span class="newsauthor">[% INCLUDE 'patron-title.inc' patron=koha_new.author %]</span>
                                 [% END %]
                                 [% IF ( news_item ) %]
                                     &bull; <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 -->
             [% END %]
 
             [% IF ( OpacMainUserBlock ) %]
-                <div id="opacmainuserblock">
-                    [% PROCESS koha_news_block news => OpacMainUserBlock %]
-                </div>
+                [% PROCESS koha_news_block news => OpacMainUserBlock %]
             [% END %]
         [% END %]
 
                                     <input type="hidden" name="koha_login_context" value="opac" />
                                     <fieldset class="brief">
                                         <legend>Log in to your account:</legend>
+                                        [% IF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %]
+                                            <a href="/cgi-bin/koha/svc/auth/googleopenidconnect" class="btn btn-light" id="openid_connect"><i class="fa fa-google" aria-hidden="true"></i> Log in with Google</a>
+                                            <p>If you do not have a Google account, but do have a local account, you can still log in: </p>
+                                        [% END # /IF GoogleOpenIDConnect %]
                                         <label for="userid">Login:</label>
-                                        <input class="form-control" type="text" id="userid" name="userid" />
+                                        <input class="form-control" type="text" id="userid" name="userid" autocomplete="off" />
                                         <label for="password">Password:</label>
-                                        <input class="form-control" type="password" id="password" name="password" />
+                                        <input class="form-control" type="password" id="password" name="password" autocomplete="off" />
                                         <fieldset class="action">
                                             <input type="submit" value="Log in" class="btn btn-primary" />
                                         </fieldset>