Bug 30434: Convert catalog merge page tabs to Bootstrap

This patch updates the catalog merge template so that it uses Bootstrap
tabs instead of jQueryUI. Some JavaScript is modified to accommodate the
new DOM structure.

The patch also makes a minor HTML correction, adding a missing "</ol>".

To test, apply the patch and search the catalog in the staff client.

- In the search results, check the checkbox for two records.
- Choose Edit -> Merge records.
- Click next to accept the merge reference selection.
- On the next page you should see two tabs under "Source records."
  Confirm that they work correctly.
- All checkboxes in the first tab should be checked by default.
- Confirm that tag and subfield selection still works correctly.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Owen Leonard 2022-04-01 14:30:49 +00:00 committed by Fridolin Somers
parent 043221cbc2
commit 72732fad0e
1 changed files with 8 additions and 6 deletions

View File

@ -31,6 +31,7 @@ div#result { margin-top: 1em; }
Merging records
</a>
</li>
</ol>
</nav>
<div class="main container-fluid">
@ -289,13 +290,14 @@ div#result { margin-top: 1em; }
rebuild_target($("#tabs"), $("#resultul"));
});
// Creating tabs
$("#tabs").tabs();
if( $(".tab-pane.active").length < 1 ){
$("#tabs a:first").tab("show");
}
// Check all checkboxes in first tab, and uncheck all others to avoid
// inconsistencies from a page refresh.
$('#tabs div#tabrecord[% ref_biblionumber | html %]').find('input[type="checkbox"]').prop('checked', true);
$('#tabs > div:not("#tabrecord[% ref_biblionumber | html %]")').find('input[type="checkbox"]').prop('checked', false);
// Uncheck all checkboxes in both tabs, then check all checkboxes in first tab
// to avoid inconsistencies from a page refresh.
$("#tabs input[type='checkbox']").prop("checked", false);
$("#tabrecord[% ref_biblionumber | html %] input[type='checkbox']").prop("checked", true );
//Set focus to cataloging search
$("input[name=q]:eq(0)").focus();