Bug 28512 makes the quick spine label include a css class of the logged-in library to facilitate branch-specific customization of labels. Some libraries may prefer that the spine label formatting key off of the item's homebranch or holdingbranch, rather than the user's logged-in branch. Maybe a system preference to select which branch to apply?
What if we just simply added a data-attribute that one could base CSS/JS off of? Something like: <div data-holdingbranch="CPL"> <div data-homebranch="FPL">
(In reply to Lucas Gass from comment #1) > What if we just simply added a data-attribute that one could base CSS/JS off > of? > > Something like: > > <div data-holdingbranch="CPL"> > <div data-homebranch="FPL"> So just put all three branches in the CSS to start and let folks key off whichever they want to use? Works for me.
(In reply to Andrew Fuerste-Henry from comment #2) > (In reply to Lucas Gass from comment #1) > > What if we just simply added a data-attribute that one could base CSS/JS off > > of? > > > > Something like: > > > > <div data-holdingbranch="CPL"> > > <div data-homebranch="FPL"> > > So just put all three branches in the CSS to start and let folks key off > whichever they want to use? Works for me. Yep, great idea :) I think if we could add them to the existing div, we would also be safe to not change the page structure affecting existing CSS.
Created attachment 141035 [details] [review] Bug 31633: Add holding and home data attributes to spinelabel-print.tt To test: 1. Apply patch 2. Have some items with call numbers and different holding/home branches. 3. Generate some quick spine labels and use your browsers dev tools to inscept the #spinelabel element. It should have 2 new data-attributes, data-homebranch and data-holdingbranch 4. You can then apply this CSS via IntraNnetUserCSS to make sure you can select these properly now: background: red; }
I did a bad paste. The example CSS for testing is this: #spinelabel[data-holdingbranch="CPL"] { background: red; }
Created attachment 141036 [details] [review] Bug 31633: Add holding and home data attributes to spinelabel-print.tt To test: 1. Apply patch 2. Have some items with call numbers and different holding/home branches. 3. Generate some quick spine labels and use your browsers dev tools to inscept the #spinelabel element. It should have 2 new data-attributes, data-homebranch and data-holdingbranch 4. You can then apply this CSS via IntraNnetUserCSS to make sure you can select these properly now: background: red; }
Created attachment 141037 [details] [review] Bug 31633: Add holding and home data attributes to spinelabel-print.tt To test: 1. Apply patch 2. Have some items with call numbers and different holding/home branches. 3. Generate some quick spine labels and use your browsers dev tools to inscept the #spinelabel element. It should have 2 new data-attributes, data-homebranch and data-holdingbranch 4. You can then apply this CSS via IntraNnetUserCSS to make sure you can select these properly now: background: red; } Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 141188 [details] [review] Bug 31633: Add holding and home data attributes to spinelabel-print.tt To test: 1. Apply patch 2. Have some items with call numbers and different holding/home branches. 3. Generate some quick spine labels and use your browsers dev tools to inscept the #spinelabel element. It should have 2 new data-attributes, data-homebranch and data-holdingbranch 4. You can then apply this CSS via IntraNnetUserCSS to make sure you can select these properly now: background: red; } Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 141189 [details] [review] Bug 31633: Add holding and home data attributes to spinelabel-print.tt To test: 1. Apply patch 2. Have some items with call numbers and different holding/home branches. 3. Generate some quick spine labels and use your browsers dev tools to inscept the #spinelabel element. It should have 2 new data-attributes, data-homebranch and data-holdingbranch 4. You can then apply this CSS via IntraNnetUserCSS to make sure you can select these properly now: background: red; } Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 141190 [details] [review] Bug 31633: Add holding and home data attributes to spinelabel-print.tt To test: 1. Apply patch 2. Have some items with call numbers and different holding/home branches. 3. Generate some quick spine labels and use your browsers dev tools to inscept the #spinelabel element. It should have 2 new data-attributes, data-homebranch and data-holdingbranch 4. You can then apply this CSS via IntraNnetUserCSS to make sure you can select these properly now: background: red; } Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 141191 [details] [review] Bug 31633: (QA follow-up) Add data-attribute for logged-in library The class has some advantages, but I thought it would be nice to also have the complete set of options in data-attributes.
Created attachment 141283 [details] [review] Bug 31633: (follow-up) Group template params Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 22.11. Nice work everyone, thanks!