Bugzilla – Attachment 145759 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), 5.51 KB, created by
Matt Blenkinsop
on 2023-01-27 15:49:55 UTC
(
hide
)
Description:
Bug 32721: (QA follow up) - fix QA issues
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2023-01-27 15:49:55 UTC
Size:
5.51 KB
patch
obsolete
>From c2f54d10e7e435509c4950b6896e828ee2ec29c4 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 >--- > Koha/Template/Plugin/Branches.pm | 4 ++-- > .../mysql/atomicupdate/bug_32721-add_branch_level_js.pl | 6 +++--- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt | 4 ++-- > .../opac-tmpl/bootstrap/en/includes/doc-head-close.inc | 1 + > t/db_dependent/Template/Plugin/Branches.t | 2 +- > 5 files changed, 9 insertions(+), 8 deletions(-) > >diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm >index e439a500966..693c088fe24 100644 >--- a/Koha/Template/Plugin/Branches.pm >+++ b/Koha/Template/Plugin/Branches.pm >@@ -157,7 +157,7 @@ sub GetBranchSpecificJS { > my ($self, $branchcode) = @_; > > return q{} unless defined $branchcode; >- >+ > my $library = Koha::Libraries->find($branchcode); > my $userjs = $library ? $library->userjs : q{}; > >@@ -168,7 +168,7 @@ sub GetBranchSpecificCSS { > my ($self, $branchcode) = @_; > > return q{} unless defined $branchcode; >- >+ > my $library = Koha::Libraries->find($branchcode); > my $usercss = $library ? $library->usercss : q{}; > >diff --git a/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl b/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl >index d59e45a4317..4471d96eef4 100644 >--- a/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl >+++ b/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl >@@ -4,17 +4,17 @@ return { > bug_number => "32721", > description => "Allow branch specific javascript and css to be injected into the OPAC depending on a branchcode", > up => sub { >- my ($args) = @_; >+ my ($args) = @_; > my ($dbh, $out) = @$args{qw(dbh out)}; > >- if( !column_exists( 'branches', 'userjs' ) ) { >+ if( !column_exists( 'branches', 'userjs' ) ) { > $dbh->do(q{ > ALTER TABLE branches ADD COLUMN `userjs` longtext DEFAULT NULL AFTER `public` > }); > > say $out "Added column 'branches.userjs'"; > } >- if( !column_exists( 'branches', 'usercss' ) ) { >+ if( !column_exists( 'branches', 'usercss' ) ) { > $dbh->do(q{ > ALTER TABLE branches ADD COLUMN `usercss` longtext DEFAULT NULL AFTER `userjs` > }); >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 33880c39330..b7454331fbc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >@@ -294,7 +294,7 @@ Libraries › Administration › Koha > <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> >@@ -302,7 +302,7 @@ Libraries › Administration › Koha > <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> >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 a1b7ba5eda1..476e83afa96 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/t/db_dependent/Template/Plugin/Branches.t b/t/db_dependent/Template/Plugin/Branches.t >index fe23f008750..47722038ad2 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