Bugzilla – Attachment 175850 Details for
Bug 38767
Statuses in the holdings table should be divs not spans
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38767: Convert each status element in holdings table from span to div
Bug-38767-Convert-each-status-element-in-holdings-.patch (text/plain), 9.47 KB, created by
Lucas Gass (lukeg)
on 2024-12-20 17:43:41 UTC
(
hide
)
Description:
Bug 38767: Convert each status element in holdings table from span to div
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-12-20 17:43:41 UTC
Size:
9.47 KB
patch
obsolete
>From 32d8a82356411373d0443add0ab9c183a00c9e08 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >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 += '<span>'; >+ nodes += '<div>'; > 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 += "</span>" >+ nodes += "</div>" > } else if ( row.transfer ) { > if ( row.transfer.datesent ) { >- nodes += '<span class="intransit">%s</span>'.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 += '<div class="intransit">%s</div>'.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 += '<span class="transitrequested">%s</span>'.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 += '<div class="transitrequested">%s</div>'.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 += '<span class="lost">%s</span>'.format(escape_str(lost_lib)); >+ nodes += '<div class="lost">%s</div>'.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 += '<span class="wdn">%s</span>'.format(escape_str(withdrawn_lib)); >+ nodes += '<div class="wdn">%s</div>'.format(escape_str(withdrawn_lib)); > } > > if ( row.damaged_status ) { > let damaged_lib = av_damaged.get(row.damaged_status.toString()) || _("Damaged"); >- nodes += '<span class="dmg">%s</span>'.format(escape_str(damaged_lib)); >+ nodes += '<div class="dmg">%s</div>'.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 += '<span class="notforloan">%s'.format(_("Not for loan")) + ( not_for_loan_lib ? '<span class="reason"> (%s)</span>'.format(escape_str(not_for_loan_lib)) : '' ) + '</span>'; >+ nodes += '<div class="notforloan">%s'.format(_("Not for loan")) + ( not_for_loan_lib ? '<span class="reason"> (%s)</span>'.format(escape_str(not_for_loan_lib)) : '' ) + '</div>'; > } > > if ( row.first_hold ) { > if ( row.first_hold.waiting_date ) { > if ( row.first_hold.desk ) { >- nodes += '<span class="waitingat">%s</span>'.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 += '<div class="waitingat">%s</div>'.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 += '<span class="waitingat">%s</span>'.format(_("Waiting at %s since %s.".format(row.first_hold._strings.pickup_library_id.str, $date(row.first_hold.waiting_date)))); >+ nodes += '<div class="waitingat">%s</div>'.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 += ' <span class="heldfor">%s</span>'.format(_("Hold for: %s").format(patron_to_html)); >+ nodes += ' <div class="heldfor">%s</div>'.format(_("Hold for: %s").format(patron_to_html)); > } > [% END %] > } else { >- nodes += ' <span class="holdonitem">%s</span>'.format(_("There is an item level hold on this item (priority = %s).").format(row.first_hold.priority)); >+ nodes += ' <div class="holdonitem">%s</div>'.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 += '<span>%s</span>'.format(_("Recalled by %s on %s").format(patron_to_html, $date(row.recall.created_date))) >+ nodes += '<div>%s</div>'.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 += ' <span>%s</span>'.format(_("Available")) >+ nodes += ' <div>%s</div>'.format(_("Available")) > } > > if ( row.restricted_status ) { >- nodes += '<span class="restricted">(%s)</span>'.format(escape_str(av_restricted.get(row.restricted_status.toString()))); >+ nodes += '<div class="restricted">(%s)</div>'.format(escape_str(av_restricted.get(row.restricted_status.toString()))); > } > > if ( row.in_bundle ) { >- nodes += '<span class="bundled">%s</span>'.format(_("In bundle: %s").format($biblio_to_html(row.bundle_host.biblio, { link: true }))); >+ nodes += '<div class="bundled">%s</div>'.format(_("In bundle: %s").format($biblio_to_html(row.bundle_host.biblio, { link: true }))); > } > return nodes; > } >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38767
: 175850