Bugzilla – Attachment 167590 Details for
Bug 37054
Allow for custom library colors in the staff interface header search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37054: Adjust header colors if branches.branchcolor is used
Bug-37054-Adjust-header-colors-if-branchesbranchco.patch (text/plain), 5.66 KB, created by
Lucas Gass (lukeg)
on 2024-06-07 22:06:47 UTC
(
hide
)
Description:
Bug 37054: Adjust header colors if branches.branchcolor is used
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-06-07 22:06:47 UTC
Size:
5.66 KB
patch
obsolete
>From 3bf24923467686f30d11478b0d07aca2f5e601c4 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 7 Jun 2024 21:55:10 +0000 >Subject: [PATCH] Bug 37054: Adjust header colors if branches.branchcolor is > used > >To test: >1. Apply patch, update database, restart services, yarn build >2. Go to Administration > Libraries >3. Edit or create a new branch. >4. You should now see a 'Branch color' option. >5. Set that to anything you want. >6. Log in as that branch. >7. Your header color should now relect that choice. >8. Log in to another branch without a set branch color. >9. The header should remain the default green. >--- > Koha/Template/Plugin/Branches.pm | 11 ++++++++ > .../intranet-tmpl/prog/css/src/_header.scss | 25 ++++++++----------- > .../prog/en/includes/doc-head-close.inc | 21 ++++++++++++++++ > 3 files changed, 42 insertions(+), 15 deletions(-) > >diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm >index 7090530f38..2bc02a8255 100644 >--- a/Koha/Template/Plugin/Branches.pm >+++ b/Koha/Template/Plugin/Branches.pm >@@ -175,4 +175,15 @@ sub GetBranchSpecificCSS { > return $opacusercss; > } > >+sub GetBranchColor { >+ my ( $self, $branchcode ) = @_; >+ >+ return q{} unless defined $branchcode; >+ >+ my $library = Koha::Libraries->find($branchcode); >+ my $branchcolor = $library ? $library->branchcolor : q{}; >+ >+ return $branchcolor; >+} >+ > 1; >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/_header.scss b/koha-tmpl/intranet-tmpl/prog/css/src/_header.scss >index 4ebef0ba1d..cddd3543e3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/_header.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/_header.scss >@@ -52,11 +52,10 @@ a.navbar-toggle { > } > > #header_search { >- background-color: $background-color-primary; > border-radius: 0; > border: 1px solid $background-color-primary; > display: flex; >- padding: 0 .8em; >+ padding: 0.6em; > > ul { > padding: 0; >@@ -65,7 +64,6 @@ a.navbar-toggle { > display: flex; > align-items: center; > color: white; >- background-color: $background-color-primary; > z-index: 2; > flex-grow: 1; > >@@ -97,9 +95,8 @@ a.navbar-toggle { > } > > .form-title { >- padding: 0 16px 0 0; >- background-color: $background-color-primary; >- border-radius: 0 16px 16px 0; >+ padding: 0 16px; >+ border-radius: 16px; > display: flex; > align-items: center; > justify-content: flex-end; >@@ -110,8 +107,9 @@ a.navbar-toggle { > label { > color: white; > font-weight: bold; >- margin: 0; >+ margin: 0i auto; > white-space: nowrap; >+ margin-bottom: 0; > } > } > >@@ -210,7 +208,6 @@ a.navbar-toggle { > input[type="submit"], > button[type="submit"] { > height: 31px; >- background-color: $background-color-secondary; > color: white; > border: 0; > text-shadow: unset; >@@ -256,19 +253,17 @@ a.navbar-toggle { > > li { > > > a { >- background-color: $background-color-primary; >- border: 2px solid $background-color-primary; >+ border: 2px solid; > border-radius: 0; > color: #FFF; > font-weight: normal; > line-height: 1.3; > margin: 0 .25em; >- padding: 0 .25em; >+ padding: .25em .5em; > > &:hover, &:focus, &:active { >- background-color: $background-color-primary; >- border: 2px solid $background-color-primary; >- border-bottom-color: $background-color-secondary; >+ border: 2px solid; >+ border-bottom-color: currentColor; > border-bottom: 0; > padding: 0 .25em; > text-decoration: none; >@@ -279,7 +274,7 @@ a.navbar-toggle { > a { > cursor: default; > padding: 0 .25em; >- border-bottom: 2px solid #FFF; >+ border-bottom: 2px solid currentColor !important; > > &:hover, > &:focus { >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 60264eb4bb..ee9aec3ff3 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 >@@ -3,6 +3,7 @@ > [% USE Koha %] > [% USE KohaPlugins %] > [% USE String %] >+[% USE Branches %] > [% PROCESS 'html_helpers.inc' %] > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> > <meta name="viewport" content="width=device-width, initial-scale=1" /> >@@ -52,6 +53,26 @@ var Koha = {}; > [% IF ( login ) %] > [% Asset.css("css/login.css") | $raw %] > [% END %] >+[% SET branchcolor = Branches.GetBranchColor( Branches.GetLoggedInBranchcode() ) || '#408540' %] >+<style> >+ .toptabs, >+ #header_search, >+ #header_search ul, >+ #header_search .nav-tabs > li > a { >+ background: [% branchcolor | html %] !important; >+ border-color: [% branchcolor | html %] !important; >+ } >+ >+ .form-title, #header_search button[type="submit"] { >+ background: [% branchcolor | html %] !important; >+ filter: brightness(85%); >+ } >+ >+ #header_search .nav-tabs > li > a { >+ background: [% branchcolor | html %] !important; >+ border-color: [% branchcolor | html %] !important; >+ } >+</style> > [% IF ( IntranetUserCSS ) %]<style>[% IntranetUserCSS | $raw %]</style>[% END %] > > [% KohaPlugins.get_plugins_intranet_head | $raw %] >-- >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