LP#1980142: adjust styling of patron message body in Bootstrap OPAC user/gmcharlt/lp1980142_style_opac_message
authorGalen Charlton <gmc@equinoxOLI.org>
Wed, 16 Nov 2022 17:11:22 +0000 (12:11 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 16 Nov 2022 17:13:22 +0000 (12:13 -0500)
commitddb6827d47b9fc4bd928939f56412d9e3c71079c
tree024e21d7cf9b4c622714739afa775d3b132f3d0d
parentdb7cbf0bbb53060b3fb5a23639c1b1618e3844ea
LP#1980142: adjust styling of patron message body in Bootstrap OPAC

This patch resolves an issue where the text of the message body
could be render very small due to default styles applied to the <pre>
element. In particular, it converts the <pre> to a <p> and restores
a TPAC-era style that ensures that

* long lines in the message wrap
* but line breaks are also preserved (see LP#1927990)

This patch also ensures that the message body is not displayed with
label but no contents if the body is empty.

To test
-------
[1] Create a public patron note that contains line breaks and
    long lines.
[2] Note that in the Bootstrap OPAC message view, the message
    displays with fixed-width text (that may use a smaller font
    than the rest of the page) and has a horizontal scrollbar
    (due to the long line).
[3] Apply the patch and look at the message again in the OPAC.
    This time, the long line should wrap, but line breaks are
    also preserved.

This patch includes a portion of a patch by Garry Collum.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/templates-bootstrap/opac/myopac/messages/single_message.tt2