From 5249dc42b4c9d0908bff3a3db859dda141db5db4 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 Signed-off-by: Katrin Fischer --- .../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 9085c7ddb5..5685a88fc0 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 33aaf5054b..809383f7c7 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 bec516757f..670c15fc50 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.39.5