Bug 23464: (follow-up) QA fixes

This patch corrects two issues raised during testing:

 - Move JavaScript out of template check for IntranetUserJS so that
   SpineLabelAutoPrint behavior works correctly.
 - Add "close" button to pop-up window for cases when the barcode was
   not found.

Also changed:

- Added "required" attribute to barcode input on quick spine
  label printing page so that submitting an empty form will not work.

- Tweaked CSS slightly to fix alignment of spine label form and submit
  button. (You must rebuild the staff client CSS:
 https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Owen Leonard 2019-08-22 18:55:21 +00:00 committed by Martin Renvoize
parent efd4121941
commit e4e5f96ffb
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
3 changed files with 29 additions and 20 deletions

View File

@ -706,6 +706,10 @@ fieldset {
text-align: left;
}
}
.action {
margin-left: 1em;
}
}
&.rows {

View File

@ -21,7 +21,7 @@
<fieldset class="brief">
<ol>
<li><label for="barcode">Barcode: </label>
<input type="text" name="barcode" id="barcode" class="focus" />
<input type="text" name="barcode" id="barcode" class="focus" required="required" />
</li>
</ol>
<fieldset class="action"><input type="submit" value="View spine label" /></fieldset>

View File

@ -15,34 +15,39 @@
[% IF ( BarcodeNotFound ) %]
<body id="labels_spinelabel-print" class="tools labels">
<p>The barcode [% Barcode | html %] was not found.</p>
<p><a href="spinelabel-home.pl">Return to spine label printer</a></p>
<div class="dialog message">The barcode [% Barcode | html %] was not found.</div>
<div id="print_button" class="noprint">
<button class="btn btn-default close-window">Close</button>
</div>
[% ELSE %]
<body id="labels_spinelabel-print" class="tools labels">
<div id="spinelabel">
[% content | $raw %]
</div>
<div id="print_button" class="noprint">
<button class="btn btn-default print-label" onclick="window.print()"><i class="fa fa-print"></i> Print this label</button>
<button class="btn btn-default print-label"><i class="fa fa-print"></i> Print this label</button>
</div>
[% END %]
[% IF ( IntranetUserJS ) %]
[% Asset.js( "lib/jquery/jquery-2.2.3.min.js" ) | $raw %]
[% Asset.js( "lib/jquery/jquery-migrate-1.3.0.min.js" ) | $raw %]
[% IF ( autoprint ) %]
[% INCLUDE 'slip-print.inc' #printThenClose %]
[% END %]
<script>
[% IntranetUserJS | $raw %]
$(document).ready(function(){
$(".print-label").on("click", function(e){
e.preventDefault();
window.print();
window.close();
});
});
</script>
[% Asset.js( "lib/jquery/jquery-2.2.3.min.js" ) | $raw %]
[% Asset.js( "lib/jquery/jquery-migrate-1.3.0.min.js" ) | $raw %]
[% IF ( autoprint ) %]
[% INCLUDE 'slip-print.inc' #printThenClose %]
[% END %]
<script>
[% IntranetUserJS | $raw %]
$(document).ready(function(){
$(".print-label").on("click", function(e){
e.preventDefault();
window.print();
window.close();
});
$(".close-window").on("click", function(e){
e.preventDefault();
window.close();
});
});
</script>
[% INCLUDE 'popup-bottom.inc' %]