From 6ce700923e682f17d3856a9bf5acd75b5033d6ec Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 17 Sep 2021 15:15:55 +0000 Subject: [PATCH] Bug 28537: (follow-up) Correct and improve OverDrive checkout modal This patch corrects the markup of the modal which is displayed when the user clicks the "Download as" button in their list of OverDrive checkouts. The modal markup had not been updated in the conversion to Bootstrap 4. I have also modified the markup generated when listing the download format options so that they use some standard Bootstrap 4 classes, improving the layout a little. To test you must have valid credentials entered in system preferences for the OverDrive API. You should test using a patron who has holds and current checkouts in OverDrive. Apply the patch and log in to the OPAC. - On the "Your summary" page, open the "OverDrive Account" tab. - Log in to your OverDrive account. - In the list of current checkouts, click the "Download as" button for one of the titles. - A modal window should display with a list of radio buttons for each available format. - Confirm that the format text acts as the label for the radio button. - Confirm that closing the modal without making a selection works correctly. - Confirm that making a selection and submitting the form closes the modal and submits your choice. Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- .../en/includes/overdrive-checkout.inc | 42 ++++++++++--------- koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js | 13 +++--- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/overdrive-checkout.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/overdrive-checkout.inc index fc5766998c..17f734d10d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/overdrive-checkout.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/overdrive-checkout.inc @@ -1,19 +1,23 @@ - + diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js b/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js index 8912692235..f71fd13fae 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js @@ -413,13 +413,14 @@ KOHA.OverDriveCirculation = new function() { return false; } - var checkout_format_list = checkout_popup.find("ul.overdrive-format-list").empty(); + var checkout_format_list = checkout_popup.find("#overdrive-format-list").empty(); formats.forEach(function (item) { - var li = $('
  • ').appendTo(checkout_format_list); - $('') - .val(item) - .appendTo(li); - li.append(item); + var line = $("
    ").addClass("form-check"); + var input = ' '; + var label = '"'; + $(input).appendTo( line ); + $(label).appendTo( line ); + line.appendTo( checkout_format_list ); }); checkout_popup.modal("show"); checkout_popup.find(".overdrive-checkout-submit").click(function(e) { -- 2.39.5