Bug 25242: (QA follow-up) Colwidth on results table
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 18 Aug 2020 09:35:59 +0000 (10:35 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 20 Aug 2020 10:25:19 +0000 (12:25 +0200)
Prior to this patch, the column width on the opac-results table were not
fixed or calculated by a datatable; As such when we introduced the
'table-layout: fixed' property all columns were given equal share of the
table, which resulted in most cases in a three way split between a
checkbox, an empty cell and the actual content.

This patch sets the width for the selectcol to '1ch' for the single
character checkbox and updates the second columns class to 'numcol' as
it is not used for selection but rather result numbering and sets a
fixed width of '4ch' allowing for results upto 3 digits (plus the
period) to display correctly without wrapping.

Test plan
1/ Apply the patches and run the yarn build process to update the .css
2/ Perform a search and varify that the results table looks reasonable
3/ Disable OPACHiddenItems and perform a search again.
4/ Confirm the table looks reasonable still
5/ Signoff

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt

index e59ab8d..dfc4c6e 100644 (file)
@@ -229,6 +229,14 @@ td {
     background-color: #FFF;
     word-wrap: break-all;
     word-wrap: break-word;
+
+    &.selectcol {
+        width: 1ch;
+    }
+
+    &.numcol {
+        width: 3ch;
+    }
 }
 
 tr {
index e199aa7..8f8aa64 100644 (file)
                                                 [% END # IF opacbookbag%]
                                             </td>
                                             [% # Cell 2: Show result number if OpacHiddenItems is empty %]
-                                            <td class="select selectcol">
+                                            <td class="numcol[%- IF suppress_result_number %] hidden[%- END -%]">
                                                 [% UNLESS suppress_result_number %]
                                                     [% SEARCH_RESULT.result_number | html %].
                                                 [% END %]