From 0e4a0b9e87e014ed779c1d7e92656972b6b68d83 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 5 Apr 2022 13:49:53 +0000 Subject: [PATCH] Bug 30457: Convert holds page tabs to Bootstrap This patch updates the holds page to replace jQueryUI tabs with Bootstrap. To test, apply the patch and begin the process of placing a hold on a title in the catalog. If you have one or more patron clubs configured: - You should see two tabs, Patrons and Clubs. - Both should look correct and work correctly. - The Patrons tab should be selected initially, with cursor focus in the form field. - Switch to the Clubs tab. The cursor focus should move to the form field under this tab. - Submit a club search which will return results. - The page should refresh and the clubs tab should be preselected, showing the search results. If you have no patron clubs configured, the page should show only the Patrons tab. Signed-off-by: Lucas Gass Signed-off-by: Martin Renvoize --- .../prog/en/modules/reserve/request.tt | 63 ++++++++++--------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 82cc777950..c1a6b751f4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -160,33 +160,35 @@ [% END %] [% END %]
-
    -
  • Patrons
  • + -
    - [% PROCESS patron_search_filters_simple %] +
    +
    + [% PROCESS patron_search_filters_simple %] - [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %] -
    - [% IF clubcount %] -
    -
    -
    Enter club ID or partial name:
    - - - [% FOREACH biblionumber IN biblionumbers %] - - [% END %] - -
    - [% IF clubs %] - [% INCLUDE 'clubs-table.inc' destination = "holds" %] - [% END %] + [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %]
    - [% END %] + [% IF clubcount %] +
    +
    +
    Enter club ID or partial name:
    + + + [% FOREACH biblionumber IN biblionumbers %] + + [% END %] + +
    + [% IF clubs %] + [% INCLUDE 'clubs-table.inc' destination = "holds" %] + [% END %] +
    + [% END %] +
    [% ELSIF club %] @@ -1192,15 +1194,16 @@ }); [% SET active = clubs ? 1 : 0 %] - $('#circ_holds_select').tabs({ - active: [% active | $raw %], - activate: function(){ - $(this).find("input.focus").focus(); - }, - create: function(){ - $(this).find("input.focus").focus(); - } + /* Set active tab based on whether a club search was submitted */ + var tabs = $("#circ_holds_select li:eq(" + [% active | $raw %] + ") a").tab("show"); + $( tabs[0].hash ).find("input.focus").focus(); + + /* Change active focus when tabs change */ + $("#circ_holds_select a[data-toggle='tab']").on("shown.bs.tab", function (e) { + active_tab = e.target.hash; + $( active_tab ).find("input.focus").focus(); }); + function ToggleHoldsToPlace() { if ( $("#requestany").prop('checked') ) { $("#holds_to_place_count").prop('disabled', false); -- 2.20.1