View | Details | Raw Unified | Return to bug 35604
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-2 / +2 lines)
Lines 1014-1021 Link Here
1014
                    <div id="results" class="page-section">
1014
                    <div id="results" class="page-section">
1015
                        <form method="post" id="confirmautoill-form">
1015
                        <form method="post" id="confirmautoill-form">
1016
                            <fieldset class="rows">
1016
                            <fieldset class="rows">
1017
                                <h3>Confirm backend:</h3>
1017
                                <ul class="list-group" id="autoillbackends">
1018
                                <p id="autoillbackends"></p>
1018
                                </ul>
1019
                                <p id="autoillbackend-message" class="text-info"></p>
1019
                                <p id="autoillbackend-message" class="text-info"></p>
1020
                            </fieldset>
1020
                            </fieldset>
1021
                            <fieldset class="action">
1021
                            <fieldset class="action">
(-)a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js (-25 / +37 lines)
Lines 86-130 $(document).ready(function () { Link Here
86
86
87
    function _addSuccessMessage(auto_backend_name, data) {
87
    function _addSuccessMessage(auto_backend_name, data) {
88
        _removeVerifyingMessage(auto_backend_name);
88
        _removeVerifyingMessage(auto_backend_name);
89
        $(auto_ill_el + " > #backend-" + auto_backend_name).append(
89
        $(auto_ill_el + " > #backend-" + auto_backend_name + " #backendcol").append(
90
            '<span class="text-success"><i class="fa-solid fa-check"></i> ' +
90
            '<div class="text-success mb-2"><i class="fa-solid fa-check"></i> ' +
91
                __("Available.").format(auto_backend_name) + " " + data.success +
91
                "<strong>" + __("Available.") + "</strong><br>" + data.success +
92
                "</span>"
92
                "</div>"
93
        );
93
        );
94
    }
94
    }
95
95
96
    function _addErrorMessage(auto_backend_name, message) {
96
    function _addErrorMessage(auto_backend_name, message) {
97
        _removeVerifyingMessage(auto_backend_name);
97
        _removeVerifyingMessage(auto_backend_name);
98
        $(auto_ill_el + " > #backend-" + auto_backend_name).append(
98
        $(auto_ill_el + " > #backend-" + auto_backend_name + " #backendcol").append(
99
            '<span class="text-danger"> <i class="fa-solid fa-xmark"></i> ' +
99
            '<div class="text-danger mb-2"> <i class="fa-solid fa-xmark"></i> ' +
100
                __("Not readily available:").format(auto_backend_name) +
100
                "<strong>" + __("Not readily available:") + "</strong><br>" +
101
                " " +
102
                message +
101
                message +
103
                "</span>"
102
                "</div>"
104
        );
103
        );
105
        $(auto_ill_el + " > #backend-" + auto_backend_name + " input[type=\"radio\"]").prop("disabled", true);
104
        $(auto_ill_el + " > #backend-" + auto_backend_name + " input[type=\"radio\"]").prop("disabled", true);
106
    }
105
    }
107
106
108
    function _addBackendOption(auto_backend_name) {
107
    function _addBackendOption(auto_backend_name) {
109
        $(auto_ill_el + " > #backend-" + auto_backend_name).append(
108
        $(auto_ill_el + " > #backend-" + auto_backend_name).append(
110
            ' <input type="radio" id="' +
109
            `<label style="text-align:left; width:100%;font-weight:normal;" for="${auto_backend_name}">
111
                auto_backend_name +
110
                <li class="list-group-item">
112
                '" name="backend" value="' +
111
                    <div class="row">
113
                auto_backend_name +
112
                        <div class="col-sm-auto">
114
                '">' +
113
                            <input id="${auto_backend_name}" type="radio" name="backend" value="${auto_backend_name}" aria-label="${auto_backend_name}">
115
                ' <label for="' +
114
                        </div>
116
                auto_backend_name +
115
                        <div id="backendcol" class="col">
117
                '" class="radio">' +
116
                            <div class="mb-2 fs-3"><strong>${auto_backend_name}</strong></div>
118
                auto_backend_name +
117
                        </div>
119
                "</label> "
118
                    </div>
119
                </li>
120
            </label>`
120
        );
121
        );
121
    }
122
    }
122
123
123
    function _addVerifyingMessage(auto_backend_name) {
124
    function _addVerifyingMessage(auto_backend_name) {
124
        $(auto_ill_el + " > #backend-" + auto_backend_name).append(
125
        $(auto_ill_el + " > #backend-" + auto_backend_name + " #backendcol").append(
125
            '<span id="verifying-availabilty" class="text-info"><i id="issues-table-load-delay-spinner" class="fa fa-spinner fa-pulse fa-fw"></i> ' +
126
            '<div id="verifying-availabilty" class="text-info mb-2"><i id="issues-table-load-delay-spinner" class="fa fa-spinner fa-pulse fa-fw"></i> ' +
126
                __("Verifying availability...").format(auto_backend_name) +
127
                __("Verifying availability...") +
127
                "</span>"
128
                "</div>"
128
        );
129
        );
129
    }
130
    }
130
    function _removeVerifyingMessage(auto_backend_name) {
131
    function _removeVerifyingMessage(auto_backend_name) {
Lines 141-147 $(document).ready(function () { Link Here
141
            '#confirmautoill-form #autoillbackends input[id="' +
142
            '#confirmautoill-form #autoillbackends input[id="' +
142
                auto_backend_name +
143
                auto_backend_name +
143
                '"]'
144
                '"]'
144
        ).prop("checked", true);
145
        ).prop("checked", true).trigger('change');
145
        $(auto_ill_message_el).html(
146
        $(auto_ill_message_el).html(
146
            __(
147
            __(
147
                "The recommended backend for your request is <strong>%s</strong>."
148
                "The recommended backend for your request is <strong>%s</strong>."
Lines 161-164 $(document).ready(function () { Link Here
161
        );
162
        );
162
        $(auto_ill_message_el).html(__("Fetching backends availability..."));
163
        $(auto_ill_message_el).html(__("Fetching backends availability..."));
163
    }
164
    }
165
166
    $('#confirmautoill-form').on('change', 'input[name="backend"]', function() {
167
        $('input[name="backend"]').closest('.list-group-item').removeClass('bg-success').css({
168
            'background-color': '',
169
            'border': ''
170
        });
171
        $(this).closest('.list-group-item').css({
172
            'background-color': 'rgba(0, 128, 0, 0.1)',
173
            'border': '1px solid rgba(0, 128, 0, 0.7)'
174
        });
175
    });
176
164
});
177
});
165
- 

Return to bug 35604