Bug 25462

Summary: Shelving location should be on a new line in holdings table
Product: Koha Reporter: David Roberts <david.roberts>
Component: Staff interfaceAssignee: David Roberts <david.roberts>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: andrew, caroline.cyr-la-rose, fiona.borthwick, fridolin.somers, gmcharlt, martin.renvoize, oleonard, victor
Version: MainKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
In the holdings table, the shelving location is now displayed on a new line after the 'Home library'.
Version(s) released in:
21.05.00,20.11.02,20.05.08
Circulation function:
Attachments: Bug 25462: Shelving location should be on a new line in holdings table
Bug 25462: Show shelving location on a new line after home library (staff client)
Bug 25462: Show shelving location on a new line after home library (OPAC)
Bug 25462: Shelving location should be on a new line in holdings table
Bug 25462: Show shelving location on a new line after home library (staff client)
Bug 25462: Show shelving location on a new line after home library (OPAC)
Bug 25462: (follow-up) Remove <br /> as it is no longer needed
Bug 25462: Shelving location should be on a new line in holdings table
Bug 25462: Show shelving location on a new line after home library (staff client)
Bug 25462: Show shelving location on a new line after home library (OPAC)
Bug 25462: (follow-up) Remove <br /> as it is no longer needed

Description David Roberts 2020-05-12 09:57:29 UTC
In the staff client, if an item has a long shelving location description, it displays on the same line as the Home Library, which doesn't look very good. It ought to be on the next line. 

https://snipboard.io/YzSTDH.jpg
Comment 1 David Roberts 2020-05-12 10:01:42 UTC
Created attachment 104746 [details] [review]
Bug 25462: Shelving location should be on a new line in holdings table

This patch moves the shelving location a new line after the Home library
in the holdings table.

To test:

1) Assign a shelving location with a long description to an item.
2) See that it displays on the same line as the Home Library in /cgi-bin/koha/catalogue/detail.pl
3) Apply the patch
4) Check that the shelving location is now on a new line
Comment 2 Katrin Fischer 2020-05-12 10:07:12 UTC
I think instead of hardcoding a <br> here this cold be possibly solved by CSS instead (display:block?) With your patch there would always be a new line, even if there is no location.

It might be something got lost there at some point as we definitely have a new line in our older versions. I am adding Owen - he might have an idea what changed.
Comment 3 David Roberts 2020-05-12 11:22:58 UTC
(In reply to Katrin Fischer from comment #2)
> I think instead of hardcoding a <br> here this cold be possibly solved by
> CSS instead (display:block?) With your patch there would always be a new
> line, even if there is no location.
> 
> It might be something got lost there at some point as we definitely have a
> new line in our older versions. I am adding Owen - he might have an idea
> what changed.

My knowledge of CSS isn't good enough to do that, sadly! I take your point about the permanent new line though. Perhaps something like this might work instead (I haven't tested this, it's just an idea at the moment!)

[% IF (item.location) %]
<br />
<span class="shelvingloc">
[% END %]
Comment 4 Owen Leonard 2020-05-12 12:48:43 UTC
Created attachment 104772 [details] [review]
Bug 25462: Show shelving location on a new line after home library (staff client)

This patch updates the staff client CSS to move the shelving location a
new line after the 'Home library' in list of holdings on the
bibliographic detail page.

To test, apply the patch and rebuild the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Locate a title in the staff client which has items with a shelving
  location.
- View the detail page for that title. In the table of holdings,
  confirm that the shelving location information is on a separate line from
  the home library information.
Comment 5 Owen Leonard 2020-05-12 12:48:47 UTC
Created attachment 104773 [details] [review]
Bug 25462: Show shelving location on a new line after home library (OPAC)

This patch updates the OPAC CSS to move the shelving location a
new line after the 'Home library' in list of holdings on the
bibliographic detail page.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Locate a title in the OPAC which has items with a shelving
  location.
- View the detail page for that title. In the table of holdings,
  confirm that the shelving location information is on a separate line
  from the home library information.
Comment 6 Owen Leonard 2020-05-12 12:49:56 UTC
I've attached an alternate solution that uses CSS, also including a fix for the OPAC.
Comment 7 Fridolin Somers 2020-09-25 12:16:21 UTC
Careful, class "shelvingloc" is used in a lot of places :

git grep -l 'class="shelvingloc'
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt

I suggest you add "display: block" most specificly on items table :
intranet : td.homebranch .shelvingloc
opac : td.location .shelvingloc
Comment 8 Martin Renvoize (ashimema) 2020-11-04 14:36:55 UTC
Created attachment 112996 [details] [review]
Bug 25462: Shelving location should be on a new line in holdings table

This patch moves the shelving location a new line after the Home library
in the holdings table.

To test:

1) Assign a shelving location with a long description to an item.
2) See that it displays on the same line as the Home Library in /cgi-bin/koha/catalogue/detail.pl
3) Apply the patch
4) Check that the shelving location is now on a new line

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize (ashimema) 2020-11-04 14:37:03 UTC
Created attachment 112997 [details] [review]
Bug 25462: Show shelving location on a new line after home library (staff client)

This patch updates the staff client CSS to move the shelving location a
new line after the 'Home library' in list of holdings on the
bibliographic detail page.

To test, apply the patch and rebuild the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Locate a title in the staff client which has items with a shelving
  location.
- View the detail page for that title. In the table of holdings,
  confirm that the shelving location information is on a separate line from
  the home library information.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2020-11-04 14:37:12 UTC
Created attachment 112998 [details] [review]
Bug 25462: Show shelving location on a new line after home library (OPAC)

This patch updates the OPAC CSS to move the shelving location a
new line after the 'Home library' in list of holdings on the
bibliographic detail page.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Locate a title in the OPAC which has items with a shelving
  location.
- View the detail page for that title. In the table of holdings,
  confirm that the shelving location information is on a separate line
  from the home library information.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize (ashimema) 2020-11-04 14:38:36 UTC
Tested on a sandbox on live testing youtube. All works as expected.
Comment 12 Fridolin Somers 2020-11-05 10:08:03 UTC
Careful, class "shelvingloc" is used in a lot of places, see comment 7

And should we not remove patch adding <br/> ?
"Bug 25462: Shelving location should be on a new line in holdings table"
Comment 13 Martin Renvoize (ashimema) 2020-11-05 11:37:03 UTC
Created attachment 113092 [details] [review]
Bug 25462: (follow-up) Remove <br /> as it is no longer needed

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize (ashimema) 2020-11-05 11:38:57 UTC
I've swung back around to this to do a bit more due diligence.. I've checked all pages with the related class and confirmed that they all look good with the updated styling... I've also added a followup to revert the first patch (added as a followup to retain David's contribution, but I'll leave it up to the RM to decide whether to squash/remove entirely the pair).
Comment 15 Katrin Fischer 2021-01-03 14:48:34 UTC
In the end this boils down to a nice small change. Found no regressions looking at a lot of pages that use the shelvingloc class.
Comment 16 Katrin Fischer 2021-01-03 14:49:19 UTC
Created attachment 114770 [details] [review]
Bug 25462: Shelving location should be on a new line in holdings table

This patch moves the shelving location a new line after the Home library
in the holdings table.

To test:

1) Assign a shelving location with a long description to an item.
2) See that it displays on the same line as the Home Library in /cgi-bin/koha/catalogue/detail.pl
3) Apply the patch
4) Check that the shelving location is now on a new line

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 17 Katrin Fischer 2021-01-03 14:49:23 UTC
Created attachment 114771 [details] [review]
Bug 25462: Show shelving location on a new line after home library (staff client)

This patch updates the staff client CSS to move the shelving location a
new line after the 'Home library' in list of holdings on the
bibliographic detail page.

To test, apply the patch and rebuild the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Locate a title in the staff client which has items with a shelving
  location.
- View the detail page for that title. In the table of holdings,
  confirm that the shelving location information is on a separate line from
  the home library information.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 18 Katrin Fischer 2021-01-03 14:49:27 UTC
Created attachment 114772 [details] [review]
Bug 25462: Show shelving location on a new line after home library (OPAC)

This patch updates the OPAC CSS to move the shelving location a
new line after the 'Home library' in list of holdings on the
bibliographic detail page.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Locate a title in the OPAC which has items with a shelving
  location.
- View the detail page for that title. In the table of holdings,
  confirm that the shelving location information is on a separate line
  from the home library information.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 19 Katrin Fischer 2021-01-03 14:49:30 UTC
Created attachment 114773 [details] [review]
Bug 25462: (follow-up) Remove <br /> as it is no longer needed

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 20 Jonathan Druart 2021-01-04 15:34:14 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 21 Fridolin Somers 2021-01-07 14:18:16 UTC
Small but really useful enhancement, I choose to backport.

Pushed to 20.11.x for 20.11.02
Comment 22 Andrew Fuerste-Henry 2021-01-12 14:33:11 UTC
Pushed to 20.05.x for 20.05.08
Comment 23 Victor Grousset/tuxayo 2021-01-21 20:02:04 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.