Bug 38994 - Add class attributes to the circulation homepage to ease customization
Summary: Add class attributes to the circulation homepage to ease customization
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Andrew Fuerste-Henry
QA Contact: David Cook
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-29 20:05 UTC by Andrew Fuerste-Henry
Modified: 2025-04-22 06:49 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 38994: Add classes to circulation module homepage (18.04 KB, patch)
2025-01-29 20:26 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 38994: Add classes to circulation module homepage (16.76 KB, patch)
2025-04-10 14:10 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 38994: Add classes to circulation module homepage (16.80 KB, patch)
2025-04-10 17:44 UTC, Jason Robb
Details | Diff | Splinter Review
Bug 38994: Add classes to circulation module homepage (16.86 KB, patch)
2025-04-14 00:54 UTC, David Cook
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 2025-01-29 20:05:09 UTC
There aren't distinct html classes on the various sections and buttons on /cgi-bin/koha/circ/circulation-home.pl and it makes things hard to target with CSS.
Comment 1 Andrew Fuerste-Henry 2025-01-29 20:26:41 UTC
Created attachment 177319 [details] [review]
Bug 38994: Add classes to circulation module homepage

To test:
1: inspect /koha/circ/circulation-home.pl, see most elements lack distinct classes
2: apply patch, reload page
3: inspect page again, confirm nothing has changed in display
4: confirm page elements have distinct classes now and can be accurately targetted with CSS
Comment 2 Emmi Takkinen 2025-02-21 11:44:39 UTC
Applying patches produces following error:

Applying: Bug 38994: Add classes to circulation module homepage
Using index info to reconstruct a base tree...
M	koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt
error: Failed to merge in the changes.
Patch failed at 0001 Bug 38994: Add classes to circulation module homepage
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-38994-Add-classes-to-circulation-module-homepa-xIUMjF.patch
Comment 3 Andrew Fuerste-Henry 2025-04-10 14:10:42 UTC
Created attachment 180782 [details] [review]
Bug 38994: Add classes to circulation module homepage

To test:
1: inspect /koha/circ/circulation-home.pl, see most elements lack distinct classes
2: apply patch, reload page
3: inspect page again, confirm nothing has changed in display
4: confirm page elements have distinct classes now and can be accurately targetted with CSS
Comment 4 Jason Robb 2025-04-10 17:44:10 UTC
Created attachment 180795 [details] [review]
Bug 38994: Add classes to circulation module homepage

To test:
1: inspect /koha/circ/circulation-home.pl, see most elements lack distinct classes
2: apply patch, reload page
3: inspect page again, confirm nothing has changed in display
4: confirm page elements have distinct classes now and can be accurately targetted with CSS

Signed-off-by: Jason Robb <jrobb@sekls.org>
Comment 5 David Cook 2025-04-11 02:45:27 UTC
I reckon for "Offline circulation", it would be good to have a class for the whole section. 

For instance, for bug 39378, if someone wanted to hide this with CSS, they'd need to do it for the whole section.
Comment 6 Andrew Fuerste-Henry 2025-04-11 19:40:20 UTC
(In reply to David Cook from comment #5)
> I reckon for "Offline circulation", it would be good to have a class for the
> whole section. 
> 
> For instance, for bug 39378, if someone wanted to hide this with CSS, they'd
> need to do it for the whole section.

That section already has an id, so this works:
#offline-circulation {
  display: none;
}
Comment 7 David Cook 2025-04-13 23:19:12 UTC
(In reply to Andrew Fuerste-Henry from comment #6)
> That section already has an id, so this works:
> #offline-circulation {
>   display: none;
> }

Ah, nice one! Looks like I misread the patch! Thanks for the correction :).
Comment 8 David Cook 2025-04-14 00:54:18 UTC
Created attachment 180894 [details] [review]
Bug 38994: Add classes to circulation module homepage

To test:
1: inspect /koha/circ/circulation-home.pl, see most elements lack distinct classes
2: apply patch, reload page
3: inspect page again, confirm nothing has changed in display
4: confirm page elements have distinct classes now and can be accurately targetted with CSS

Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 9 David Cook 2025-04-14 00:56:54 UTC
I really like this. The more hooks on HTML elements the better imho. 

Technically, some of these classes probably could've/should've been IDs, but I don't think it matters, especially since you can chain them together with the body ID of "circ_circulation-home".

So thumbs up from me.
Comment 10 Katrin Fischer 2025-04-22 06:44:14 UTC
I agree about the id vs. class predicament, but I don't have a strong argument for changing it. Some of the classes are quite general, but there doesn't appear to be a conflict as far as I can tell. Not blocker.
Comment 11 Katrin Fischer 2025-04-22 06:49:50 UTC
Pushed for 25.05!

Well done everyone, thank you!