Bug 31417: Update and reference cat-menu.inc
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / spinelabel-print.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Branches %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Spine labels &rsaquo; Tools &rsaquo; Koha</title>
7 [% INCLUDE 'doc-head-close.inc' popup => 1 %]
8 [% Asset.css("css/spinelabel.css") | $raw %]
9 <style>
10     @media print {
11         .noprint { display: none; }
12     }
13 </style>
14 [% IF ( IntranetUserCSS ) %]<style>[% IntranetUserCSS | $raw %]</style>[% END %]
15 </head>
16
17         [% IF ( BarcodeNotFound ) %]
18                 <body id="labels_spinelabel-print" class="tools labels">
19             <div class="dialog message">The barcode [% Barcode | html %] was not found.</div>
20             <div id="print_button" class="noprint">
21                 <button class="btn btn-default close-window">Close</button>
22             </div>
23         [% ELSE %]
24             <body id="labels_spinelabel-print" class="tools labels">
25             <div id="spinelabel" class="[% Branches.GetLoggedInBranchcode | html %]" data-loggedinbranch="[% Branches.GetLoggedInBranchcode | html %]" data-homebranch="[% itemhomebranch | html %]" data-holdingbranch="[% itemholdingbranch | html %]">
26                 [% content | $raw %]
27             </div>
28             <div id="print_button" class="noprint">
29                 <button class="btn btn-default print-label"><i class="fa fa-print"></i> Print this label</button>
30                 <button class="btn btn-default edit-label"><i class="fa fa-lock"></i> Edit this label</button>
31             </div>
32         [% END %]
33
34 [% Asset.js( "lib/jquery/jquery-3.6.0.min.js" ) | $raw %]
35 [% Asset.js( "lib/jquery/jquery-migrate-3.3.2.min.js" ) | $raw %]
36 [% IF ( autoprint ) %]
37     [% INCLUDE 'slip-print.inc' #printThenClose %]
38 [% END %]
39 <script>
40     $(document).ready(function(){
41         $(".print-label").on("click", function(e){
42             e.preventDefault();
43             window.print();
44             window.close();
45         });
46
47         $(".close-window").on("click", function(e){
48             e.preventDefault();
49             window.close();
50         });
51         $('.edit-label').click( function() {
52                 $('#spinelabel').attr('contenteditable', function(index, attr){
53                     return attr == 'true' ? null : 'true';
54                 });
55                 $('.edit-label .fa').toggleClass('fa-lock').toggleClass('fa-unlock');
56         });
57     });
58 </script>
59
60 [% INCLUDE 'popup-bottom.inc' %]