Bug 25462 - Shelving location should be on a new line in holdings table
Summary: Shelving location should be on a new line in holdings table
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff Client (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: David Roberts
QA Contact: Testopia
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2020-05-12 09:57 UTC by David Roberts
Modified: 2020-11-05 11:38 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 25462: Shelving location should be on a new line in holdings table (1.51 KB, patch)
2020-05-12 10:01 UTC, David Roberts
Details | Diff | Splinter Review
Bug 25462: Show shelving location on a new line after home library (staff client) (1.32 KB, patch)
2020-05-12 12:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25462: Show shelving location on a new line after home library (OPAC) (1.26 KB, patch)
2020-05-12 12:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25462: Shelving location should be on a new line in holdings table (1.58 KB, patch)
2020-11-04 14:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25462: Show shelving location on a new line after home library (staff client) (1.38 KB, patch)
2020-11-04 14:37 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25462: Show shelving location on a new line after home library (OPAC) (1.32 KB, patch)
2020-11-04 14:37 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25462: (follow-up) Remove <br /> as it is no longer needed (1.24 KB, patch)
2020-11-05 11:37 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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 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 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 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 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 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).