Bug 31633 - Add home and holding data attributes to quick spine label print to help customizing
Summary: Add home and holding data attributes to quick spine label print to help custo...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Lucas Gass
QA Contact: Katrin Fischer
URL:
Keywords: release-notes-needed
Depends on: 28512
Blocks:
  Show dependency treegraph
 
Reported: 2022-09-27 13:11 UTC by Andrew Fuerste-Henry
Modified: 2023-12-28 20:42 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00


Attachments
Bug 31633: Add holding and home data attributes to spinelabel-print.tt (2.03 KB, patch)
2022-09-27 16:49 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 31633: Add holding and home data attributes to spinelabel-print.tt (2.14 KB, patch)
2022-09-27 17:37 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 31633: Add holding and home data attributes to spinelabel-print.tt (2.20 KB, patch)
2022-09-27 18:00 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 31633: Add holding and home data attributes to spinelabel-print.tt (2.25 KB, patch)
2022-10-01 20:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31633: Add holding and home data attributes to spinelabel-print.tt (2.25 KB, patch)
2022-10-01 20:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31633: Add holding and home data attributes to spinelabel-print.tt (2.25 KB, patch)
2022-10-01 20:35 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31633: (QA follow-up) Add data-attribute for logged-in library (1.60 KB, patch)
2022-10-01 20:35 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31633: (follow-up) Group template params (1.49 KB, patch)
2022-10-03 17:10 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2022-09-27 13:11:39 UTC
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?
Comment 1 Lucas Gass 2022-09-27 15:27:00 UTC
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">
Comment 2 Andrew Fuerste-Henry 2022-09-27 15:34:46 UTC
(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.
Comment 3 Katrin Fischer 2022-09-27 15:52:54 UTC
(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.
Comment 4 Lucas Gass 2022-09-27 16:49:14 UTC
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;
}
Comment 5 Lucas Gass 2022-09-27 16:50:25 UTC
I did a bad paste. The example CSS for testing is this:

#spinelabel[data-holdingbranch="CPL"] {
	background: red;
}
Comment 6 Lucas Gass 2022-09-27 17:37:12 UTC
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;
}
Comment 7 ByWater Sandboxes 2022-09-27 18:00:00 UTC
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>
Comment 8 Katrin Fischer 2022-10-01 20:28:38 UTC
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>
Comment 9 Katrin Fischer 2022-10-01 20:32:09 UTC
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>
Comment 10 Katrin Fischer 2022-10-01 20:35:05 UTC
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>
Comment 11 Katrin Fischer 2022-10-01 20:35:10 UTC
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.
Comment 12 Tomás Cohen Arazi 2022-10-03 17:10:56 UTC
Created attachment 141283 [details] [review]
Bug 31633: (follow-up) Group template params

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 13 Tomás Cohen Arazi 2022-10-03 17:14:51 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!