Bug 32914: Use template wrapper for batch record deletion and modification templates
This patch updates the batch record modification and batch record deletion templates to replace tab markup with the use of WRAPPERs. This patch adds a "clearfix" snippet of CSS to _mixins.scss copied from Bootstrap. Applied to the active tab pane, this helps in situations where Bootstrap tabs follow a floated element. The patch also wraps tab label strings in <span> to ensure they can be translated. Unrelated: The patch removes an extra </option> from the batch record modification template. To test you should have at least one list and at least one MARC modification template defined. - Apply the patch and go to Cataloging -> Batch record modification - You should see three tabs, "Upload a file," "Select a list of records," and "Enter a list of record numbers." - The tabs should look correct and work correctly. - Checking the "Authorities" radio button should hide the lists tab. - Test that submissions from each form work correctly. - Go to Cataloging -> Batch record deletion and perform the same tests. Signed-off-by: Philip Orr <philip.orr@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
8b1a5e34a7
commit
3c2eb1da53
4 changed files with 89 additions and 94 deletions
|
@ -76,3 +76,12 @@ $nav-menu-bullet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/s
|
|||
background-color: white;
|
||||
}
|
||||
}
|
||||
|
||||
/* Copied from Bootstrap 5 */
|
||||
@mixin clearfix() {
|
||||
&::after {
|
||||
clear: both;
|
||||
content: "";
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4313,6 +4313,12 @@ div .suggestion_note {
|
|||
margin: .5em;
|
||||
}
|
||||
|
||||
.tab-pane {
|
||||
&.active {
|
||||
@include clearfix();
|
||||
}
|
||||
}
|
||||
|
||||
@import "header";
|
||||
@import "toolbar";
|
||||
@import "forms";
|
||||
|
|
|
@ -64,65 +64,55 @@
|
|||
</ol>
|
||||
</fieldset>
|
||||
|
||||
<div id="batch_del_form" class="toptabs">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a href="#uploadfile_tab" aria-controls="uploadfile_tab" role="tab" data-toggle="tab">Upload a file</a>
|
||||
</li>
|
||||
[% IF lists.count %]
|
||||
<li id="show_list_option" role="presentation">
|
||||
<a href="#shelves_tab" aria-controls="shelves_tab" role="tab" data-toggle="tab">Select a list of records</a>
|
||||
</li>
|
||||
[% END %]
|
||||
<li role="presentation">
|
||||
<a href="#enterlist_tab" aria-controls="enterlist_tab" role="tab" data-toggle="tab">Enter a list of record numbers</a>
|
||||
</li>
|
||||
</ul>
|
||||
[% WRAPPER tabs id= "batch_del_form" %]
|
||||
[% WRAPPER tabs_nav %]
|
||||
[% WRAPPER tab_item tabname= "uploadfile_tab" bt_active= 1 %] <span>Upload a file</span> [% END %]
|
||||
[% IF lists.count %]
|
||||
[% WRAPPER tab_item tabname= "shelves_tab" %] <span>Select a list of records</span> [% END %]
|
||||
[% END %]
|
||||
[% WRAPPER tab_item tabname= "enterlist_tab" %] <span>Enter a list of record numbers</span> [% END %]
|
||||
[% END # /WRAPPER tabs_nav %]
|
||||
|
||||
<div class="tab-content">
|
||||
<div id="uploadfile_tab" role="tabpanel" class="tab-pane active">
|
||||
<fieldset class="rows">
|
||||
<ol>
|
||||
<li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
[% WRAPPER tab_panels %]
|
||||
[% WRAPPER tab_panel tabname="uploadfile_tab" bt_active= 1 %]
|
||||
<fieldset class="rows">
|
||||
<ol>
|
||||
<li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
[% END # /WRAPPER tab_panel %]
|
||||
|
||||
[% IF lists.count %]
|
||||
<div id="shelves_tab" role="tabpanel" class="tab-pane">
|
||||
<fieldset class="rows">
|
||||
<ol>
|
||||
<li>
|
||||
<label for="shelf_number">List: </label>
|
||||
<select name="shelf_number" id="shelf_number">
|
||||
<option value="">Select a list</option>
|
||||
[% FOREACH list IN lists %]
|
||||
<option value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
|
||||
[% END %]
|
||||
</select>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
[% END %]
|
||||
[% IF lists.count %]
|
||||
[% WRAPPER tab_panel tabname="shelves_tab" %]
|
||||
<fieldset class="rows">
|
||||
<ol>
|
||||
<li>
|
||||
<label for="shelf_number">List: </label>
|
||||
<select name="shelf_number" id="shelf_number">
|
||||
<option value="">Select a list</option>
|
||||
[% FOREACH list IN lists %]
|
||||
<option value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
|
||||
[% END %]
|
||||
</select>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
[% END # /WRAPPER tab_panel %]
|
||||
[% END # /IF lists.count %]
|
||||
|
||||
<div id="enterlist_tab" role="tabpanel" class="tab-pane">
|
||||
<fieldset class="rows">
|
||||
<ol>
|
||||
<li>
|
||||
<label for="recordnumber_list">IDs: </label>
|
||||
<textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea>
|
||||
<div class="hint">Enter a list of biblionumbers or authority IDs, one per line.</div>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!-- /.tab-content -->
|
||||
</div>
|
||||
[% WRAPPER tab_panel tabname="enterlist_tab" %]
|
||||
<fieldset class="rows">
|
||||
<ol>
|
||||
<li>
|
||||
<label for="recordnumber_list">IDs: </label>
|
||||
<textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea>
|
||||
<div class="hint">Enter a list of biblionumbers or authority IDs, one per line.</div>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
[% END # /WRAPPER tab_panel %]
|
||||
[% END # /WRAPPER tab_panels %]
|
||||
[% END # /WRAPPER tabs %]
|
||||
|
||||
<fieldset class="action">
|
||||
<input type="hidden" name="op" value="list" />
|
||||
|
@ -233,13 +223,14 @@
|
|||
var MSG_CANNOT_BE_DELETED = _("This record cannot be deleted, at least one item is currently checked out.");
|
||||
$(document).ready(function() {
|
||||
|
||||
$("input[type='radio']").click(function(){
|
||||
if ($(this).attr('id') == 'authority_type') {
|
||||
$("#show_list_option").hide();
|
||||
} else if ($(this).attr('id') == 'biblio_type') {
|
||||
$("#show_list_option").show();
|
||||
}
|
||||
});
|
||||
$("input[type='radio']").click(function() {
|
||||
if ($(this).attr('id') == 'authority_type') {
|
||||
$("a[href='#shelves_tab_panel']").parent().hide();
|
||||
} else if ($(this).attr('id') == 'biblio_type') {
|
||||
$("a[href='#shelves_tab_panel']").parent().show();
|
||||
}
|
||||
});
|
||||
|
||||
$("#selectall").click(function(e){
|
||||
e.preventDefault();
|
||||
$(".records input[type='checkbox']:not(:disabled)").each(function(){
|
||||
|
|
|
@ -81,33 +81,26 @@
|
|||
|
||||
<br><br>
|
||||
|
||||
<div id="batch_mod_form" class="toptabs" style="clear:both">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a href="#uploadfile_tab" aria-controls="uploadfile_tab" role="tab" data-toggle="tab">Upload a file</a>
|
||||
</li>
|
||||
[% WRAPPER tabs id= "batch_mod_form" %]
|
||||
[% WRAPPER tabs_nav %]
|
||||
[% WRAPPER tab_item tabname= "uploadfile_tab" bt_active= 1 %] <span>Upload a file</span> [% END %]
|
||||
[% IF lists.count %]
|
||||
<li id="show_list_option">
|
||||
<a href="#shelves_tab" aria-controls="shelves_tab" role="tab" data-toggle="tab">Select a list of records</a>
|
||||
</li>
|
||||
[% WRAPPER tab_item tabname= "shelves_tab" %] <span>Select a list of records</span> [% END %]
|
||||
<!-- <li id="show_list_option"> -->
|
||||
[% END %]
|
||||
<li role="presentation">
|
||||
<a href="#enterlist_tab" aria-controls="enterlist_tab" role="tab" data-toggle="tab">Enter a list of record numbers</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div id="uploadfile_tab" role="tabpanel" class="tab-pane active">
|
||||
[% WRAPPER tab_item tabname= "enterlist_tab" %] <span>Enter a list of record numbers</span> [% END %]
|
||||
[% END # /WRAPPER tabs_nav %]
|
||||
[% WRAPPER tab_panels %]
|
||||
[% WRAPPER tab_panel tabname="uploadfile_tab" bt_active= 1 %]
|
||||
<fieldset class="rows">
|
||||
<ol>
|
||||
<li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
[% END # /tab_panel %]
|
||||
|
||||
[% IF lists.count %]
|
||||
<div id="shelves_tab" role="tabpanel" class="tab-pane">
|
||||
[% WRAPPER tab_panel tabname="shelves_tab" %]
|
||||
<fieldset class="rows">
|
||||
<ol>
|
||||
<li>
|
||||
|
@ -117,16 +110,13 @@
|
|||
[% FOREACH list IN lists %]
|
||||
<option value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
|
||||
[% END %]
|
||||
</option>
|
||||
</select>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
[% END # /tab_panel %]
|
||||
[% END %]
|
||||
|
||||
<div id="enterlist_tab" role="tabpanel" class="tab-pane">
|
||||
[% WRAPPER tab_panel tabname="enterlist_tab" %]
|
||||
<fieldset class="rows">
|
||||
<ol>
|
||||
<li>
|
||||
|
@ -136,10 +126,9 @@
|
|||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
</div> <!-- /.tab-content -->
|
||||
</div> <!-- /#batch_mod_form -->
|
||||
[% END # /tab_panel %]
|
||||
[% END # /WRAPPER tab_panels %]
|
||||
[% END # /WRAPPER tabs %]
|
||||
|
||||
<fieldset class="rows">
|
||||
<legend>MARC modification template</legend>
|
||||
|
@ -300,9 +289,9 @@
|
|||
|
||||
$("input[type='radio']").click(function() {
|
||||
if ($(this).attr('id') == 'authority_type') {
|
||||
$("#show_list_option").hide();
|
||||
$("a[href='#shelves_tab_panel']").parent().hide();
|
||||
} else if ($(this).attr('id') == 'biblio_type') {
|
||||
$("#show_list_option").show();
|
||||
$("a[href='#shelves_tab_panel']").parent().show();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -356,10 +345,10 @@
|
|||
|
||||
$("#record_ids_selection").on("submit", function(e) {
|
||||
var tab = $(this).find('#batch_mod_form li.active:first a').attr('href');
|
||||
if (tab == '#uploadfile_tab') {
|
||||
if (tab == '#uploadfile_tab_panel') {
|
||||
$("#shelf_number").empty('');
|
||||
$("#recordnumber_list").val('');
|
||||
} else if (tab == '#shelves_tab') {
|
||||
} else if (tab == '#shelves_tab_panel') {
|
||||
$("#uploadfile").val('')
|
||||
$("#recordnumber_list").val('');
|
||||
} else { // enterlist
|
||||
|
|
Loading…
Reference in a new issue