From 83f2c13a665bdd1d24fe091f8313efb8b5d63a06 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 20 Jan 2026 13:21:21 -0500 Subject: [PATCH] Bug 21266: Added missing doc-head-close and cssinclude to sco-main.tt This is a re-implementation of the previous patch set with additional de-duplication of markup. The patch also removes some redunancy from sco.scss and makes a few minor changes to markup to bring the templates in better alignment with the OPAC. Test plan: 1. Add a custom opac theme stylesheet in OpacAdditionalStylesheet syspref 2. Also ensure you have set the syspref: WebBasedSelfCheck to 'Enable' and use a patron with the self_check_permissions, and enable AutoSelfCheckAllowed syspref and write in the username and password of the aforementioned user into the AutoSelfCheckID and AuoSelfCheckPass sysprefs 3. Go to the self checkout page and notice the OPAC theme is not being applied to the self check interface. 4. Apply patch and rebuild the OPAC CSS. 5. Refresh the page and notice the custom theme is being applied. 6. Perform the same test with the SCOUserCSS preference. Sponsored-By: Central Agencies (Treasury), New Zealand Sponsored-by: Athens County Public Libraries --- .../opac-tmpl/bootstrap/css/src/sco.scss | 8 --- .../bootstrap/en/includes/masthead.inc | 2 +- .../bootstrap/en/modules/sco/help.tt | 63 ++++++------------- .../bootstrap/en/modules/sco/sco-main.tt | 53 +++------------- opac/sco/help.pl | 5 -- 5 files changed, 30 insertions(+), 101 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/sco.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/sco.scss index 64e6063397e..7294f11c668 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/sco.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/sco.scss @@ -1,9 +1,3 @@ -@import "common"; - -body { - background-color: #FCF9FC; -} - a { color: $sci-link-color; @@ -77,5 +71,3 @@ a { margin-top: 1rem; padding-top: 1rem; } - -@import "responsive"; diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index 2b6d4478d6d..90b49b627cd 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -121,7 +121,7 @@ [% END # /IF OpacPublic %] [% IF Koha.Preference( 'opacuserlogin' ) == 1 || Koha.Preference( 'EnableOpacSearchHistory') || Koha.Preference( 'opaclanguagesdisplay' ) %] [%# Following on one line for translatability %] - [% IF ( ( opaclanguagesdisplay ) && ( ! one_language_enabled ) && ( languages_loop ) && ( OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'top') ) %] + [% IF ( Koha.Preference( 'opaclanguagesdisplay' ) && ( ! one_language_enabled ) && ( languages_loop ) && ( OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'top') ) %] [% context = "header" %] [% INCLUDE 'langmenu.inc' %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt index b930c847e08..f392d2d53c8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt @@ -7,42 +7,17 @@ [% INCLUDE 'doc-head-open.inc' %] [% SET SelfCheckHelpMessage = AdditionalContents.get( location => "SelfCheckHelpMessage", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] Self-checkout help › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha[% END %] - - - - -[% Asset.css("lib/fontawesome/css/fontawesome.min.css") | $raw %] -[% Asset.css("lib/fontawesome/css/brands.min.css") | $raw %] -[% Asset.css("lib/fontawesome/css/solid.min.css") | $raw %] -[% Asset.css("css/sco.css") | $raw %] -[% IF ( Koha.Preference('OPACUserCSS') ) %] - - - -[% END %] -[% IF Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) %] - - - -[% END %] -[% IF ( SCOUserCSS ) %] - - - -[% END %] - -[% IF lang && lang != 'en' %] - [% Asset.js(lang _ '/js/locale_data.js') | $raw %] -[% END %] -[% Asset.js('js/Gettext.js') | $raw %] -[% Asset.js('js/i18n.js') | $raw %] +[% INCLUDE 'doc-head-close.inc' %] +[% BLOCK cssinclude %] + [% SET SCOUserCSS = Koha.Preference('SCOUserCSS') %] + [% IF ( SCOUserCSS ) %] + + + + + [% Asset.css("css/sco.css") | $raw %] + [% END %] +[% END %]]
@@ -88,13 +63,13 @@ -
-[% INCLUDE 'opac-bottom.inc' %] -[% BLOCK jsinclude %] - [% IF ( SCOUserJS ) %] - + [% INCLUDE 'opac-bottom.inc' %] + [% BLOCK jsinclude %] + [% IF ( SCOUserJS ) %] + + [% END %] [% END %] -[% END %] + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt index ad3dc1ab1bf..83a67b13765 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt @@ -11,50 +11,17 @@ [% PROCESS 'html_helpers.inc' %] [% INCLUDE 'doc-head-open.inc' %] Self-checkout › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha[% END %] - - - -[% IF ( Koha.Preference('OpacFavicon') ) %] - -[% ELSE %] - -[% END %] -[% Asset.css("lib/fontawesome/css/fontawesome.min.css") | $raw %] -[% Asset.css("lib/fontawesome/css/brands.min.css") | $raw %] -[% Asset.css("lib/fontawesome/css/solid.min.css") | $raw %] -[% IF ( bidi ) %] - [% Asset.css("css/sco-rtl.css") | $raw %] -[% ELSE %] - [% Asset.css("css/sco.css") | $raw %] -[% END %] -[% IF ( Koha.Preference('OPACUserCSS') ) %] - - - -[% END %] -[% IF Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) %] - - - -[% END %] -[% IF ( Koha.Preference('SCOUserCSS') ) %] - - - -[% END %] - -[% IF lang && lang != 'en' %] - [% Asset.js(lang _ '/js/locale_data.js') | $raw %] +[% INCLUDE 'doc-head-close.inc' %] +[% BLOCK cssinclude %] + [% SET SCOUserCSS = Koha.Preference('SCOUserCSS') %] + [% IF ( SCOUserCSS ) %] + + + + + [% Asset.css("css/sco.css") | $raw %] + [% END %] [% END %] -[% Asset.js('js/Gettext.js') | $raw %] -[% Asset.js('js/i18n.js') | $raw %]
diff --git a/opac/sco/help.pl b/opac/sco/help.pl index e8c38d4b544..bab198bd989 100755 --- a/opac/sco/help.pl +++ b/opac/sco/help.pl @@ -51,10 +51,5 @@ if ( C4::Context->preference('SelfCheckTimeout') ) { $template->param( SelfCheckTimeout => $selfchecktimeout ); -$template->param( - SCOUserJS => C4::Context->preference('SCOUserJS'), - SCOUserCSS => C4::Context->preference('SCOUserCSS'), -); - output_html_with_http_headers $query, $cookie, $template->output; -- 2.39.5