[Bug 39538] New: Replace UserCSS system preference with snippets
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Bug ID: 39538 Summary: Replace UserCSS system preference with snippets Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: lisette@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Currently the UserCSS's are just a big blob of CSS with each piece unrelated to the next. It would be nice if we replaced the system preference with individual "snippets". These could live somewhere like HTML customizations. This would bring more organization to CSS customization. It could also allow staff to see how created/edited/deleted certain blocks much easier. It could also make it easier to incorporate different permission checks for who can create/edit/delete CSS Similar to Bug 38706. This could also be helpful for adding CSS to Mana eventually? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38706 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Marion Durand <marion.durand@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marion.durand@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Katie Bliss <kebliss@dmpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kebliss@dmpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lisette@bywatersolutions.co |ity.org |m -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #1 from Lisette Scheer <lisette@bywatersolutions.com> --- I put some information on Bug 38706 about my plans for the snippets https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38706#c16 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Sally <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |roadmap_25_11 Depends on| |38706 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38706 [Bug 38706] Replace UserJS system preference with snippets -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Arturo <library@sll.texas.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |library@sll.texas.gov -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38706 Depends on|38706 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38706 [Bug 38706] Replace UserJS system preference with snippets -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Large patch --- Comment #3 from Lisette Scheer <lisette@bywatersolutions.com> --- There are 4 fewer system preferences (IntranetUserCSS, OPACUserCSS, SelfCheckInCSS, SelfCheckOutCSS) which are ported to the new snippets, as well as removing the branch specific CSS from libraries as it can now be set at the branch level in additional contents. Adding the diff for the log for ACTN1 coding guideline added the diff for all the additional contents. I did allow for localaization because I could see an instance in which you might want different css for different languages (or JS when I get to that in another bug). There's a new user permission to edit_css_snippets Test plan: ---BEFORE APPLYING PATCH--- 1. Go to administration and search for usercss For each setting put some code, I provide examples: - SelfCheckInUserCSS body { background-color: oklch(0.6009 0.1184 31.76); } - SCOUserCSS body { background-color: oklch(0.7 0.1 233); } - OPACUserCSS body { background-color: oklch(0.7 0.1357 350.47); } - IntranetUserCSS body { background-color: oklch(0.4199 0.1505 292.24); } 2. Set WebBasedSelfCheck to 'Enable' and SCOAllowCheckin to 'Allow' and 'AdditionalContentsLog' to on 3. Go to opac url/cgi-bin/koha/sco/sco-main.pl - Observe a blue background 4. Go to opac url/cgi-bin/koha/sci/sci-main.pl - Observe a reddish-orange background 5. go to the opac - Observe a pink background 6. Reload the staff interface - Observe a purple background 7. Go to Administration->Libraries, edit the library you're logged in as and add css: body { background-color: oklch(0.82 0.1184 139.76); } 8. Go back to the opac, log in as koha/koha - Observe a green background 9. Apply the patch Rebuild the database, yarn build, restart all 10. Search the system preferences for usercss, there should be no results. 11. Go to administration->libraries->edit the library you edited before, there should be no CSS field. 12. Go to Tools->CSS Snippets. There should be 5 snippets, | Location | Library | Number | Publication date | Title | | -------------- | ------------ | ------ | ---------------- | --------------- | | StaffCSS | All | 1 | Today's date | IntranetUserCSS | | OPACCSS | All | 1 | Today's date | OPACUserCSS | | SelfCheckInCSS | All | 1 | Today's date | SelfCheckInCSS | | SelfCheckOutCSS| All | 1 | Today's date | SelfCheckOutCSS | | OPACCSS | Your library | 2 | Today's date | ?? | 13. Repeat steps 3-6 and step 9, the colors should all be the same as before. 14. Open the preview of the snippet, you should see that there is a non-editable version of the editor, including highlighting and linting. 15. Delete a snippet 16. Change a snippet 17. Go to the logs and filter on the Additional Contents. Observe the difference between the first ones (old info column) vs the new json format. 18. In column settings, show the diff column. Observe the before and after comparison 19. In the top right of the interface, click the bug and turn off CSS, it should work on all staff CSS Permissions testing: 1. Set up a patron (I used 23529000035676) with permission to log into the catalog and to edit css snippets. Change their username and password so you can log in as them. 2. In another browser or private window, log in as the second user 3. Confirm you can add, edit, and delete the snippets and do nothing else in Tools. 4. As the superuser, change it so they can edit news, but not snippets. 5. As the secondary user, go to edit news and confirm you can't edit snippets anymore. Current status: ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #4 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210241 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210241&action=edit Bug 39538: Replace UserCSS system preferences with snippets This patch adds the new CSS snippets tool to the additional contents and removes the system preferences and branch CSS. There are 4 fewer system preferences (IntranetUserCSS, OPACUserCSS, SCOUserCSS, SelfCheckInUserCSS) which are ported to the new snippets (StaffCSS, OPACCSS, SelfCheckOutCSS, SelfCheckInCSS), as well as removing the branch specific CSS from libraries as it can now be set at the branch level in additional contents. Adding the diff for the log for the ACTN1 coding guideline added the diff for all the additional contents. I did allow for localization because I could see an instance in which you might want different CSS for different languages (or JS when I get to that in another bug). There's a new user permission: edit_css_snippets Test plan: ---BEFORE APPLYING PATCH--- 1. Go to administration and search for usercss For each setting put some code, I provide examples: - SelfCheckInUserCSS body { background-color: oklch(0.6009 0.1184 31.76); } - SCOUserCSS body { background-color: oklch(0.7 0.1 233); } - OPACUserCSS body { background-color: oklch(0.7 0.1357 350.47); } - IntranetUserCSS body { background-color: oklch(0.4199 0.1505 292.24); } 2. Set WebBasedSelfCheck to 'Enable', SelfCheckInModule to 'Enable' and AdditionalContentLog to 'Log' 3. Go to opac url/cgi-bin/koha/sco/sco-main.pl - Observe a blue background 4. Go to opac url/cgi-bin/koha/sci/sci-main.pl and log in as koha/koha - Observe a reddish-orange background 5. Go to the OPAC - Observe a pink background 6. Reload the staff interface - Observe a purple background 7. Go to Administration->Libraries, edit the library you're logged in as and add CSS: body { background-color: oklch(0.82 0.1184 139.76); } 8. Go back to the OPAC, log in as koha/koha - Observe a green background ---APPLY PATCH--- 9. Apply the patch Update the database, yarn build, restart all 10. Search the system preferences for usercss, there should be no results. 11. Go to Administration->Libraries->edit the library you edited before, there should be no CSS field. 12. Go to Tools->CSS snippets. There should be 5 snippets: | Location | Library | Position | Publication date | Title | | --------------- | ------------ | -------- | ---------------- | ------------------------- | | StaffCSS | All | 1 | Today's date | IntranetUserCSS | | OPACCSS | All | 1 | Today's date | OPACUserCSS | | SelfCheckInCSS | All | 1 | Today's date | SelfCheckInUserCSS | | SelfCheckOutCSS | All | 1 | Today's date | SCOUserCSS | | OPACCSS | Your library | 2 | Today's date | Library specific OPAC CSS | 13. Repeat steps 3-6 and step 8, the colors should all be the same as before. 14. Open the preview of a snippet, you should see a non-editable version of the editor, including highlighting and linting. 15. Delete a snippet 16. Change a snippet 17. Go to the logs and filter on Additional content. Observe the difference between the first ones (old info column) vs the new JSON format. 18. In column settings, show the diff column. Observe the before and after comparison. 19. In the top right of the staff interface, click the bug icon and turn off custom CSS, it should remove all the CSS snippets. Permissions testing: 1. Set up a patron (I used 23529000035676) with permission to log into the staff interface and to edit CSS snippets (tools > edit_css_snippets). Change their username and password so you can log in as them. 2. In another browser or private window, log in as the second user 3. Confirm you can add, edit, and delete the snippets and do nothing else in Tools. 4. As the superlibrarian, change it so they can edit news (edit_additional_contents), but not snippets. 5. As the second user, confirm you can edit news but can no longer access the CSS snippets. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #5 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210242 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210242&action=edit Bug 39538: Change templates and includes to load the new snippets This patch maches the template changes to load the new snippets instead of the old system preferences. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #6 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210243 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210243&action=edit Bug 39538: Remove CSS preferences from Auth This patch removes the CSS preferences from Auth.pm as they are no longer system preferences. It also updates the css debug title. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #7 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210244 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210244&action=edit Bug 39538: Add unit tests This patch adds/updates unit tests. To test: prove t/db_dependent/Auth.t prove t/db_dependent/Koha/AdditionalContents.t prove t/db_dependent/Template/Plugin/AdditionalContents.t prove t/db_dependent/Template/Plugin/Branches.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Used for scaffolding unit tests and identifying all impacted tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #8 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210245 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210245&action=edit Bug 39538: Atomic update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement introduces release notes| |a new 'snippets' system | |into the additional | |contents to replace the CSS | |system preferences, -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #10 from Lisette Scheer <lisette@bywatersolutions.com> --- This patch adds a tooltip for clarifying the position order. The order of the CSS is always: 1. All libraries - Priority 1 - Priority 2 etc - No priority 2. Branch specific - Priority 1 - Priority 2 etc - No priority If the same selector is called in multiple snippets, the one that's loaded last is the one that 'wins'. This is because of how CSS ordering works. To test: 1. Go to tools->CSS Snippets 2. Add a new snippet - Observe the tooltip 3. Save, then edit the snippet - Observe the tooltip 4. Edit a news item, observe the position tooltip is gone. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #11 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210253 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210253&action=edit Bug 39538: (follow-up) Add a tooltip for positioning The order of the CSS is always: 1. All libraries - Priority 1 - Priority 2 etc - No priority 2. Branch specific - Priority 1 - Priority 2 etc - No priority If the same selector is called in multiple snippets, the last one is what actually loads. This patch adds a tooltip to note the order. To test, apply and observe the tooltip while adding or editing a new snippet. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #12 from Lisette Scheer <lisette@bywatersolutions.com> --- This patch fixes the double logging because of logging translations. Additionally it improves the info and comparison formatting and restores the compare checkbox functionality. To test: 1. Turn on Additional Content logging ( AdditionalContentLog ) in the system preferences 2. Go to Tools-> CSS snippets 3. Add a new snippet 4. Edit the snippet 5. Edit the snippet again 6. Delete the snippet 7. Add another new snippet 8. Go to Tools->Log viewer, uncheck 'All' under modules and select additional content, then Submit 9. Show the diff column, observe how both the diff and Info columns look. - In the info column, click the 'Show content' arrow, this is collapsed to keep the log generally readable. 10. Click the compare on one of the entries for your first snippet, observe the last 'Add' is filtered out. 11. Select another one to compare and select 'View comparison' and observe the formatting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #13 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210256 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210256&action=edit Bug 39538: (follow-up) Fix logging display and double logging This patch fixes the double logging because of logging translations. Additionally it improves the info and comparison formatting and restores the compare checkbox functionality. To test: 1. Turn on Additional Content logging ( AdditionalContentLog ) in the system preferences 2. Go to Tools-> CSS snippets 3. Add a new snippet 4. Edit the snippet 5. Edit the snippet again 6. Delete the snippet 7. Add another new snippet 8. Go to Tools->Log viewer, uncheck 'All' under modules and select additional content, then Submit 9. Show the diff column, observe how both the diff and Info columns look. - In the info column, click the 'Show content' arrow, this is collapsed to keep the log generally readable. 10. Click the compare on one of the entries for your first snippet, observe the last 'Add' is filtered out. 11. Select another one to compare and select 'View comparison' and observe the formatting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancement introduces |This enhancment moves the release notes|a new 'snippets' system |custom CSS out of the |into the additional |system preferences and |contents to replace the CSS |branch pages into |system preferences, |Tools->CSS Snippets. | | | |The following system | |preferences are removed and | |their contents are imported | |as new snippets for all | |libraries. | |- `IntranetUserCSS` | |- `OPACUserCSS` | |- `SelfCheckInUserCSS` | |- `SCOUserCSS` | | | |The `Specific OPAC CSS` is | |also removed from branches | |and imported as library | |specific snippets. | | | |A new permission is added: | |`edit_css_snippets` | | | |Moving these options to the | |Additional Contents | |framework allows for some | |new options: | |- Branch specific CSS for | |all location for CSS | |- Scheduling of CSS with | |publication and expiration | |dates | | | |The order of the CSS is | |always: | |1. All libraries | | - Priority 1 | | - Priority 2 etc | | - No priority | |2. Branch specific | | - Priority 1 | | - Priority 2 etc | | - No priority | | | |Higher positions load later | |and take precedence; | |snippets with no position | |load last. | | | |Updating logging for | |Additional Contents to | |handle snippets also | |resulted in adding the diff | |to all additional contents. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210256|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #14 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210299 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210299&action=edit Bug 39538: (follow-up) Fix logging display and double logging This patch fixes the double logging because of logging translations. Additionally it improves the info and comparison formatting and restores the compare checkbox functionality. To test: 1. Turn on Additional Content logging ( AdditionalContentLog ) in the system preferences 2. Go to Tools-> CSS snippets 3. Add a new snippet 4. Edit the snippet 5. Edit the snippet again 6. Delete the snippet 7. Add another new snippet 8. Go to Tools->Log viewer, uncheck 'All' under modules and select additional content, then Submit 9. Show the diff column, observe how both the diff and Info columns look. - In the info column, click the 'Show content' arrow, this is collapsed to keep the log generally readable. 10. Click the compare on one of the entries for your first snippet, observe the last 'Add' is filtered out. 11. Select another one to compare and select 'View comparison' and observe the formatting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #15 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210300 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210300&action=edit Bug 39538: (follow-up) Clarify the CSS snippets position field This patch labels the position field "Order of snippets" for CSS snippets, other additional contents keep "Appear in position", and rewords the tooltip explaining in which order the snippets load. Storing a 0 position as no position is handled by bug 43988. To test: 1. Go to Tools -> CSS snippets and add or edit a snippet 2. The position field is labelled "Order of snippets", hover the info icon next to it and read the tooltip 3. Go to Tools -> News and add or edit a news item 4. The position field is labelled "Appear in position" and has no tooltip Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43988 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43988 [Bug 43988] Setting an additional contents number/position to 0 isn't handled consistently -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancment moves the |This enhancement moves the release notes|custom CSS out of the |custom CSS out of the |system preferences and |system preferences and |branch pages into |branch pages into |Tools->CSS Snippets. |Tools->CSS Snippets. | | |The following system |The following system |preferences are removed and |preferences are removed and |their contents are imported |their contents are imported |as new snippets for all |as new snippets for all |libraries. |libraries. |- `IntranetUserCSS` |- `IntranetUserCSS` |- `OPACUserCSS` |- `OPACUserCSS` |- `SelfCheckInUserCSS` |- `SelfCheckInUserCSS` |- `SCOUserCSS` |- `SCOUserCSS` | | |The `Specific OPAC CSS` is |The `Specific OPAC CSS` is |also removed from branches |also removed from branches |and imported as library |and imported as library |specific snippets. |specific snippets. | | |A new permission is added: |A new permission is added: |`edit_css_snippets` |`edit_css_snippets` | | |Moving these options to the |Moving these options to the |Additional Contents |Additional Contents |framework allows for some |framework allows for some |new options: |new options: |- Branch specific CSS for |- Branch specific CSS for |all location for CSS |all location for CSS |- Scheduling of CSS with |- Scheduling of CSS with |publication and expiration |publication and expiration |dates |dates | | |The order of the CSS is |The order of the CSS is |always: |always: |1. All libraries |1. All libraries | - Priority 1 | - Priority 1 | - Priority 2 etc | - Priority 2 etc | - No priority | - No priority |2. Branch specific |2. Branch specific | - Priority 1 | - Priority 1 | - Priority 2 etc | - Priority 2 etc | - No priority | - No priority | | |Higher positions load later |Snippets load in ascending |and take precedence; |number order, then the ones |snippets with no position |without a position. When |load last. |snippets conflict, the one | |loaded last takes |Updating logging for |precedence. |Additional Contents to | |handle snippets also |Updating logging for |resulted in adding the diff |Additional Contents to |to all additional contents. |handle snippets also | |resulted in adding the diff | |to all additional contents. | | | |The CSS inline stylesheet | |will list the id of the | |snippet, the title, | |location, and library: | | | |``` | |/* CSS snippet 1: Checking | |again (location: StaffCSS, | |library: all) */ | |body { | | background-color: pink; | |} | |/* CSS snippet 2: new | |(location: StaffCSS, | |library: CPL) */ | |body { | | background-color: white; | |} | |``` -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|25.11 |27.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210241|0 |1 is obsolete| | Attachment #210242|0 |1 is obsolete| | Attachment #210243|0 |1 is obsolete| | Attachment #210244|0 |1 is obsolete| | Attachment #210245|0 |1 is obsolete| | Attachment #210253|0 |1 is obsolete| | Attachment #210299|0 |1 is obsolete| | Attachment #210300|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #16 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210364 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210364&action=edit Bug 39538: Replace UserCSS system preferences with snippets This patch adds the new CSS snippets tool to the additional contents and removes the system preferences and branch CSS. There are 4 fewer system preferences (IntranetUserCSS, OPACUserCSS, SCOUserCSS, SelfCheckInUserCSS) which are ported to the new snippets (StaffCSS, OPACCSS, SelfCheckOutCSS, SelfCheckInCSS), as well as removing the branch specific CSS from libraries as it can now be set at the branch level in additional contents. Adding the diff for the log for the ACTN1 coding guideline added the diff for all the additional contents. I did allow for localization because I could see an instance in which you might want different CSS for different languages (or JS when I get to that in another bug). There's a new user permission: edit_css_snippets Test plan: ---BEFORE APPLYING PATCH--- 1. Go to administration and search for usercss For each setting put some code, I provide examples: - SelfCheckInUserCSS body { background-color: oklch(0.6009 0.1184 31.76); } - SCOUserCSS body { background-color: oklch(0.7 0.1 233); } - OPACUserCSS body { background-color: oklch(0.7 0.1357 350.47); } - IntranetUserCSS body { background-color: oklch(0.4199 0.1505 292.24); } 2. Set WebBasedSelfCheck to 'Enable', SelfCheckInModule to 'Enable' and AdditionalContentLog to 'Log' 3. Go to opac url/cgi-bin/koha/sco/sco-main.pl - Observe a blue background 4. Go to opac url/cgi-bin/koha/sci/sci-main.pl and log in as koha/koha - Observe a reddish-orange background 5. Go to the OPAC - Observe a pink background 6. Reload the staff interface - Observe a purple background 7. Go to Administration->Libraries, edit the library you're logged in as and add CSS: body { background-color: oklch(0.82 0.1184 139.76); } 8. Go back to the OPAC, log in as koha/koha - Observe a green background ---APPLY PATCH--- 9. Apply the patch Update the database, yarn build, restart all 10. Search the system preferences for usercss, there should be no results. 11. Go to Administration->Libraries->edit the library you edited before, there should be no CSS field. 12. Go to Tools->CSS snippets. There should be 5 snippets: | Location | Library | Position | Publication date | Title | | --------------- | ------------ | -------- | ---------------- | ------------------------- | | StaffCSS | All | 1 | Today's date | IntranetUserCSS | | OPACCSS | All | 1 | Today's date | OPACUserCSS | | SelfCheckInCSS | All | 1 | Today's date | SelfCheckInUserCSS | | SelfCheckOutCSS | All | 1 | Today's date | SCOUserCSS | | OPACCSS | Your library | 2 | Today's date | Library specific OPAC CSS | 13. Repeat steps 3-6 and step 8, the colors should all be the same as before. 14. Open the preview of a snippet, you should see a non-editable version of the editor, including highlighting and linting. 15. Delete a snippet 16. Change a snippet 17. Go to the logs and filter on Additional content. Observe the difference between the first ones (old info column) vs the new JSON format. 18. In column settings, show the diff column. Observe the before and after comparison. 19. In the top right of the staff interface, click the bug icon and turn off custom CSS, it should remove all the CSS snippets. Permissions testing: 1. Set up a patron (I used 23529000035676) with permission to log into the staff interface and to edit CSS snippets (tools > edit_css_snippets). Change their username and password so you can log in as them. 2. In another browser or private window, log in as the second user 3. Confirm you can add, edit, and delete the snippets and do nothing else in Tools. 4. As the superlibrarian, change it so they can edit news (edit_additional_contents), but not snippets. 5. As the second user, confirm you can edit news but can no longer access the CSS snippets. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #17 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210365 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210365&action=edit Bug 39538: Change templates and includes to load the new snippets This patch maches the template changes to load the new snippets instead of the old system preferences. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #18 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210366 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210366&action=edit Bug 39538: Remove CSS preferences from Auth This patch removes the CSS preferences from Auth.pm as they are no longer system preferences. It also updates the css debug title. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #19 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210367 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210367&action=edit Bug 39538: Add unit tests This patch adds/updates unit tests. To test: prove t/db_dependent/Auth.t prove t/db_dependent/Koha/AdditionalContents.t prove t/db_dependent/Template/Plugin/AdditionalContents.t prove t/db_dependent/Template/Plugin/Branches.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Used for scaffolding unit tests and identifying all impacted tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #20 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210368 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210368&action=edit Bug 39538: Atomic update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #21 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210369 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210369&action=edit Bug 39538: (follow-up) Add a tooltip for positioning The order of the CSS is always: 1. All libraries - Priority 1 - Priority 2 etc - No priority 2. Branch specific - Priority 1 - Priority 2 etc - No priority If the same selector is called in multiple snippets, the last one is what actually loads. This patch adds a tooltip to note the order. To test, apply and observe the tooltip while adding or editing a new snippet. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #22 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210370 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210370&action=edit Bug 39538: (follow-up) Fix logging display and double logging This patch fixes the double logging because of logging translations. Additionally it improves the info and comparison formatting and restores the compare checkbox functionality. To test: 1. Turn on Additional Content logging ( AdditionalContentLog ) in the system preferences 2. Go to Tools-> CSS snippets 3. Add a new snippet 4. Edit the snippet 5. Edit the snippet again 6. Delete the snippet 7. Add another new snippet 8. Go to Tools->Log viewer, uncheck 'All' under modules and select additional content, then Submit 9. Show the diff column, observe how both the diff and Info columns look. - In the info column, click the 'Show content' arrow, this is collapsed to keep the log generally readable. 10. Click the compare on one of the entries for your first snippet, observe the last 'Add' is filtered out. 11. Select another one to compare and select 'View comparison' and observe the formatting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #23 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210371 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210371&action=edit Bug 39538: (follow-up) Clarify the CSS snippets position field This patch labels the position field "Order of snippets" for CSS snippets, other additional contents keep "Appear in position", and rewords the tooltip explaining in which order the snippets load. Storing a 0 position as no position is handled by bug 43988. To test: 1. Go to Tools -> CSS snippets and add or edit a snippet 2. The position field is labelled "Order of snippets", hover the info icon next to it and read the tooltip 3. Go to Tools -> News and add or edit a news item 4. The position field is labelled "Appear in position" and has no tooltip Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210364|0 |1 is obsolete| | Attachment #210365|0 |1 is obsolete| | Attachment #210366|0 |1 is obsolete| | Attachment #210367|0 |1 is obsolete| | Attachment #210368|0 |1 is obsolete| | Attachment #210369|0 |1 is obsolete| | Attachment #210370|0 |1 is obsolete| | Attachment #210371|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #24 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210409 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210409&action=edit Bug 39538: Replace UserCSS system preferences with snippets This patch adds the new CSS snippets tool to the additional contents and removes the system preferences and branch CSS. There are 4 fewer system preferences (IntranetUserCSS, OPACUserCSS, SCOUserCSS, SelfCheckInUserCSS) which are ported to the new snippets (StaffCSS, OPACCSS, SelfCheckOutCSS, SelfCheckInCSS), as well as removing the branch specific CSS from libraries as it can now be set at the branch level in additional contents. Adding the diff for the log for the ACTN1 coding guideline added the diff for all the additional contents. I did allow for localization because I could see an instance in which you might want different CSS for different languages (or JS when I get to that in another bug). There's a new user permission: edit_css_snippets Test plan: ---BEFORE APPLYING PATCH--- 1. Go to administration and search for usercss For each setting put some code, I provide examples: - SelfCheckInUserCSS body { background-color: oklch(0.6009 0.1184 31.76); } - SCOUserCSS body { background-color: oklch(0.7 0.1 233); } - OPACUserCSS body { background-color: oklch(0.7 0.1357 350.47); } - IntranetUserCSS body { background-color: oklch(0.4199 0.1505 292.24); } 2. Set WebBasedSelfCheck to 'Enable', SelfCheckInModule to 'Enable' and AdditionalContentLog to 'Log' 3. Go to opac url/cgi-bin/koha/sco/sco-main.pl - Observe a blue background 4. Go to opac url/cgi-bin/koha/sci/sci-main.pl and log in as koha/koha - Observe a reddish-orange background 5. Go to the OPAC - Observe a pink background 6. Reload the staff interface - Observe a purple background 7. Go to Administration->Libraries, edit the library you're logged in as and add CSS: body { background-color: oklch(0.82 0.1184 139.76); } 8. Go back to the OPAC, log in as koha/koha - Observe a green background ---APPLY PATCH--- 9. Apply the patch Update the database, yarn build, restart all 10. Search the system preferences for usercss, there should be no results. 11. Go to Administration->Libraries->edit the library you edited before, there should be no CSS field. 12. Go to Tools->CSS snippets. There should be 5 snippets: | Location | Library | Position | Publication date | Title | | --------------- | ------------ | -------- | ---------------- | ------------------------- | | StaffCSS | All | 1 | Today's date | IntranetUserCSS | | OPACCSS | All | 1 | Today's date | OPACUserCSS | | SelfCheckInCSS | All | 1 | Today's date | SelfCheckInUserCSS | | SelfCheckOutCSS | All | 1 | Today's date | SCOUserCSS | | OPACCSS | Your library | 2 | Today's date | Library specific OPAC CSS | 13. Repeat steps 3-6 and step 8, the colors should all be the same as before. 14. Open the preview of a snippet, you should see a non-editable version of the editor, including highlighting and linting. 15. Delete a snippet 16. Change a snippet 17. Go to the logs and filter on Additional content. Observe the difference between the first ones (old info column) vs the new JSON format. 18. In column settings, show the diff column. Observe the before and after comparison. 19. In the top right of the staff interface, click the bug icon and turn off custom CSS, it should remove all the CSS snippets. Permissions testing: 1. Set up a patron (I used 23529000035676) with permission to log into the staff interface and to edit CSS snippets (tools > edit_css_snippets). Change their username and password so you can log in as them. 2. In another browser or private window, log in as the second user 3. Confirm you can add, edit, and delete the snippets and do nothing else in Tools. 4. As the superlibrarian, change it so they can edit news (edit_additional_contents), but not snippets. 5. As the second user, confirm you can edit news but can no longer access the CSS snippets. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #25 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210410 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210410&action=edit Bug 39538: Change templates and includes to load the new snippets This patch maches the template changes to load the new snippets instead of the old system preferences. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #26 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210411 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210411&action=edit Bug 39538: Remove CSS preferences from Auth This patch removes the CSS preferences from Auth.pm as they are no longer system preferences. It also updates the css debug title. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #27 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210412 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210412&action=edit Bug 39538: Add unit tests This patch adds/updates unit tests. To test: prove t/db_dependent/Auth.t prove t/db_dependent/Koha/AdditionalContents.t prove t/db_dependent/Template/Plugin/AdditionalContents.t prove t/db_dependent/Template/Plugin/Branches.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Used for scaffolding unit tests and identifying all impacted tests. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #28 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210413 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210413&action=edit Bug 39538: Atomic update Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #29 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210414 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210414&action=edit Bug 39538: (follow-up) Add a tooltip for positioning The order of the CSS is always: 1. All libraries - Priority 1 - Priority 2 etc - No priority 2. Branch specific - Priority 1 - Priority 2 etc - No priority If the same selector is called in multiple snippets, the last one is what actually loads. This patch adds a tooltip to note the order. To test, apply and observe the tooltip while adding or editing a new snippet. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #30 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210415 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210415&action=edit Bug 39538: (follow-up) Fix logging display and double logging This patch fixes the double logging because of logging translations. Additionally it improves the info and comparison formatting and restores the compare checkbox functionality. To test: 1. Turn on Additional Content logging ( AdditionalContentLog ) in the system preferences 2. Go to Tools-> CSS snippets 3. Add a new snippet 4. Edit the snippet 5. Edit the snippet again 6. Delete the snippet 7. Add another new snippet 8. Go to Tools->Log viewer, uncheck 'All' under modules and select additional content, then Submit 9. Show the diff column, observe how both the diff and Info columns look. - In the info column, click the 'Show content' arrow, this is collapsed to keep the log generally readable. 10. Click the compare on one of the entries for your first snippet, observe the last 'Add' is filtered out. 11. Select another one to compare and select 'View comparison' and observe the formatting Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #31 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210416 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210416&action=edit Bug 39538: (follow-up) Clarify the CSS snippets position field This patch labels the position field "Order of snippets" for CSS snippets, other additional contents keep "Appear in position", and rewords the tooltip explaining in which order the snippets load. Storing a 0 position as no position is handled by bug 43988. To test: 1. Go to Tools -> CSS snippets and add or edit a snippet 2. The position field is labelled "Order of snippets", hover the info icon next to it and read the tooltip 3. Go to Tools -> News and add or edit a news item 4. The position field is labelled "Appear in position" and has no tooltip Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #32 from Lisette Scheer <lisette@bywatersolutions.com> --- Translations ended up being more complicated than expected, so I've removed the tabs. I've also made content a required field for snippets as leaving them blank inserted an html comment that broke the css when it loaded. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #33 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210532 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210532&action=edit Bug 39538: (follow-up) Require CSS snippet content and remove translations CSS snippets could be saved with empty or whitespace-only content, which adds nothing to the page. They also showed a tab for each language, but only the default content of a snippet is used, so CSS entered in another language tab was saved and silently ignored. This patch: - Marks the content of a CSS snippet as required, and prevents saving when it is empty or only whitespace, both in the form and in tools/additional-contents.pl - Shows a single "Default" tab for CSS snippets, and only saves the default content. Translations saved before are removed the next time the snippet is saved News and HTML customizations are not changed. To test: 1. Go to Tools -> CSS snippets -> New CSS snippet 2. Only a "Default" tab is shown, and the content is marked as required 3. Enter a title and only spaces or line breaks as content, and save 4. The form is not submitted and "Enter some CSS before saving." is shown 5. Enter some CSS, save, and check it is applied to the staff interface 6. Edit the snippet: the title and CSS are filled in 7. Go to Tools -> News -> New entry, the language tabs are shown as before, and the content is still required 8. Go to Tools -> HTML customizations -> New entry, the language tabs are shown as before, and the content is not required 9. prove t/db_dependent/Koha/AdditionalContents.t \ t/db_dependent/Template/Plugin/AdditionalContents.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Jason Robb <jrobb@sekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #34 from Jason Robb <jrobb@sekls.org> --- Worked well for me! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Jason Robb <jrobb@sekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210409|0 |1 is obsolete| | Attachment #210410|0 |1 is obsolete| | Attachment #210411|0 |1 is obsolete| | Attachment #210412|0 |1 is obsolete| | Attachment #210413|0 |1 is obsolete| | Attachment #210414|0 |1 is obsolete| | Attachment #210415|0 |1 is obsolete| | Attachment #210416|0 |1 is obsolete| | Attachment #210532|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #35 from Jason Robb <jrobb@sekls.org> --- Created attachment 210540 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210540&action=edit Bug 39538: Replace UserCSS system preferences with snippets This patch adds the new CSS snippets tool to the additional contents and removes the system preferences and branch CSS. There are 4 fewer system preferences (IntranetUserCSS, OPACUserCSS, SCOUserCSS, SelfCheckInUserCSS) which are ported to the new snippets (StaffCSS, OPACCSS, SelfCheckOutCSS, SelfCheckInCSS), as well as removing the branch specific CSS from libraries as it can now be set at the branch level in additional contents. Adding the diff for the log for the ACTN1 coding guideline added the diff for all the additional contents. I did allow for localization because I could see an instance in which you might want different CSS for different languages (or JS when I get to that in another bug). There's a new user permission: edit_css_snippets Test plan: ---BEFORE APPLYING PATCH--- 1. Go to administration and search for usercss For each setting put some code, I provide examples: - SelfCheckInUserCSS body { background-color: oklch(0.6009 0.1184 31.76); } - SCOUserCSS body { background-color: oklch(0.7 0.1 233); } - OPACUserCSS body { background-color: oklch(0.7 0.1357 350.47); } - IntranetUserCSS body { background-color: oklch(0.4199 0.1505 292.24); } 2. Set WebBasedSelfCheck to 'Enable', SelfCheckInModule to 'Enable' and AdditionalContentLog to 'Log' 3. Go to opac url/cgi-bin/koha/sco/sco-main.pl - Observe a blue background 4. Go to opac url/cgi-bin/koha/sci/sci-main.pl and log in as koha/koha - Observe a reddish-orange background 5. Go to the OPAC - Observe a pink background 6. Reload the staff interface - Observe a purple background 7. Go to Administration->Libraries, edit the library you're logged in as and add CSS: body { background-color: oklch(0.82 0.1184 139.76); } 8. Go back to the OPAC, log in as koha/koha - Observe a green background ---APPLY PATCH--- 9. Apply the patch Update the database, yarn build, restart all 10. Search the system preferences for usercss, there should be no results. 11. Go to Administration->Libraries->edit the library you edited before, there should be no CSS field. 12. Go to Tools->CSS snippets. There should be 5 snippets: | Location | Library | Position | Publication date | Title | | --------------- | ------------ | -------- | ---------------- | ------------------------- | | StaffCSS | All | 1 | Today's date | IntranetUserCSS | | OPACCSS | All | 1 | Today's date | OPACUserCSS | | SelfCheckInCSS | All | 1 | Today's date | SelfCheckInUserCSS | | SelfCheckOutCSS | All | 1 | Today's date | SCOUserCSS | | OPACCSS | Your library | 2 | Today's date | Library specific OPAC CSS | 13. Repeat steps 3-6 and step 8, the colors should all be the same as before. 14. Open the preview of a snippet, you should see a non-editable version of the editor, including highlighting and linting. 15. Delete a snippet 16. Change a snippet 17. Go to the logs and filter on Additional content. Observe the difference between the first ones (old info column) vs the new JSON format. 18. In column settings, show the diff column. Observe the before and after comparison. 19. In the top right of the staff interface, click the bug icon and turn off custom CSS, it should remove all the CSS snippets. Permissions testing: 1. Set up a patron (I used 23529000035676) with permission to log into the staff interface and to edit CSS snippets (tools > edit_css_snippets). Change their username and password so you can log in as them. 2. In another browser or private window, log in as the second user 3. Confirm you can add, edit, and delete the snippets and do nothing else in Tools. 4. As the superlibrarian, change it so they can edit news (edit_additional_contents), but not snippets. 5. As the second user, confirm you can edit news but can no longer access the CSS snippets. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #36 from Jason Robb <jrobb@sekls.org> --- Created attachment 210541 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210541&action=edit Bug 39538: Change templates and includes to load the new snippets This patch maches the template changes to load the new snippets instead of the old system preferences. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #37 from Jason Robb <jrobb@sekls.org> --- Created attachment 210542 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210542&action=edit Bug 39538: Remove CSS preferences from Auth This patch removes the CSS preferences from Auth.pm as they are no longer system preferences. It also updates the css debug title. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #38 from Jason Robb <jrobb@sekls.org> --- Created attachment 210543 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210543&action=edit Bug 39538: Add unit tests This patch adds/updates unit tests. To test: prove t/db_dependent/Auth.t prove t/db_dependent/Koha/AdditionalContents.t prove t/db_dependent/Template/Plugin/AdditionalContents.t prove t/db_dependent/Template/Plugin/Branches.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Used for scaffolding unit tests and identifying all impacted tests. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #39 from Jason Robb <jrobb@sekls.org> --- Created attachment 210544 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210544&action=edit Bug 39538: Atomic update Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #40 from Jason Robb <jrobb@sekls.org> --- Created attachment 210545 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210545&action=edit Bug 39538: (follow-up) Add a tooltip for positioning The order of the CSS is always: 1. All libraries - Priority 1 - Priority 2 etc - No priority 2. Branch specific - Priority 1 - Priority 2 etc - No priority If the same selector is called in multiple snippets, the last one is what actually loads. This patch adds a tooltip to note the order. To test, apply and observe the tooltip while adding or editing a new snippet. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #41 from Jason Robb <jrobb@sekls.org> --- Created attachment 210546 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210546&action=edit Bug 39538: (follow-up) Fix logging display and double logging This patch fixes the double logging because of logging translations. Additionally it improves the info and comparison formatting and restores the compare checkbox functionality. To test: 1. Turn on Additional Content logging ( AdditionalContentLog ) in the system preferences 2. Go to Tools-> CSS snippets 3. Add a new snippet 4. Edit the snippet 5. Edit the snippet again 6. Delete the snippet 7. Add another new snippet 8. Go to Tools->Log viewer, uncheck 'All' under modules and select additional content, then Submit 9. Show the diff column, observe how both the diff and Info columns look. - In the info column, click the 'Show content' arrow, this is collapsed to keep the log generally readable. 10. Click the compare on one of the entries for your first snippet, observe the last 'Add' is filtered out. 11. Select another one to compare and select 'View comparison' and observe the formatting Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #42 from Jason Robb <jrobb@sekls.org> --- Created attachment 210547 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210547&action=edit Bug 39538: (follow-up) Clarify the CSS snippets position field This patch labels the position field "Order of snippets" for CSS snippets, other additional contents keep "Appear in position", and rewords the tooltip explaining in which order the snippets load. Storing a 0 position as no position is handled by bug 43988. To test: 1. Go to Tools -> CSS snippets and add or edit a snippet 2. The position field is labelled "Order of snippets", hover the info icon next to it and read the tooltip 3. Go to Tools -> News and add or edit a news item 4. The position field is labelled "Appear in position" and has no tooltip Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #43 from Jason Robb <jrobb@sekls.org> --- Created attachment 210548 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210548&action=edit Bug 39538: (follow-up) Require CSS snippet content and remove translations CSS snippets could be saved with empty or whitespace-only content, which adds nothing to the page. They also showed a tab for each language, but only the default content of a snippet is used, so CSS entered in another language tab was saved and silently ignored. This patch: - Marks the content of a CSS snippet as required, and prevents saving when it is empty or only whitespace, both in the form and in tools/additional-contents.pl - Shows a single "Default" tab for CSS snippets, and only saves the default content. Translations saved before are removed the next time the snippet is saved News and HTML customizations are not changed. To test: 1. Go to Tools -> CSS snippets -> New CSS snippet 2. Only a "Default" tab is shown, and the content is marked as required 3. Enter a title and only spaces or line breaks as content, and save 4. The form is not submitted and "Enter some CSS before saving." is shown 5. Enter some CSS, save, and check it is applied to the staff interface 6. Edit the snippet: the title and CSS are filled in 7. Go to Tools -> News -> New entry, the language tabs are shown as before, and the content is still required 8. Go to Tools -> HTML customizations -> New entry, the language tabs are shown as before, and the content is not required 9. prove t/db_dependent/Koha/AdditionalContents.t \ t/db_dependent/Template/Plugin/AdditionalContents.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |44015 Attachment #210540|0 |1 is obsolete| | Attachment #210541|0 |1 is obsolete| | Attachment #210542|0 |1 is obsolete| | Attachment #210543|0 |1 is obsolete| | Attachment #210544|0 |1 is obsolete| | Attachment #210545|0 |1 is obsolete| | Attachment #210547|0 |1 is obsolete| | Attachment #210548|0 |1 is obsolete| | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44015 [Bug 44015] Log additional contents changes as a single action with a diff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #44 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210775 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210775&action=edit Bug 39538: Replace UserCSS system preferences with snippets This patch adds the new CSS snippets tool to the additional contents and removes the system preferences and branch CSS. There are 4 fewer system preferences (IntranetUserCSS, OPACUserCSS, SCOUserCSS, SelfCheckInUserCSS) which are ported to the new snippets (StaffCSS, OPACCSS, SelfCheckOutCSS, SelfCheckInCSS), as well as removing the branch specific CSS from libraries as it can now be set at the branch level in additional contents. The action logging (single entry per change, with a diff, per the ACTN1 coding guideline) for all additional contents is done in bug 44015, which this depends on. I did allow for localization because I could see an instance in which you might want different CSS for different languages (or JS when I get to that in another bug). There's a new user permission: edit_css_snippets Test plan: ---BEFORE APPLYING PATCH--- 1. Go to administration and search for usercss For each setting put some code, I provide examples: - SelfCheckInUserCSS body { background-color: oklch(0.6009 0.1184 31.76); } - SCOUserCSS body { background-color: oklch(0.7 0.1 233); } - OPACUserCSS body { background-color: oklch(0.7 0.1357 350.47); } - IntranetUserCSS body { background-color: oklch(0.4199 0.1505 292.24); } 2. Set WebBasedSelfCheck to 'Enable', SelfCheckInModule to 'Enable' and AdditionalContentLog to 'Log' 3. Go to opac url/cgi-bin/koha/sco/sco-main.pl - Observe a blue background 4. Go to opac url/cgi-bin/koha/sci/sci-main.pl and log in as koha/koha - Observe a reddish-orange background 5. Go to the OPAC - Observe a pink background 6. Reload the staff interface - Observe a purple background 7. Go to Administration->Libraries, edit the library you're logged in as and add CSS: body { background-color: oklch(0.82 0.1184 139.76); } 8. Go back to the OPAC, log in as koha/koha - Observe a green background ---APPLY PATCH--- 9. Apply the patch Update the database, yarn build, restart all 10. Search the system preferences for usercss, there should be no results. 11. Go to Administration->Libraries->edit the library you edited before, there should be no CSS field. 12. Go to Tools->CSS snippets. There should be 5 snippets: | Location | Library | Position | Publication date | Title | | --------------- | ------------ | -------- | ---------------- | ------------------------- | | StaffCSS | All | 1 | Today's date | IntranetUserCSS | | OPACCSS | All | 1 | Today's date | OPACUserCSS | | SelfCheckInCSS | All | 1 | Today's date | SelfCheckInUserCSS | | SelfCheckOutCSS | All | 1 | Today's date | SCOUserCSS | | OPACCSS | Your library | 2 | Today's date | Library specific OPAC CSS | 13. Repeat steps 3-6 and step 8, the colors should all be the same as before. 14. Open the preview of a snippet, you should see a non-editable version of the editor, including highlighting and linting. 15. Delete a snippet 16. Change a snippet 17. Go to the logs and filter on Additional content. Observe the difference between the first ones (old info column) vs the new JSON format. 18. In column settings, show the diff column. Observe the before and after comparison. 19. In the top right of the staff interface, click the bug icon and turn off custom CSS, it should remove all the CSS snippets. Permissions testing: 1. Set up a patron (I used 23529000035676) with permission to log into the staff interface and to edit CSS snippets (tools > edit_css_snippets). Change their username and password so you can log in as them. 2. In another browser or private window, log in as the second user 3. Confirm you can add, edit, and delete the snippets and do nothing else in Tools. 4. As the superlibrarian, change it so they can edit news (edit_additional_contents), but not snippets. 5. As the second user, confirm you can edit news but can no longer access the CSS snippets. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #45 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210776 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210776&action=edit Bug 39538: Change templates and includes to load the new snippets This patch maches the template changes to load the new snippets instead of the old system preferences. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #46 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210777 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210777&action=edit Bug 39538: Remove CSS preferences from Auth This patch removes the CSS preferences from Auth.pm as they are no longer system preferences. It also updates the css debug title. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #47 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210778 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210778&action=edit Bug 39538: Add unit tests This patch adds/updates unit tests. To test: prove t/db_dependent/Auth.t prove t/db_dependent/Koha/AdditionalContents.t prove t/db_dependent/Template/Plugin/AdditionalContents.t prove t/db_dependent/Template/Plugin/Branches.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Used for scaffolding unit tests and identifying all impacted tests. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #48 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210779 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210779&action=edit Bug 39538: Atomic update Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #49 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210780 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210780&action=edit Bug 39538: (follow-up) Add a tooltip for positioning The order of the CSS is always: 1. All libraries - Priority 1 - Priority 2 etc - No priority 2. Branch specific - Priority 1 - Priority 2 etc - No priority If the same selector is called in multiple snippets, the last one is what actually loads. This patch adds a tooltip to note the order. To test, apply and observe the tooltip while adding or editing a new snippet. Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #50 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210781 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210781&action=edit Bug 39538: (follow-up) Clarify the CSS snippets position field This patch labels the position field "Order of snippets" for CSS snippets, other additional contents keep "Appear in position", and rewords the tooltip explaining in which order the snippets load. Storing a 0 position as no position is handled by bug 43988. To test: 1. Go to Tools -> CSS snippets and add or edit a snippet 2. The position field is labelled "Order of snippets", hover the info icon next to it and read the tooltip 3. Go to Tools -> News and add or edit a news item 4. The position field is labelled "Appear in position" and has no tooltip Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #51 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210782 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210782&action=edit Bug 39538: (follow-up) Require CSS snippet content and remove translations CSS snippets could be saved with empty or whitespace-only content, which adds nothing to the page. They also showed a tab for each language, but only the default content of a snippet is used, so CSS entered in another language tab was saved and silently ignored. This patch: - Marks the content of a CSS snippet as required, and prevents saving when it is empty or only whitespace, both in the form and in tools/additional-contents.pl - Shows a single "Default" tab for CSS snippets, and only saves the default content. Translations saved before are removed the next time the snippet is saved News and HTML customizations are not changed. To test: 1. Go to Tools -> CSS snippets -> New CSS snippet 2. Only a "Default" tab is shown, and the content is marked as required 3. Enter a title and only spaces or line breaks as content, and save 4. The form is not submitted and "Enter some CSS before saving." is shown 5. Enter some CSS, save, and check it is applied to the staff interface 6. Edit the snippet: the title and CSS are filled in 7. Go to Tools -> News -> New entry, the language tabs are shown as before, and the content is still required 8. Go to Tools -> HTML customizations -> New entry, the language tabs are shown as before, and the content is not required 9. prove t/db_dependent/Koha/AdditionalContents.t \ t/db_dependent/Template/Plugin/AdditionalContents.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jason Robb <jrobb@sekls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 --- Comment #52 from Lisette Scheer <lisette@bywatersolutions.com> --- The action log changes affect all additional contents, so they have been moved to bug 44015, which this now depends on. The (follow-up) Fix logging display and double logging patch is obsoleted: its changes are in bug 44015. The other patches are rebased on top of it, with no other changes. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org