Koha/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt
Katrin Fischer 504f418957
Bug 31633: (QA follow-up) Add data-attribute for logged-in library
The class has some advantages, but I thought it would be nice to also
have the complete set of options in data-attributes.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-03 14:05:52 -03:00

60 lines
2.3 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Spine labels &rsaquo; Tools &rsaquo; Koha</title>
[% INCLUDE 'doc-head-close.inc' popup => 1 %]
[% Asset.css("css/spinelabel.css") | $raw %]
<style>
@media print {
.noprint { display: none; }
}
</style>
[% IF ( IntranetUserCSS ) %]<style>[% IntranetUserCSS | $raw %]</style>[% END %]
</head>
[% IF ( BarcodeNotFound ) %]
<body id="labels_spinelabel-print" class="tools labels">
<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" class="[% Branches.GetLoggedInBranchcode | html %]" data-loggedinbranch="[% Branches.GetLoggedInBranchcode | html %]" data-homebranch="[% itemhomebranch | html %]" data-holdingbranch="[% itemholdingbranch | html %]">
[% content | $raw %]
</div>
<div id="print_button" class="noprint">
<button class="btn btn-default print-label"><i class="fa fa-print"></i> Print this label</button>
<button class="btn btn-default edit-label"><i class="fa fa-lock"></i> Edit this label</button>
</div>
[% END %]
[% Asset.js( "lib/jquery/jquery-3.6.0.min.js" ) | $raw %]
[% Asset.js( "lib/jquery/jquery-migrate-3.3.2.min.js" ) | $raw %]
[% IF ( autoprint ) %]
[% INCLUDE 'slip-print.inc' #printThenClose %]
[% END %]
<script>
$(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();
});
$('.edit-label').click( function() {
$('#spinelabel').attr('contenteditable', function(index, attr){
return attr == 'true' ? null : 'true';
});
$('.edit-label .fa').toggleClass('fa-lock').toggleClass('fa-unlock');
});
});
</script>
[% INCLUDE 'popup-bottom.inc' %]