From 32d8a82356411373d0443add0ab9c183a00c9e08 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 20 Dec 2024 17:38:47 +0000 Subject: [PATCH] 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. --- .../tables/items/catalogue_detail.inc | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index 92455cb484..4813314980 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -477,7 +477,7 @@ [%# Hacky for patron_to_html in case we simply want to display the patron's library name %] row.checkout.patron.library = { name: libraries_names.get(row.checkout.patron.library_id) }; - nodes += ''; + nodes += '
'; if ( row.checkout.onsite_checkout ) { let patron_to_html = $patron_to_html(row.checkout.patron, { url: true, display_cardnumber: true, hide_patron_name }); nodes += _("Currently in local use by %s").format(patron_to_html); @@ -488,18 +488,18 @@ } nodes += ': '; nodes += _("due %s").format($date(row.checkout.due_date, { as_due_date: true })); - nodes += "" + nodes += "
" } else if ( row.transfer ) { if ( row.transfer.datesent ) { - nodes += '%s'.format(_("In transit from %s to %s since %s").format(escape_str(row.transfer._strings.from_library.str), escape_str(row.transfer._strings.to_library.str), $date(row.transfer.datesent))); + nodes += '
%s
'.format(_("In transit from %s to %s since %s").format(escape_str(row.transfer._strings.from_library.str), escape_str(row.transfer._strings.to_library.str), $date(row.transfer.datesent))); } else { - nodes += '%s'.format(_("Transit pending from %s to %s since %s").format(escape_str(row.transfer._strings.from_library.str), escape_str(row.transfer._strings.to_library.str), $date(row.transfer.daterequested))); + nodes += '
%s
'.format(_("Transit pending from %s to %s since %s").format(escape_str(row.transfer._strings.from_library.str), escape_str(row.transfer._strings.to_library.str), $date(row.transfer.daterequested))); } } if ( row.lost_status ) { let lost_lib = av_lost.get(row.lost_status.toString()) || _("Unavailable (lost or missing"); - nodes += '%s'.format(escape_str(lost_lib)); + nodes += '
%s
'.format(escape_str(lost_lib)); [% IF Koha.Preference('ClaimReturnedLostValue') %] const hasReturnClaims = row.return_claims.filter(rc => !rc.resolution).length > 0 ? true : false if(hasReturnClaims) { @@ -510,25 +510,25 @@ if ( row.withdrawn ) { let withdrawn_lib = av_withdrawn.get(row.withdrawn.toString()) || _("Withdrawn"); - nodes += '%s'.format(escape_str(withdrawn_lib)); + nodes += '
%s
'.format(escape_str(withdrawn_lib)); } if ( row.damaged_status ) { let damaged_lib = av_damaged.get(row.damaged_status.toString()) || _("Damaged"); - nodes += '%s'.format(escape_str(damaged_lib)); + nodes += '
%s
'.format(escape_str(damaged_lib)); } if ( row.not_for_loan_status || item_types_notforloan.get(row.item_type_id) ) { let not_for_loan_lib = av_not_for_loan.get(row.not_for_loan_status.toString()); - nodes += '%s'.format(_("Not for loan")) + ( not_for_loan_lib ? ' (%s)'.format(escape_str(not_for_loan_lib)) : '' ) + ''; + nodes += '
%s'.format(_("Not for loan")) + ( not_for_loan_lib ? ' (%s)'.format(escape_str(not_for_loan_lib)) : '' ) + '
'; } if ( row.first_hold ) { if ( row.first_hold.waiting_date ) { if ( row.first_hold.desk ) { - nodes += '%s'.format(_("Waiting at %s, %s since %s.".format(row.first_hold._strings.pickup_library_id.str, row.first_hold.desk.desk_name, $date(row.first_hold.waiting_date)))); + nodes += '
%s
'.format(_("Waiting at %s, %s since %s.".format(row.first_hold._strings.pickup_library_id.str, row.first_hold.desk.desk_name, $date(row.first_hold.waiting_date)))); } else { - nodes += '%s'.format(_("Waiting at %s since %s.".format(row.first_hold._strings.pickup_library_id.str, $date(row.first_hold.waiting_date)))); + nodes += '
%s
'.format(_("Waiting at %s since %s.".format(row.first_hold._strings.pickup_library_id.str, $date(row.first_hold.waiting_date)))); } [% IF Koha.Preference('canreservefromotherbranches') %] if ( row.first_hold.waiting_date || row.first_hold.priority == 1 ) { @@ -536,11 +536,11 @@ row.first_hold.patron.library = { name: libraries_names.get(row.first_hold.patron.library_id) }; let patron_to_html = $patron_to_html(row.first_hold.patron, { url: true, display_cardnumber: true, hide_patron_name }); - nodes += ' %s'.format(_("Hold for: %s").format(patron_to_html)); + nodes += '
%s
'.format(_("Hold for: %s").format(patron_to_html)); } [% END %] } else { - nodes += ' %s'.format(_("There is an item level hold on this item (priority = %s).").format(row.first_hold.priority)); + nodes += '
%s
'.format(_("There is an item level hold on this item (priority = %s).").format(row.first_hold.priority)); } } @@ -553,21 +553,21 @@ row.recall.patron.library = { name: libraries_names.get(row.recall.patron.library_id) }; let patron_to_html = $patron_to_html(row.recall.patron, {url: true, display_cardnumber: true, hide_patron_name }); - nodes += '%s'.format(_("Recalled by %s on %s").format(patron_to_html, $date(row.recall.created_date))) + nodes += '
%s
'.format(_("Recalled by %s on %s").format(patron_to_html, $date(row.recall.created_date))) } } [% END %] if ( ! ( row.not_for_loan_status || item_types_notforloan.get(row.item_type_id) || row.checked_out_date || row.lost_status || row.withdrawn || row.damaged_status || row.transfer || row.first_hold || ( row.recall && ( row.item_id === row.recall.item_id ) ) )) { - nodes += ' %s'.format(_("Available")) + nodes += '
%s
'.format(_("Available")) } if ( row.restricted_status ) { - nodes += '(%s)'.format(escape_str(av_restricted.get(row.restricted_status.toString()))); + nodes += '
(%s)
'.format(escape_str(av_restricted.get(row.restricted_status.toString()))); } if ( row.in_bundle ) { - nodes += '%s'.format(_("In bundle: %s").format($biblio_to_html(row.bundle_host.biblio, { link: true }))); + nodes += '
%s
'.format(_("In bundle: %s").format($biblio_to_html(row.bundle_host.biblio, { link: true }))); } return nodes; } -- 2.39.2