From f31bbfccec3ea3d5e1a4f526df057a52613b5a7e Mon Sep 17 00:00:00 2001 From: Owen Leonard 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 Signed-off-by: Jonathan Druart --- .../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 %] - [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %] -
Your cart is empty.
- [% END %] - + [% 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 @@ [% END %] - [% IF ( !Koha.Preference( 'opacuserlogin') || !loggedinusername ) %] + + [% IF !loggedinusername %] + + + [% END %] + [% IF OpacPublic && ( !Koha.Preference( 'opacuserlogin') || !loggedinusername ) %] [% IF Koha.Preference( 'EnableOpacSearchHistory' ) %] +
  • -- 2.34.1