Bug 38767 - Statuses in the holdings table should have block display, not inline
Summary: Statuses in the holdings table should have block display, not inline
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
Depends on: 38512
Blocks:
  Show dependency treegraph
 
Reported: 2024-12-20 17:37 UTC by Lucas Gass (lukeg)
Modified: 2025-02-11 20:28 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the status column in the holdings table for a record with multiple statuses - each status is now shown on its own line, instead of running together. (The CSS was updated so that there is a holding_status class (which is styled as a block) and then the individual status class, for example: <span class="holding_status waitingat">Waiting at X since Y.</span>.)
Version(s) released in:
Circulation function:


Attachments
Bug 38767: Convert each status element in holdings table from span to div (9.47 KB, patch)
2024-12-20 17:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38767: Add block display for statuses in holdings table (3.32 KB, patch)
2024-12-30 21:42 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38767: Add block display for statuses in holdings table (3.38 KB, patch)
2025-01-09 18:40 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 38767: Add standard class to various statuses in holdings tavle (11.29 KB, patch)
2025-01-13 17:16 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38767: Add standard class to various statuses in holdings tavle (11.33 KB, patch)
2025-01-24 19:11 UTC, David Nind
Details | Diff | Splinter Review
Bug 38767: Add standard class to various statuses in holdings tavle (11.83 KB, patch)
2025-02-11 20:28 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2024-12-20 17:37:12 UTC
In the holdings table there is a the status column, there can sometimes be multiple statuses per item. When there is the are displayed in <span>, being inline makes each status run together. 

They need to be block level <div> to be more readable.
Comment 1 Lucas Gass (lukeg) 2024-12-20 17:43:41 UTC
Created attachment 175850 [details] [review]
Bug 38767: Convert each status element in holdings table from span to div

1. have an item with many statuses including:

-checked out
-onsite_checkout
-in transit
-transit requested
-lost
-damaaged
-withdrwan
-not for loan
-hold waiting at...
-recalled
-available
-in bundle

2. notice when there are multiple statuses the text runs into a single "blob".
3. Apply patch
4. Statuses are seperated by a break.
Comment 2 Phil Ringnalda 2024-12-20 22:11:31 UTC
Many of those won't reproduce the problem because staff-global.css sets them to display: block; already. Some can't exist with some others (you can't have available and lost since available comes from !lost). Some sort of expect to be combined (e.g. waitingat and heldfor).

Could you fix the actual problem ones by just adding their class to the classes that are set to display: block?
Comment 3 Phil Ringnalda 2024-12-21 01:15:47 UTC
Oh, didn't notice the dependency saying the problem was the recall message that you made stop trying (and failing) to work as a run-on sentence with its initial lowercase letter.

So make that "can't you just add a classname to the recall span, always a useful thing, and then add that to the list of block statuses in https://git.koha-community.org/Koha-community/Koha/src/commit/1a4820322e528fdea4ac6dd212254ca3021d30a2/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss#L2263 so it won't try to attach itself to other things?"
Comment 4 Lucas Gass (lukeg) 2024-12-30 21:42:15 UTC
> Could you fix the actual problem ones by just adding their class to the
> classes that are set to display: block?

Sounds good to me.
Comment 5 Lucas Gass (lukeg) 2024-12-30 21:42:52 UTC
Created attachment 176022 [details] [review]
Bug 38767: Add block display for statuses in holdings table

1. have an item with many statuses including:

-checked out
-onsite_checkout
-in transit
-transit requested
-lost
-damaaged
-withdrwan
-not for loan
-hold waiting at...
-recalled
-available
-in bundle

2. notice when there are multiple statuses the text runs into a single "blob".
3. APPLY PATCH and generate CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface)
4. Statuses are seperated by a break.
Comment 6 David Nind 2025-01-02 23:10:47 UTC
I had a go at testing, but I was unable to replicate the issue.

1. I set up recalls:
   - Enable recalls: UseRecalls
   - Update circulation rules: I used 5 for all of the recall options
2. For a record, changed status to 4- Damaged status: Damaged
3. Checked out an item for the record to a patron
4. Placed a recall on the record (used the koha user in the OPAC to place the recall
5. Checked the item in and confirmed the recall
6. Status column in the holdings table shows as:
     Damaged
     Waiting recall at Centerville since 01/02/2025
7. This seems OK to me.
Comment 7 Owen Leonard 2025-01-08 12:15:06 UTC
Whether or not the display problem is reproducible, I think we can improve how the statuses and CSS are handled in order to make simpler and more flexible. My go-to pattern for this kind of thing is two have one common class and one specific class. This is what we do in the bibliographic details on that same page:

<span class="results_summary isbn">...</span>

The "results_summary" class can be used to change the display of all elements in that "category" (in this case it could be 'display:block'). The specific class can be used (if necessary) to differentiate that element from the others in that category.

Doing it this way means we don't have to keep adding classes to the CSS as item statuses are created.

I would suggest something like:

<span class="holding_status recallwaiting">%s</span>
Comment 8 ByWater Sandboxes 2025-01-09 18:40:34 UTC
Created attachment 176298 [details] [review]
Bug 38767: Add block display for statuses in holdings table

1. have an item with many statuses including:

-checked out
-onsite_checkout
-in transit
-transit requested
-lost
-damaaged
-withdrwan
-not for loan
-hold waiting at...
-recalled
-available
-in bundle

2. notice when there are multiple statuses the text runs into a single "blob".
3. APPLY PATCH and generate CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface)
4. Statuses are seperated by a break.

Signed-off-by: William Lavoie <william.lavoie@inLibro.com>
Comment 9 Lucas Gass (lukeg) 2025-01-09 18:42:44 UTC
(In reply to Owen Leonard from comment #7)
> Whether or not the display problem is reproducible, I think we can improve
> how the statuses and CSS are handled in order to make simpler and more
> flexible. My go-to pattern for this kind of thing is two have one common
> class and one specific class. This is what we do in the bibliographic
> details on that same page:
> 
> <span class="results_summary isbn">...</span>
> 
> The "results_summary" class can be used to change the display of all
> elements in that "category" (in this case it could be 'display:block'). The
> specific class can be used (if necessary) to differentiate that element from
> the others in that category.
> 
> Doing it this way means we don't have to keep adding classes to the CSS as
> item statuses are created.
> 
> I would suggest something like:
> 
> <span class="holding_status recallwaiting">%s</span>

Failing this based on Owen's comment. I'll come back to it ASAP.
Comment 10 Lucas Gass (lukeg) 2025-01-13 17:16:52 UTC
Created attachment 176461 [details] [review]
Bug 38767: Add standard class to various statuses in holdings tavle

1. have an item with many statuses including:

-checked out
-onsite_checkout
-in transit
-transit requested
-lost
-damaaged
-withdrwan
-not for loan
-hold waiting at...
-recalled
-available
-in bundle

2. notice when there are multiple statuses the text runs into a single "blob".
3. APPLY PATCH and generate CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface)
4. Statuses are seperated by a break.
Comment 11 Phil Ringnalda 2025-01-14 13:31:55 UTC
For a step 1 that lets you see step 2 without the patch, try:

* place an item-specific hold on an item at another branch
* check the item in at that branch, giving you intransit+holdonitem
* check the item in at the destination, giving you waitingat+heldfor

The affected statuses are intransit, holdonitem, transitrequested, waitingat, heldfor, bundled, recallwaiting, recalledby, but most of them are either impossible or more difficult to combine.
Comment 12 Lucas Gass (lukeg) 2025-01-14 14:38:06 UTC
> The affected statuses are intransit, holdonitem, transitrequested,
> waitingat, heldfor, bundled, recallwaiting, recalledby, but most of them are
> either impossible or more difficult to combine.

Thanks Phil, that is a good point to make. You can also check for the existence of the new class and make sure the element is displaying `block`.
Comment 13 David Nind 2025-01-24 19:11:06 UTC
Created attachment 177133 [details] [review]
Bug 38767: Add standard class to various statuses in holdings tavle

1. have an item with many statuses including:

-checked out
-onsite_checkout
-in transit
-transit requested
-lost
-damaaged
-withdrwan
-not for loan
-hold waiting at...
-recalled
-available
-in bundle

2. notice when there are multiple statuses the text runs into a single "blob".
3. APPLY PATCH and generate CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface)
4. Statuses are seperated by a break.

Signed-off-by: David Nind <david@davidnind.com>
Comment 14 David Nind 2025-01-24 19:20:46 UTC
Thanks Phil for the steps to replicate multiple statuses.
Comment 15 Lucas Gass (lukeg) 2025-02-11 20:28:05 UTC
Created attachment 177759 [details] [review]
Bug 38767: Add standard class to various statuses in holdings tavle

1. have an item with many statuses including:

-checked out
-onsite_checkout
-in transit
-transit requested
-lost
-damaaged
-withdrwan
-not for loan
-hold waiting at...
-recalled
-available
-in bundle

2. notice when there are multiple statuses the text runs into a single "blob".
3. APPLY PATCH and generate CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface)
4. Statuses are seperated by a break.

Signed-off-by: David Nind <david@davidnind.com>