Main Koha release repository https://koha-community.org
Find a file
Matt Blenkinsop 82e2547e1b
Bug 32721: Add branch specific userjs and usercss
This patch allows for branch specific userJS and userCSS to be added through the libraries table. This works in conjunction with the global UserJS and UserCSS functionality and allows for multiple OPACs with different css and js options.

Test plan:
1) Add to apache conf (/etc/apache2/sites-available/kohadev.conf)
    SetEnv OPAC_BRANCH_DEFAULT "FFL"
    RequestHeader add X-Koha-SetEnv "OPAC_BRANCH_DEFAULT FFL"
2) In the container, run restart_all
3) Navigate to the OPACUserJS and OPACUserCSS system preferences and add the following: OPACUserJS - console.log('Hello from global sysprefs');, OPACUserCSS - 'body { background-color: black; }'
4) Refresh the OPAC and the background should be black and the message should be logged to the console in developer tools
5) Navigate to Administration > Libraries
6) On the Fairfield branch (if this does not exist you will need to create a branch with a code matching the code that you added to the apache conf file), click edit
7) At the bottom there should be two fields to add userjs and usercss, complete with Codemirror syntax checking
8) In userjs add console.log('Hello from branch level'); and in usercss add 'body { background-color: blue; } then save
9) Return to the OPAC and refresh
10) If you are logged out of the OPAC it should now be logging both the message from global and from the branch level and the background should be blue (if not you will need to log out)
11) Log back into the OPAC using a user that DOES NOT have a default branch matching the branch you added to the Apache conf
12) The OPAC should now revert to only showing the global message in the console with a black background

Sponsored-by: PTFS Europe

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-19 16:00:52 -03:00
acqui Bug 31631: (QA follow-up) Tidy code 2023-10-18 15:41:37 -03:00
admin
api
authorities
basket Bug 34731: Don't call SendQueuedMessages if message_id is bad 2023-09-12 09:44:59 -03:00
bin
C4
catalogue
cataloguing
circ
clubs Bug 25079: Show club enrollment question answers in staff client 2023-06-23 11:00:54 -03:00
course_reserves
debian Bug 30708: Add apache RewriteRule 2023-10-18 15:41:42 -03:00
docs Bug 34800: Adding openhub links for Koha contributors 2023-10-17 14:45:28 -03:00
erm
errors
etc
ill Bug 30719: ILL Batches 2023-10-17 14:45:15 -03:00
installer
Koha
koha-tmpl
labels
lib/CGI/Session/Serialize
members
misc Bug 34959: Sort PO files correctly 2023-10-18 10:25:56 -03:00
offline_circ Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
opac
patron_lists Bug 16446: Add ability to add patrons to list by borrowernumber 2021-10-21 12:24:04 +02:00
patroncards
plugins Bug 30367: (follow-up) Same adjustment for gitlab 2023-05-05 10:18:57 -03:00
pos
preservation
recalls Bug 34013: Recalls awaiting pickup doesn't show count on each tab 2023-06-23 10:01:04 -03:00
reports Bug 34859: Remove unnecessary params from reports-home.pl 2023-10-04 16:40:16 -04:00
reserve
reviews
rotating_collections
serials
services
skel
suggestion
svc
t Bug 35105: Regression tests 2023-10-19 16:00:49 -03:00
tags
tools Bug 26978: Add item type option to batch extend due date tool 2023-10-11 12:13:03 -03:00
virtualshelves Bug 34731: Don't call SendQueuedMessages if message_id is bad 2023-09-12 09:44:59 -03:00
xt Bug 34911: Test files from HEAD instead of 'master' 2023-10-04 09:15:35 -04:00
.editorconfig
.eslintrc.json
.gitignore
.htaccess
.mailmap
.perlcriticrc
.perltidyrc
.proverc.dist
.stylelintrc.json
about.pl
app.psgi
build-resources.PL
changelanguage.pl
cpanfile
cypress.config.ts
fix-perl-path.PL
gulpfile.js
help.pl
INSTALL
Koha.pm
koha_perl_deps.pl
kohaversion.pl
LICENSE
mainpage.pl
Makefile.PL
MANIFEST.SKIP
package.json
README Bug 9440 - update Koha's LICENSE file from GPL2 to GPL3 2013-02-12 08:52:10 -05:00
README.md
README.robots
rewrite-config.PL
tsconfig.json
webpack.config.js
yarn.lock

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo