Bugzilla – Attachment 159225 Details for
Bug 33244
Do not show lists in OPAC if OpacPublic is disabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33244: Do not show lists in OPAC if OpacPublic is disabled
Bug-33244-Do-not-show-lists-in-OPAC-if-OpacPublic-.patch (text/plain), 16.62 KB, created by
Jonathan Druart
on 2023-11-24 07:10:15 UTC
(
hide
)
Description:
Bug 33244: Do not show lists in OPAC if OpacPublic is disabled
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-11-24 07:10:15 UTC
Size:
16.62 KB
patch
obsolete
>From f31bbfccec3ea3d5e1a4f526df057a52613b5a7e Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 21 Nov 2023 14:37:16 +0000 >Subject: [PATCH] Bug 33244: Do not show lists in OPAC if OpacPublic is > disabled > >This patch updates markup and CSS in the OPAC header so that the Cart >and Lists controls don't appear when OpacPublic is disabled. > >The patch also moves the "Your cookies" link into the group of links >with "Log in to your account" and "Search history." This makes the >template logic a little simpler and also seems like a more logical >grouping. > >To test, apply the patch and enable the CookieContent system preference. > >- View the OPAC with the OpacPublic system preference enabled. >- If necessary, click the "Accept all cookies" button. >- The "Your cookies" link should now appear in the header between the > log-in link and the search history link. >- Test the page at various browser widths to confirm that the header > still responds well to changes. >- Go back to system preferences in the staff client and change the > OpacPublic system preference to "disabled." >- Return to the OPAC and refresh the page. You should be redirected to > the login page, and the Cart and Lists buttons should no longer appear > in the header. >- The links in the header for login and cookies should look correct at > various browser widths. > >Signed-off-by: David Cook <dcook@prosentient.com.au> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../bootstrap/css/src/_responsive.scss | 2 + > .../opac-tmpl/bootstrap/css/src/opac.scss | 3 + > .../bootstrap/en/includes/masthead.inc | 142 +++++++++--------- > 3 files changed, 78 insertions(+), 69 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss >index 9085c7ddb56..5685a88fc08 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss >@@ -346,6 +346,7 @@ > @media only screen and ( max-width: 800px ) { > /* Screens below 800 pixels wide */ > .cartlabel, >+ .cookieconsentlabel, > .listslabel, > .langlabel, > .userlabel { >@@ -531,6 +532,7 @@ > > @media only screen and ( max-width: 1100px ) { > .cartlabel, >+ .cookieconsentlabel, > .listslabel, > .langlabel, > .userlabel { >diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >index 33aaf5054bd..809383f7c76 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >@@ -338,6 +338,9 @@ th { > } > > #members { >+ flex-grow: 1; >+ justify-content: flex-end; >+ > p { > color: #727272; > } >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index bec516757ff..670c15fc508 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -29,81 +29,74 @@ > [% END %] > </a> > </div> >- [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %] >- <div id="cartDetails" class="cart-message">Your cart is empty.</div> >- [% END %] >- <ul id="cart-list-nav" class="navbar-nav"> >+ [% IF ( OpacPublic ) %] > [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %] >- <li class="nav-item js-show"> >- <a href="#" class="nav-link" title="Collect items you are interested in" id="cartmenulink" role="button"> >- <i id="carticon" class="fa fa-shopping-cart fa-icon-black" aria-hidden="true"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span> >- </a> >- </li> >+ <div id="cartDetails" class="cart-message">Your cart is empty.</div> > [% END %] >- <li class="divider-vertical"></li> >- [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) %] >- <li class="nav-item dropdown"> >- <a href="/cgi-bin/koha/opac-shelves.pl" title="Show lists" class="nav-link dropdown-toggle" id="listsmenu" data-toggle="dropdown" role="button" aria-label="Show dropdown with detailed list information" aria-haspopup="true" aria-expanded="false" >- ><i class="fa fa-list fa-icon-black" aria-hidden="true"></i> <span class="listslabel">Lists</span> >- </a> >- <div aria-labelledby="listsmenu" role="menu" class="dropdown-menu"> >- [% IF some_public_shelves.count %] >- <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1" tabindex="-1" role="menuitem"><strong>Public lists</strong></a> >- [% SET number_of_public_shelves = 0 %] >- [% FOREACH s IN some_public_shelves %] >- <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]&sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a> >- [% SET number_of_public_shelves = number_of_public_shelves + 1 %] >- [% IF number_of_public_shelves >= 10 %][% LAST %][% END %] >+ <ul id="cart-list-nav" class="navbar-nav"> >+ [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %] >+ <li class="nav-item js-show"> >+ <a href="#" class="nav-link" title="Collect items you are interested in" id="cartmenulink" role="button"> >+ <i id="carticon" class="fa fa-shopping-cart fa-icon-black" aria-hidden="true"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span> >+ </a> >+ </li> >+ [% END %] >+ <li class="divider-vertical"></li> >+ [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) %] >+ <li class="nav-item dropdown"> >+ <a href="/cgi-bin/koha/opac-shelves.pl" title="Show lists" class="nav-link dropdown-toggle" id="listsmenu" data-toggle="dropdown" role="button" aria-label="Show dropdown with detailed list information" aria-haspopup="true" aria-expanded="false" >+ ><i class="fa fa-list fa-icon-black" aria-hidden="true"></i> <span class="listslabel">Lists</span> >+ </a> >+ <div aria-labelledby="listsmenu" role="menu" class="dropdown-menu"> >+ [% IF some_public_shelves.count %] >+ <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1" tabindex="-1" role="menuitem"><strong>Public lists</strong></a> >+ [% SET number_of_public_shelves = 0 %] >+ [% FOREACH s IN some_public_shelves %] >+ <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]&sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a> >+ [% SET number_of_public_shelves = number_of_public_shelves + 1 %] >+ [% IF number_of_public_shelves >= 10 %][% LAST %][% END %] >+ [% END %] >+ [% IF some_public_shelves > 10 %] >+ <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1" tabindex="-1" role="menuitem">View all</a> >+ [% END %] > [% END %] >- [% IF some_public_shelves > 10 %] >- <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=1" tabindex="-1" role="menuitem">View all</a> >+ [% IF some_public_shelves.count > 0 %] >+ <div class="dropdown-divider"></div> > [% END %] >- [% END %] >- [% IF some_public_shelves.count > 0 %] >- <div class="dropdown-divider"></div> >- [% END %] >- [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] >- <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0" tabindex="-1" role="menuitem"><strong>Your lists</strong></a> >- [% IF loggedinusername %] >- [% IF some_private_shelves.count %] >- [% SET number_of_private_shelves = 0 %] >- [% FOREACH s IN some_private_shelves %] >- <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]&sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a> >- [% SET number_of_private_shelves = number_of_private_shelves + 1 %] >- [% IF number_of_private_shelves >= 10 %][% LAST %][% END %] >- [% END %] >- [% IF some_private_shelves > 10 %] >- <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0" tabindex="-1" role="menuitem">View all</a> >+ [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] >+ <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0" tabindex="-1" role="menuitem"><strong>Your lists</strong></a> >+ [% IF loggedinusername %] >+ [% IF some_private_shelves.count %] >+ [% SET number_of_private_shelves = 0 %] >+ [% FOREACH s IN some_private_shelves %] >+ <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]&sortfield=[% s.sortfield | uri %]" tabindex="-1" role="menuitem">[% s.shelfname | html %]</a> >+ [% SET number_of_private_shelves = number_of_private_shelves + 1 %] >+ [% IF number_of_private_shelves >= 10 %][% LAST %][% END %] >+ [% END %] >+ [% IF some_private_shelves > 10 %] >+ <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=list&public=0" tabindex="-1" role="menuitem">View all</a> >+ [% END %] >+ [% ELSE %] >+ <a class="dropdown-item disabled" href="#" tabindex="-1" role="menuitem">No private lists</a> > [% END %] >+ <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">New list</a> > [% ELSE %] >- <a class="dropdown-item disabled" href="#" tabindex="-1" role="menuitem">No private lists</a> >- [% END %] >- <a class="dropdown-item listmenulink" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">New list</a> >- [% ELSE %] >- <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">Log in to create your own lists</a> >- [% END # / IF loggedinusername %] >- [% END # / IF opacuserlogin %] >- </div> <!-- / .dropdown-menu --> >- </li> <!-- / .nav-item.dropdown --> >- [% END # / IF virtualshelves %] >- [% IF Koha.Preference( 'OpacTrustedCheckout' ) %] >- <li class="nav-item"> >- <a href="#" class="nav-link" title="Self check out" id="comenulink" role="button" data-toggle="modal" data-target="#checkoutModal"> >- <i id="checkout-icon" class="fa fa-barcode fa-icon-black" aria-hidden="true"></i> <span class="checkout-label">Self checkout</span> >- </a> >- </li> >- [% END %] >- <!-- Cookie consent button for non logged-in users --> >- [% IF !loggedinusername %] >- <li style="display:none" id="cookieConsentDivider" class="divider-vertical" aria-hidden="true"></li> >- <li style="display:none" id="cookieConsentLi" class="nav-item" aria-hidden="true"> >- <a id="cookieConsentButton" href="#" name="Your cookies" class="nav-link" title="View and amend cookies you have consented to" role="button"> >- <span class="cookieconsentlabel">Your cookies</span> >- </a> >- </li> >- [% END %] >- </ul> <!-- / .navbar-nav --> >+ <a class="dropdown-item" href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem">Log in to create your own lists</a> >+ [% END # / IF loggedinusername %] >+ [% END # / IF opacuserlogin %] >+ </div> <!-- / .dropdown-menu --> >+ </li> <!-- / .nav-item.dropdown --> >+ [% END # / IF virtualshelves %] >+ [% IF Koha.Preference( 'OpacTrustedCheckout' ) %] >+ <li class="nav-item"> >+ <a href="#" class="nav-link" title="Self check out" id="comenulink" role="button" data-toggle="modal" data-target="#checkoutModal"> >+ <i id="checkout-icon" class="fa fa-barcode fa-icon-black" aria-hidden="true"></i> <span class="checkout-label">Self checkout</span> >+ </a> >+ </li> >+ [% END %] > >+ </ul> <!-- / .navbar-nav --> >+ [% END # /IF OpacPublic %] > [% IF Koha.Preference( 'opacuserlogin' ) == 1 || Koha.Preference( 'EnableOpacSearchHistory') || Koha.Preference( 'opaclanguagesdisplay' ) %] > [% IF ( Koha.Preference( 'opaclanguagesdisplay' ) ) %] > [% INCLUDE 'masthead-langmenu.inc' %] >@@ -147,8 +140,19 @@ > </div> > [% END %] > </li> >- [% IF ( !Koha.Preference( 'opacuserlogin') || !loggedinusername ) %] >+ <!-- Cookie consent button for non logged-in users --> >+ [% IF !loggedinusername %] >+ <li style="display:none" id="cookieConsentDivider" class="divider-vertical" aria-hidden="true"></li> >+ <li style="display:none" id="cookieConsentLi" class="nav-item" aria-hidden="true"> >+ <a id="cookieConsentButton" href="#" name="Your cookies" class="nav-link" title="View and amend cookies you have consented to" role="button"> >+ <i class="fa fa-cookie-bite" aria-hidden="true"></i> >+ <span class="cookieconsentlabel">Your cookies</span> >+ </a> >+ </li> >+ [% END %] >+ [% IF OpacPublic && ( !Koha.Preference( 'opacuserlogin') || !loggedinusername ) %] > [% IF Koha.Preference( 'EnableOpacSearchHistory' ) %] >+ <li class="divider-vertical"></li> > <li class="nav-item search_history"> > <a class="nav-link login-link" href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a> > </li> >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33244
:
159170
|
159188
| 159225