Bugzilla – Attachment 176014 Details for
Bug 37054
Allow for custom library colors in the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37054: (follow-up) Rename branchcolor to library_color and use snake casing
Bug-37054-follow-up-Rename-branchcolor-to-libraryc.patch (text/plain), 7.66 KB, created by
Lucas Gass (lukeg)
on 2024-12-30 18:07:54 UTC
(
hide
)
Description:
Bug 37054: (follow-up) Rename branchcolor to library_color and use snake casing
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-12-30 18:07:54 UTC
Size:
7.66 KB
patch
obsolete
>From 0993587827e32d83e6be128bad6b2fb9a254c5d8 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 30 Dec 2024 18:03:32 +0000 >Subject: [PATCH] Bug 37054: (follow-up) Rename branchcolor to library_color > and use snake casing > >--- > Koha/Library.pm | 2 +- > Koha/Template/Plugin/Branches.pm | 6 +++--- > admin/branches.pl | 2 +- > .../atomicupdate/bug_37054_add_branchcolor.pl | 8 ++++---- > installer/data/mysql/kohastructure.sql | 2 +- > .../prog/en/includes/doc-head-close.inc | 12 ++++++------ > .../prog/en/modules/admin/branches.tt | 14 +++++++------- > 7 files changed, 23 insertions(+), 23 deletions(-) > >diff --git a/Koha/Library.pm b/Koha/Library.pm >index 4dc5377f858..361ece2a035 100644 >--- a/Koha/Library.pm >+++ b/Koha/Library.pm >@@ -371,7 +371,7 @@ sub to_api_mapping { > marcorgcode => 'marc_org_code', > opacusercss => undef, > opacuserjs => undef, >- branchcolor => undef >+ library_color => undef > }; > } > >diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm >index 53ab7d3053d..566faedfc2c 100644 >--- a/Koha/Template/Plugin/Branches.pm >+++ b/Koha/Template/Plugin/Branches.pm >@@ -191,15 +191,15 @@ sub GetBranchSpecificCSS { > return $opacusercss; > } > >-sub GetBranchColor { >+sub get_library_color { > my ( $self, $branchcode ) = @_; > > return q{} unless defined $branchcode; > > my $library = Koha::Libraries->find($branchcode); >- my $branchcolor = $library ? $library->branchcolor : q{}; >+ my $library_color = $library ? $library->library_color : q{}; > >- return $branchcolor; >+ return $library_color; > } > > 1; >diff --git a/admin/branches.pl b/admin/branches.pl >index 32f58d55365..497efa5c31c 100755 >--- a/admin/branches.pl >+++ b/admin/branches.pl >@@ -84,7 +84,7 @@ if ( $op eq 'add_form' ) { > public > opacuserjs > opacusercss >- branchcolor >+ library_color > ); > my $is_a_modif = $input->param('is_a_modif'); > >diff --git a/installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl b/installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl >index 8bb54539bc5..df3e090cd17 100755 >--- a/installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl >+++ b/installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl >@@ -3,21 +3,21 @@ use Koha::Installer::Output qw(say_warning say_failure say_success say_info); > > return { > bug_number => "37054", >- description => "Add branches.branchcolor", >+ description => "Add branches.library_color", > up => sub { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; > >- if ( !column_exists( 'branches', 'branchcolor' ) ) { >+ if ( !column_exists( 'branches', 'library_color' ) ) { > $dbh->do( > q{ > ALTER TABLE branches >- ADD COLUMN `branchcolor` varchar(16) DEFAULT 0 COMMENT 'defines the branch color' >+ ADD COLUMN `library_color` varchar(16) DEFAULT 0 COMMENT 'defines the library color' > AFTER `opacusercss` > } > ); > } >- say $out "Added column 'branch.branchcolor'"; >+ say $out "Added column 'branch.library_color'"; > > }, > }; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 738ed8968ea..ab89b48086e 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1677,7 +1677,7 @@ CREATE TABLE `branches` ( > `public` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'whether this library should show in the opac', > `opacuserjs` longtext DEFAULT NULL COMMENT 'branch specific javascript for the OPAC', > `opacusercss` longtext DEFAULT NULL COMMENT 'branch specific css for the OPAC', >- `branchcolor` varchar(16) DEFAULT NULL COMMENT 'branch specific color', >+ `library_color` varchar(16) DEFAULT NULL COMMENT 'library specific color', > PRIMARY KEY (`branchcode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >index e229e7ab9e6..5d213da393e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >@@ -51,23 +51,23 @@ var Koha = {}; > [% IF ( login ) %] > [% Asset.css("css/login.css") | $raw %] > [% END %] >-[% SET branchcolor = Branches.GetBranchColor( Branches.GetLoggedInBranchcode() ) %] >-[% IF branchcolor %] >+[% SET library_color = Branches.get_library_color( Branches.GetLoggedInBranchcode() ) %] >+[% IF library_color %] > <style> > #header_search, > #header_search ul, > #header_search .form-title, > #header_search .nav-tabs > li > a { >- background-color: [% branchcolor | html %]; >- border-color: [% branchcolor | html %]; >+ background-color: [% library_color | html %]; >+ border-color: [% library_color | html %]; > } > > #header_search button[type="submit"] { >- background: [% branchcolor | html %]; >+ background: [% library_color | html %]; > filter: brightness(120%); > } > #header_search button[type="submit"]:hover { >- background: [% branchcolor | html %]; >+ background: [% library_color | html %]; > filter: brightness(140%); > } > </style> >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 28cabc4b2ab..4e95e811486 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >@@ -368,8 +368,8 @@ > </li> > <li> > <label for="colorpicker">Search bar color: </label> >- <input type="color" name="colorpicker" id="colorpicker" value="[% library.branchcolor | html %]" /> >- <input type="text" name="branchcolor" id="branchcolor" readonly="readonly" size="10" maxlength="16" value="[% library.branchcolor | html %]" /> >+ <input type="color" name="colorpicker" id="colorpicker" value="[% library.library_color | html %]" /> >+ <input type="text" name="library_color" id="library_color" readonly="readonly" size="10" maxlength="16" value="[% library.library_color | html %]" /> > <a href="#" class="clear_color"><i class="fa fa-fw fa-trash-can"></i> Clear</a> > </li> > </ol> >@@ -605,8 +605,8 @@ > [% END %] > </li> > <li> >- <span class="label">Branch color</span> >- [% library.branchcolor | html %] >+ <span class="label">Library color</span> >+ [% library.library_color | html %] > </li> > </ol> > </div> <!-- /.rows --> >@@ -879,13 +879,13 @@ > }); > > $("#colorpicker").on("change", function(){ >- let branchcolor = this.value; >- $("#branchcolor").val( branchcolor ); >+ let library_color = this.value; >+ $("#library_color").val( library_color ); > }); > > $(".clear_color").on("click", function(e){ > e.preventDefault(); >- $("#branchcolor, #colorpicker").val( "" ); >+ $("#library_color, #colorpicker").val( "" ); > }); > </script> > [% END %] >-- >2.39.2
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 37054
:
167577
|
167578
|
167579
|
167590
|
167595
|
167596
|
167597
|
167598
|
167609
|
167612
|
167613
|
167614
|
167615
|
167616
|
167618
|
167625
|
171221
|
171222
|
171223
|
171224
|
171225
|
171226
|
175991
|
175992
|
175993
|
175994
|
175995
|
175996
|
176014
|
176015
|
176016
|
176615
|
176616
|
180329
|
180330
|
180331
|
180332
|
180333
|
180334