From 30e393ef6e1bc79c113dc7ce4b1f5abcbe3d697e Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 31 Dec 2024 15:27:18 +0000 Subject: [PATCH] Bug 35604: (QA follow-up): Cosmetic improvements These are improvements to the confirm auto backend stage screen on the Staff UI. Result of a chat with Tomas about this development. --- .../prog/en/modules/ill/ill-requests.tt | 4 +- .../intranet-tmpl/prog/js/ill-autobackend.js | 61 +++++++++++-------- 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index 47728a7c7cd..85cf2aeba6f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -1014,8 +1014,8 @@
-

Confirm backend:

-

+
    +

diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js b/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js index b06557b47fc..75ed10221d9 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js @@ -86,45 +86,46 @@ $(document).ready(function () { function _addSuccessMessage(auto_backend_name, data) { _removeVerifyingMessage(auto_backend_name); - $(auto_ill_el + " > #backend-" + auto_backend_name).append( - ' ' + - __("Available.").format(auto_backend_name) + " " + data.success + - "" + $(auto_ill_el + " > #backend-" + auto_backend_name + " #backendcol").append( + '
' + + "" + __("Available.") + "
" + data.success + + "
" ); } function _addErrorMessage(auto_backend_name, message) { _removeVerifyingMessage(auto_backend_name); - $(auto_ill_el + " > #backend-" + auto_backend_name).append( - ' ' + - __("Not readily available:").format(auto_backend_name) + - " " + + $(auto_ill_el + " > #backend-" + auto_backend_name + " #backendcol").append( + '
' + + "" + __("Not readily available:") + "
" + message + - "" + "
" ); $(auto_ill_el + " > #backend-" + auto_backend_name + " input[type=\"radio\"]").prop("disabled", true); } function _addBackendOption(auto_backend_name) { $(auto_ill_el + " > #backend-" + auto_backend_name).append( - ' ' + - ' " + `` ); } function _addVerifyingMessage(auto_backend_name) { - $(auto_ill_el + " > #backend-" + auto_backend_name).append( - ' ' + - __("Verifying availability...").format(auto_backend_name) + - "" + $(auto_ill_el + " > #backend-" + auto_backend_name + " #backendcol").append( + '
' + + __("Verifying availability...") + + "
" ); } function _removeVerifyingMessage(auto_backend_name) { @@ -141,7 +142,7 @@ $(document).ready(function () { '#confirmautoill-form #autoillbackends input[id="' + auto_backend_name + '"]' - ).prop("checked", true); + ).prop("checked", true).trigger('change'); $(auto_ill_message_el).html( __( "The recommended backend for your request is %s." @@ -161,4 +162,16 @@ $(document).ready(function () { ); $(auto_ill_message_el).html(__("Fetching backends availability...")); } + + $('#confirmautoill-form').on('change', 'input[name="backend"]', function() { + $('input[name="backend"]').closest('.list-group-item').removeClass('bg-success').css({ + 'background-color': '', + 'border': '' + }); + $(this).closest('.list-group-item').css({ + 'background-color': 'rgba(0, 128, 0, 0.1)', + 'border': '1px solid rgba(0, 128, 0, 0.7)' + }); + }); + }); -- 2.39.5