Bug 32300: Add page-section to cataloguing plugins (cat)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / value_builder / unimarc_field_146h.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Framework plugin unimarc_field_146h &rsaquo; Cataloguing &rsaquo; Koha</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 </head>
5
6 <body id="unimarc_field_146h" class="cat">
7     <div class="container-fluid">
8         <h1>Framework plugin for UNIMARC 146$h</h1>
9
10         <div class="page-section">
11             <form class="form-horizontal" id="form">
12                 <input type="hidden" id="id" name="id" value="[% id | html %]">
13
14                 <div class="form-group">
15                     <label for="number" class="col-sm-2 control-label">Number of parts</label>
16                     <div class="col-sm-10">
17                         <input type="text" inputmode="numeric" pattern="[0-9]{1,3}" id="number" name="number" title="a number between 0 and 999 (inclusive)" value="[% number | html %]">
18                         <p class="help-block">
19                             A number between 0 and 999 (inclusive)
20                         </p>
21                     </div>
22                 </div>
23                 <div class="form-group">
24                     <label for="category" class="col-sm-2 control-label">Category</label>
25                     <div class="col-sm-10">
26                         <select class="form-control" id="category">
27                             [% FOREACH option IN options %]
28                                 [% IF option.value == category %]
29                                     <option value="[% option.value | html %]" selected>[% option.label | html %]</option>
30                                 [% ELSE %]
31                                     <option value="[% option.value | html %]">[% option.label | html %]</option>
32                                 [% END %]
33                             [% END %]
34                         </select>
35                     </div>
36                 </div>
37
38                 <div class="form-group">
39                     <div class="col-sm-offset-2 col-sm-10">
40                         <button type="submit" class="btn btn-primary">OK</button>
41                         <a href="#" class="cancel close">Cancel</a>
42                     </div>
43                 </div>
44             </form>
45         </div> <!-- /.page-section -->
46     </div>
47
48     <script>
49         document.getElementById('form').addEventListener('submit', function (ev) {
50             ev.preventDefault();
51             const id = document.getElementById('id').value;
52             const number = document.getElementById('number').value;
53             const category = document.getElementById('category').value;
54             const value = number.toString().padStart(3, '0') + category;
55             opener.document.getElementById(id).value = value;
56             window.close();
57         });
58     </script>
59
60 [% INCLUDE 'popup-bottom.inc' %]