Summary: | Logged in info should be data-attributes instead and text | ||
---|---|---|---|
Product: | Koha | Reporter: | Lucas Gass (lukeg) <lucas> |
Component: | Staff interface | Assignee: | Eric Garcia <cubingguy714> |
Status: | Pushed to stable --- | QA Contact: | Emily Lamancusa (emlam) <emily.lamancusa> |
Severity: | normal | ||
Priority: | P5 - low | CC: | emily.lamancusa, gmcharlt |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: |
This patch adds HTML data-attributes to some hidden content in the staff interface. This makes it easier to retrieve context about the logged in user with CSS or JavaScript.
|
|
Version(s) released in: |
25.11.00,25.05.02
|
Circulation function: | |
Attachments: |
Bug 40421: Make HTML elements data attributes
Bug 40421: Make HTML elements data attributes Bug 40421: Make HTML elements data attributes |
Description
Lucas Gass (lukeg)
2025-07-16 18:01:44 UTC
Created attachment 184237 [details] [review] Bug 40421: Make HTML elements data attributes Test Plan: 1. Apply patch 2. In Staff Interface inspect element and notice HTML has data attributes Thanks Eric, this is great. The reason I wanted this is because, with this patch, I can now write CSS like this for example: body:has(span[data-logged-in-branch-code="CPL"]) { background: red; } body:has(span[data-logged-in-branch-code="MPL"]) { background: blue; } Now, without JS, I can change the background color per branch. Created attachment 184239 [details] [review] Bug 40421: Make HTML elements data attributes Test Plan: 1. Apply patch 2. In Staff Interface inspect element and notice HTML has data attributes Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> I changed the bug title because this should not replace the text we currently have, that would break too many customization. It should go along with the text, which is what Eric did. Created attachment 184378 [details] [review] Bug 40421: Make HTML elements data attributes Test Plan: 1. Apply patch 2. In Staff Interface inspect element and notice HTML has data attributes Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Nice work everyone! Pushed to main for 25.11 Nice work everyone! Pushed to 25.05.x |