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.
Created attachment 167577 [details] [review] Bug 37054: DBUpdate
Created attachment 167578 [details] [review] Bug 37054: DO NOT PUSH - Schema updates
Created attachment 167579 [details] [review] Bug 37054: Add branch color to branches.tt
Created attachment 167590 [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.
Created attachment 167595 [details] [review] Bug 37054: DBUpdate Signed-off-by: David Nind <david@davidnind.com>
Created attachment 167596 [details] [review] Bug 37054: DO NOT PUSH - Schema updates Signed-off-by: David Nind <david@davidnind.com>
Created attachment 167597 [details] [review] Bug 37054: Add branch color to branches.tt Signed-off-by: David Nind <david@davidnind.com>
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>
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.
Created attachment 167612 [details] [review] Bug 37054: DBUpdate Signed-off-by: David Nind <david@davidnind.com>
Created attachment 167613 [details] [review] Bug 37054: DO NOT PUSH - Schema updates Signed-off-by: David Nind <david@davidnind.com>
Created attachment 167614 [details] [review] Bug 37054: Add branch color to branches.tt Signed-off-by: David Nind <david@davidnind.com>
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>
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>
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?
Created attachment 167618 [details] [review] Bug 37054: (follow-up) Remove some unneeded SCSS and ajust button brightness
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>
This looks great!
Please rebase!
Created attachment 171221 [details] [review] Bug 37054: DBUpdate Signed-off-by: David Nind <david@davidnind.com>
Created attachment 171222 [details] [review] Bug 37054: DO NOT PUSH - Schema updates Signed-off-by: David Nind <david@davidnind.com>
Created attachment 171223 [details] [review] Bug 37054: Add branch color to branches.tt Signed-off-by: David Nind <david@davidnind.com>
Created attachment 171224 [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>
Created attachment 171225 [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>
Created attachment 171226 [details] [review] Bug 37054: (follow-up) Remove some unneeded SCSS and ajust button brightness Signed-off-by: Owen Leonard <oleonard@myacpl.org>
rebased for current main