From 12df912e5050961857df4350a790332e4a1a2ccb Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 11 Jul 2023 16:33:38 +0000 Subject: [PATCH] Bug 27378: (QA follow-up) Small fixes and tidy-ups This patch does the following: - Realphabetizes the lines in sysprefs.sql - Fixes a formatting error in patrons.pref - Adjusts the position of the cookie consent bar if the language selector is visible - Fixes translatability on the syspref modal Signed-off-by: Katrin Fischer --- installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/patrons.pref | 8 ++++---- koha-tmpl/intranet-tmpl/prog/js/cookieconsent.js | 5 +++++ koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js | 6 +++--- koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js | 5 +++++ 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 72cdcdcfc1..c9a1609f40 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -156,10 +156,10 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ComponentSortField','title','call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), ('ComponentSortOrder','asc','asc|dsc|az|za','Specify the default sort order','Choice'), ('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'), -('CookieConsentedJS', '', NULL, 'Add Javascript code that will run if cookie consent is provided (e.g. tracking code).', 'Free'), ('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'), ('ContentWarningField', '', NULL, 'MARC field to use for content warnings', 'Free'), ('CookieConsent', '0', NULL, 'Require cookie consent to be displayed', 'YesNo'), +('CookieConsentedJS', '', NULL, 'Add Javascript code that will run if cookie consent is provided (e.g. tracking code).', 'Free'), ('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo'), ('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'), ('CumulativeRestrictionPeriods',0,NULL,'Cumulate the restriction periods instead of keeping the highest','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 8692e5e9e8..0adb1ae1d7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -391,11 +391,11 @@ Patrons: - - pref: CookieConsent choices: - yes: Require - no: "Don't require" - - cookie consent to be displayed + 1: Require + 0: "Don't require" + - cookie consent to be displayed in the OPAC and staff interface. - - - Add Javascript code that will run if cookie consent is provided (e.g. tracking code). + - Run the following JavaScript if cookie consent is provided (e.g. tracking code). - pref: CookieConsentedJS type: modaljs initiator: populateCookieConsentedJS diff --git a/koha-tmpl/intranet-tmpl/prog/js/cookieconsent.js b/koha-tmpl/intranet-tmpl/prog/js/cookieconsent.js index b74dba1066..3ed76ae272 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cookieconsent.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cookieconsent.js @@ -34,6 +34,11 @@ function showConsentBar() { const consentBar = $('#cookieConsentBar'); + const langmenu = $('#changelanguage'); + if(langmenu) { + const height = langmenu.height(); + consentBar.css('bottom', height); + }; consentBar.attr('aria-hidden', 'false'); consentBar.show(); } diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js index fc72beff92..da5ffcc466 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js @@ -394,7 +394,7 @@ $( document ).ready( function () { ' ' + ' ' + ' ' + - ' Delete' + + ' ' + __('Delete') + '' + ' '; } @@ -419,8 +419,8 @@ $( document ).ready( function () { cookieDomain: '', cookiePath: '', code: '', - consentInOpac: false, - consentInStaff: false + opacConsent: false, + staffConsent: false }; } diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js b/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js index ec4372216c..72bc87d624 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/cookieconsent.js @@ -36,6 +36,11 @@ function showConsentBar() { const consentBar = $('#cookieConsentBar'); + const langmenu = $('#changelanguage'); + if(langmenu) { + const height = langmenu.height(); + consentBar.css('bottom', height); + }; consentBar.attr('aria-hidden', 'false'); consentBar.show(); } -- 2.30.2