Bugzilla – Attachment 156161 Details for
Bug 32721
Allow specifying UserCSS and UserJS at library level for the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32721: (QA follow up) - fix QA issues
Bug-32721-QA-follow-up---fix-QA-issues.patch (text/plain), 10.40 KB, created by
Matt Blenkinsop
on 2023-09-25 13:33:33 UTC
(
hide
)
Description:
Bug 32721: (QA follow up) - fix QA issues
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2023-09-25 13:33:33 UTC
Size:
10.40 KB
patch
obsolete
>From 2c4f4a23db466ee9e9d48a026f0314be12abddbc Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 27 Jan 2023 14:46:44 +0000 >Subject: [PATCH] Bug 32721: (QA follow up) - fix QA issues > >This patches addresses issues raised by the QA tests. It also adds a missed import of the Branches file in the document head > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >Bug 32721: (QA follow-up) Add missing imports > >Missing imports added in three template files >Exec flag added to atomic update file >Tinymce imports removed > >A new bug will be created to move codemirror into an inc file at latest >version > >Test plan as before > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >Bug 32721: Tidy up - duplicate fetching of userjs and css > >Currently UserJS and UserCSS is injected into the template as a parameter through Auth.pm but is then fetched using Koha.Preference() in the template. This patch tidies this up by removing the parameters from Auth.pm > >Test plan as per first commit > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Auth.pm | 8 ++++++-- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt | 6 ++---- > .../opac-tmpl/bootstrap/en/includes/doc-head-close.inc | 1 + > koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt | 5 +++++ > koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt | 5 +++++ > koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 5 +++++ > t/db_dependent/Template/Plugin/Branches.t | 2 +- > 7 files changed, 25 insertions(+), 7 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 9b298eed87..7361f829e9 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -573,7 +573,6 @@ sub get_template_and_user { > OpacHighlightedWords => C4::Context->preference("OpacHighlightedWords"), > OPACShelfBrowser => "" . C4::Context->preference("OPACShelfBrowser"), > OPACURLOpenInNewWindow => "" . C4::Context->preference("OPACURLOpenInNewWindow"), >- OPACUserCSS => "" . C4::Context->preference("OPACUserCSS"), > OpacAuthorities => C4::Context->preference("OpacAuthorities"), > opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, > opac_search_limit => $opac_search_limit, >@@ -593,7 +592,6 @@ sub get_template_and_user { > OpacFavicon => C4::Context->preference("OpacFavicon"), > opaclanguagesdisplay => "" . C4::Context->preference("opaclanguagesdisplay"), > opacreadinghistory => C4::Context->preference("opacreadinghistory"), >- OPACUserJS => C4::Context->preference("OPACUserJS"), > opacuserlogin => "" . C4::Context->preference("opacuserlogin"), > OpenLibrarySearch => C4::Context->preference("OpenLibrarySearch"), > ShowReviewer => C4::Context->preference("ShowReviewer"), >@@ -1373,6 +1371,12 @@ sub checkauth { > OpacFavicon => C4::Context->preference("OpacFavicon"), > opacreadinghistory => C4::Context->preference("opacreadinghistory"), > opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"), >+ opacbookbag => "" . C4::Context->preference("opacbookbag"), >+ OpacCloud => C4::Context->preference("OpacCloud"), >+ OpacTopissue => C4::Context->preference("OpacTopissue"), >+ OpacAuthorities => C4::Context->preference("OpacAuthorities"), >+ OpacBrowser => C4::Context->preference("OpacBrowser"), >+ TagsEnabled => C4::Context->preference("TagsEnabled"), > OPACUserJS => C4::Context->preference("OPACUserJS"), > OPACUserCSS => C4::Context->preference("OPACUserCSS"), > intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >index 8020c7aaa1..dab2e97ea7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >@@ -292,7 +292,7 @@ > <label for="UserJS">UserJS: </label> > <div style="display:flex; flex-direction:column;"> > <a class="expand-textarea" id="expand_userjs" data-target="userjs" data-syntax="javascript" href="#">Click to edit</a> >- <textarea style="display:none" name="userjs" id="userjs" class="codemirror" rows="10" cols="40">[% library.userjs %]</textarea> >+ <textarea style="display:none" name="userjs" id="userjs" class="codemirror" rows="10" cols="40">[% library.userjs | html %]</textarea> > <a class="collapse-textarea" id="collapse_userjs" data-target="userjs" data-syntax="javascript" style="display:none" href="#">Click to collapse</br></a> > </div> > </li> >@@ -300,7 +300,7 @@ > <label for="UserCSS">UserCSS: </label> > <div style="display:flex; flex-direction:column;"> > <a class="expand-textarea" id="expand_usercss" data-target="usercss" data-syntax="css" href="#">Click to edit</a> >- <textarea style="display:none" name="usercss" id="usercss" class="" rows="10" cols="40">[% library.usercss %]</textarea> >+ <textarea style="display:none" name="usercss" id="usercss" class="" rows="10" cols="40">[% library.usercss | html %]</textarea> > <a class="collapse-textarea" id="collapse_usercss" data-target="usercss" data-syntax="css" style="display:none" href="#">Click to collapse</br></a> > </div> > </li> >@@ -504,7 +504,6 @@ > [% Asset.js("js/admin-menu.js") | $raw %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'columns_settings.inc' %] >- [% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %] > [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %] > [% Asset.js( "lib/codemirror/css.min.js" ) | $raw %] > [% Asset.js( "lib/codemirror/javascript.min.js" ) | $raw %] >@@ -520,7 +519,6 @@ > [% Asset.js( "lib/codemirror/css-lint.min.js" ) | $raw %] > [% Asset.js( "lib/codemirror/yaml-lint.min.js" ) | $raw %] > [% Asset.css("lib/codemirror/codemirror.css") | $raw %] >- [% INCLUDE 'str/tinymce_i18n.inc' %] > <style> > .CodeMirror { > border: 1px solid #EEE; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >index 3183783fe1..402633854b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc >@@ -1,5 +1,6 @@ > [% USE raw %] > [% USE Koha %] >+[% USE Branches %] > [%- USE KohaPlugins -%] > [% USE Asset %] > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt >index cc044a6845..8260548999 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt >@@ -40,6 +40,11 @@ > [% Asset.css("css/sco.css") | $raw %] > [% END %] > [% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %] >+[% IF Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) %] >+ <style> >+ [% Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) | $raw %] >+ </style> >+[% END %] > [% IF ( Koha.Preference('SelfCheckInUserCSS') ) %]<style>[% Koha.Preference('SelfCheckInUserCSS') | $raw %]</style>[% END %] > <script> > var Koha = {}; >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 bc50e98507..f895cb7d09 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt >@@ -11,6 +11,11 @@ > [% Asset.css("lib/font-awesome/css/font-awesome.min.css") | $raw %] > [% Asset.css("css/sco.css") | $raw %] > [% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %] >+[% IF Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) %] >+ <style> >+ [% Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) | $raw %] >+ </style> >+[% END %] > [% IF ( SCOUserCSS ) %]<style>[% SCOUserCSS | $raw %]</style>[% END %] > <script> > var Koha = {}; >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 003c792402..4b8a140942 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 >@@ -21,6 +21,11 @@ > [% Asset.css("css/sco.css") | $raw %] > [% END %] > [% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %] >+[% IF Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) %] >+ <style> >+ [% Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) | $raw %] >+ </style> >+[% END %] > [% IF ( Koha.Preference('SCOUserCSS') ) %]<style>[% Koha.Preference('SCOUserCSS') | $raw %]</style>[% END %] > <script> > var Koha = {}; >diff --git a/t/db_dependent/Template/Plugin/Branches.t b/t/db_dependent/Template/Plugin/Branches.t >index fe23f00875..47722038ad 100755 >--- a/t/db_dependent/Template/Plugin/Branches.t >+++ b/t/db_dependent/Template/Plugin/Branches.t >@@ -218,7 +218,7 @@ subtest 'pickup_locations() tests' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'branch specfic js and css' => sub { >+subtest 'branch specific js and css' => sub { > > plan tests => 2; > >-- >2.37.1 (Apple Git-137.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 32721
:
145731
|
145732
|
145733
|
145734
|
145735
|
145754
|
145759
|
146159
|
146160
|
146161
|
146162
|
146163
|
146164
|
147373
|
149860
|
149861
|
149862
|
149863
|
149864
|
149865
|
149866
|
150713
|
150724
|
150725
|
150726
|
150727
|
150728
|
150729
|
150730
|
150731
|
150732
|
150754
|
150755
|
150756
|
150757
|
150758
|
156157
|
156158
|
156159
|
156160
| 156161 |
156162
|
156163
|
156164
|
157335