Bug 37054 - Allow for custom branch colors in the staff interface header search
Summary: Allow for custom branch colors in the staff interface header search
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 37067
  Show dependency treegraph
 
Reported: 2024-06-07 16:02 UTC by Lucas Gass
Modified: 2024-06-11 11:00 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 37054: DBUpdate (2.14 KB, patch)
2024-06-07 16:17 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 37054: DO NOT PUSH - Schema updates (1.40 KB, patch)
2024-06-07 16:21 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 37054: Add branch color to branches.tt (2.44 KB, patch)
2024-06-07 17:05 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 37054: Adjust header colors if branches.branchcolor is used (5.66 KB, patch)
2024-06-07 22:06 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 37054: DBUpdate (2.19 KB, patch)
2024-06-08 23:21 UTC, David Nind
Details | Diff | Splinter Review
Bug 37054: DO NOT PUSH - Schema updates (1.44 KB, patch)
2024-06-08 23:21 UTC, David Nind
Details | Diff | Splinter Review
Bug 37054: Add branch color to branches.tt (2.49 KB, patch)
2024-06-08 23:21 UTC, David Nind
Details | Diff | Splinter Review
Bug 37054: Adjust header colors if branches.branchcolor is used (5.71 KB, patch)
2024-06-08 23:21 UTC, David Nind
Details | Diff | Splinter Review
Bug 37054: (follow-up) Simplify changes, add a way to clear the color field (7.21 KB, patch)
2024-06-10 17:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37054: DBUpdate (2.19 KB, patch)
2024-06-10 19:21 UTC, David Nind
Details | Diff | Splinter Review
Bug 37054: DO NOT PUSH - Schema updates (1.44 KB, patch)
2024-06-10 19:21 UTC, David Nind
Details | Diff | Splinter Review
Bug 37054: Add branch color to branches.tt (2.49 KB, patch)
2024-06-10 19:21 UTC, David Nind
Details | Diff | Splinter Review
Bug 37054: Adjust header colors if branches.branchcolor is used (5.71 KB, patch)
2024-06-10 19:22 UTC, David Nind
Details | Diff | Splinter Review
Bug 37054: (follow-up) Simplify changes, add a way to clear the color field (7.26 KB, patch)
2024-06-10 19:22 UTC, David Nind
Details | Diff | Splinter Review
Bug 37054: (follow-up) Remove some unneeded SCSS and ajust button brightness (1.79 KB, patch)
2024-06-10 22:55 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 37054: (follow-up) Remove some unneeded SCSS and ajust button brightness (1.83 KB, patch)
2024-06-11 11:00 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2024-06-07 16:02:14 UTC
The staff interface includes a green bar at the top of almost every page, #header_search.toptab

I have been writing custom JavaScript to color this bar differently per branch. It would be much nice if you could just do this in Koha without JS.
Comment 1 Lucas Gass 2024-06-07 16:17:15 UTC Comment hidden (obsolete)
Comment 2 Lucas Gass 2024-06-07 16:21:10 UTC Comment hidden (obsolete)
Comment 3 Lucas Gass 2024-06-07 17:05:45 UTC Comment hidden (obsolete)
Comment 4 Lucas Gass 2024-06-07 22:06:47 UTC Comment hidden (obsolete)
Comment 5 David Nind 2024-06-08 23:21:00 UTC
Created attachment 167595 [details] [review]
Bug 37054: DBUpdate

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2024-06-08 23:21:02 UTC
Created attachment 167596 [details] [review]
Bug 37054: DO NOT PUSH - Schema updates

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2024-06-08 23:21:05 UTC
Created attachment 167597 [details] [review]
Bug 37054: Add branch color to branches.tt

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2024-06-08 23:21:07 UTC
Created attachment 167598 [details] [review]
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.

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 Owen Leonard 2024-06-10 17:13:03 UTC
Created attachment 167609 [details] [review]
Bug 37054: (follow-up) Simplify changes, add a way to clear the color field

This patch cuts some of the CSS changes which I think were unnecessary
and adds a way for the user to clear the color field. A text input now
shows the selected hex colur value and the "Clear" button clears it.

I've changed the way the patch handles the custom colors by making the
color handling  dependent on there being a branchcolor value. This way
we don't have to alter the existing header CSS, just override it if a
custom color has been chosen.

To test, apply the patch and test that the color picker still works
correctly and that the "Clear" button works to empty the field.

Test the appearance of the search bar in a branch with a custom color
and in a branch without.
Comment 10 David Nind 2024-06-10 19:21:52 UTC
Created attachment 167612 [details] [review]
Bug 37054: DBUpdate

Signed-off-by: David Nind <david@davidnind.com>
Comment 11 David Nind 2024-06-10 19:21:55 UTC
Created attachment 167613 [details] [review]
Bug 37054: DO NOT PUSH - Schema updates

Signed-off-by: David Nind <david@davidnind.com>
Comment 12 David Nind 2024-06-10 19:21:58 UTC
Created attachment 167614 [details] [review]
Bug 37054: Add branch color to branches.tt

Signed-off-by: David Nind <david@davidnind.com>
Comment 13 David Nind 2024-06-10 19:22:00 UTC
Created attachment 167615 [details] [review]
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.

Signed-off-by: David Nind <david@davidnind.com>
Comment 14 David Nind 2024-06-10 19:22:03 UTC
Created attachment 167616 [details] [review]
Bug 37054: (follow-up) Simplify changes, add a way to clear the color field

This patch cuts some of the CSS changes which I think were unnecessary
and adds a way for the user to clear the color field. A text input now
shows the selected hex colur value and the "Clear" button clears it.

I've changed the way the patch handles the custom colors by making the
color handling  dependent on there being a branchcolor value. This way
we don't have to alter the existing header CSS, just override it if a
custom color has been chosen.

To test, apply the patch and test that the color picker still works
correctly and that the "Clear" button works to empty the field.

Test the appearance of the search bar in a branch with a custom color
and in a branch without.

Signed-off-by: David Nind <david@davidnind.com>
Comment 15 Lucas Gass 2024-06-10 22:54:07 UTC
Thank you Owen! I am going to propose 2 changes:

1. I don't like that the background color of the links still changes to green when a custom color is set. In my opinion we don't need to set the background color on hover. I think that rule can be removed for the header.scss file. 

2. Can we turn the filter brightness down just a bit on the '#header_search button[type="submit"]' btn? And then turn it up a bit when hovering on that element?
Comment 16 Lucas Gass 2024-06-10 22:55:47 UTC
Created attachment 167618 [details] [review]
Bug 37054: (follow-up) Remove some unneeded SCSS and ajust button brightness
Comment 17 Owen Leonard 2024-06-11 11:00:04 UTC
Created attachment 167625 [details] [review]
Bug 37054: (follow-up) Remove some unneeded SCSS and ajust button brightness

Signed-off-by: Owen Leonard <oleonard@myacpl.org>