Bug 30952: Staff interface redesign (header)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / label-edit-template.tt
1 [% USE raw %]
2 [% SET footerjs = 1 %]
3     [% INCLUDE 'doc-head-open.inc' %]
4     <title>[% IF ( template_id ) %]Edit label template [% template_id | html %] [% ELSE %] New label template [% END %] &rsaquo; Templates &rsaquo; Label creator &rsaquo; Tools &rsaquo; Koha</title>
5     [% INCLUDE 'doc-head-close.inc' %]
6 </head>
7
8 <body id="labels_label-edit-template" class="tools labels">
9     [% WRAPPER 'header.inc' %]
10     [% INCLUDE 'cat-search.inc' %]
11 [% END %]
12
13     [% WRAPPER 'sub-header.inc' %]
14     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
15         <ol>
16             <li>
17                 <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
18             </li>
19             <li>
20                 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
21             </li>
22             <li>
23                 <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a>
24             </li>
25             <li>
26                 <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=template">Templates</a>
27             </li>
28             <li>
29                 <a href="#" aria-current="page">
30                     [% IF ( template_id ) %]
31                         Edit label template [% template_id | html %]
32                     [% ELSE %]
33                         New label template
34                     [% END %]
35                 </a>
36             </li>
37         </ol>
38     </nav>
39     [% END %]
40
41     <div class="main container-fluid">
42         <div class="row">
43             <div class="col-sm-10 col-sm-push-2">
44                 <main>
45                     [% INCLUDE 'labels-toolbar.inc' %]
46
47                     [% IF ( template_id ) %]
48                         <h1>Edit label template [% template_id | html %]</h1>
49                     [% ELSE %]
50                         <h1>New label template</h1>
51                     [% END %]
52
53                     <form name="input" action="/cgi-bin/koha/labels/label-edit-template.pl" method="get">
54                     <div class="row">
55                         <div class="col-sm-6">
56                             <fieldset class="rows">
57                                 <ol>
58                                     <li>
59                                         <span class="label">Template ID:</span>[% IF ( template_id ) %][% template_id | html %][% ELSE %]N/A[% END %]
60                                     </li>
61                                     <li>
62                                         <label for="template_code">Template code:</label>
63                                         <input type="text" size="30" maxlength="43" name="template_code" id="template_code" value="[% template_code | html %]" />
64                                     </li>
65                                     <li>
66                                         <label for="template_desc">Template description:</label>
67                                         <textarea cols="30" rows="3" id="template_desc" name="template_desc">[% template_desc | html %]</textarea>
68                                     </li>
69                                                                         <li>
70                                  <label for="units">Units:</label>
71                                  <select id="units" name="units">
72                                  [% FOREACH unit IN units %]
73                                      [% IF ( unit.selected ) %]
74                                      <option value="[% unit.type | html %]" selected="selected">
75                                      [% ELSE %]
76                                      <option value="[% unit.type | html %]">
77                                      [% END %]
78
79                                      [% SWITCH unit.type %]
80                                      [%   CASE 'POINT' %]
81                                      <span>PostScript points</span>
82                                      [%   CASE 'AGATE' %]
83                                      <span>Agates</span>
84                                      [%   CASE 'INCH' %]
85                                      <span>US Inches</span>
86                                      [%   CASE 'MM' %]
87                                      <span>SI Millimeters</span>
88                                      [%   CASE 'CM' %]
89                                      <span>SI Centimeters</span>
90                                      [% END %]
91                                  </option>
92                                  [% END %]
93                                  </select>
94                              </li>
95                                     <li>
96                                         <label for="page_height">Page height:</label>
97                                         <input type="text" size="4" name="page_height" id="page_height" value="[% page_height | html %]" />
98                                     </li>
99                                     <li>
100                                         <label for="page_width">Page width:</label>
101                                         <input type="text" size="4" name="page_width" id="page_width" value="[% page_width | html %]" />
102                                     </li>
103                                     <li>
104                                         <label for="label_width">Label width:</label>
105                                         <input type="text" size="4" name="label_width" id="label_width" value="[% label_width | html %]" />
106                                     </li>
107                                     <li>
108                                         <label for="label_height">Label height:</label>
109                                         <input type="text" size="4" name="label_height" id="label_height" value="[% label_height | html %]" />
110                                     </li>
111
112                                 </ol>
113                             </fieldset>
114                         </div>
115                         <div class="col-sm-6">
116                             <fieldset class="rows">
117                                 <ol><li>
118                                     <label for="top_margin">Top page margin:</label>
119                                     <input type="text" size="4" name="top_margin" id="top_margin" value="[% top_margin | html %]" />
120                                 </li>
121                                 <li>
122                                     <label for="left_margin">Left page margin:</label>
123                                     <input type="text" size="4" name="left_margin" id="left_margin" value="[% left_margin | html %]" />
124                                 </li>
125                                     <li>
126                                         <label for="top_text_margin">Top text margin:</label>
127                                         <input type="text" size="4" name="top_text_margin" id="top_text_margin" value="[% top_text_margin | html %]" />
128                                     </li>
129                                     <li>
130                                         <label for="left_text_margin">Left text margin:</label>
131                                         <input type="text" size="4" name="left_text_margin" id="left_text_margin" value="[% left_text_margin | html %]" />
132                                     </li>
133                                     <li>
134                                         <label for="cols">Number of columns:</label>
135                                         <input type="text" size="4" name="cols" id="cols" value="[% cols | html %]" />
136                                     </li>
137                                     <li>
138                                         <label for="rows">Number of rows:</label>
139                                         <input type="text" size="4" name="rows" id="rows" value="[% rows | html %]" />
140                                     </li>
141                                     <li>
142                                         <label for="col_gap">Gap between columns:</label>
143                                         <input type="text" size="4" name="col_gap" id="col_gap" value="[% col_gap | html %]" />
144                                     </li>
145                                     <li>
146                                         <label for="row_gap">Gap between rows:</label>
147                                         <input type="text" size="4" name="row_gap" id="row_gap" value="[% row_gap | html %]" />
148                                     </li>
149
150                                     <li>
151                                         <label for="profile_id">Profile:</label>
152                                         [% IF ( profile_list ) %]
153                                         <select id="profile_id" name="profile_id">
154                                         [% FOREACH profile_lis IN profile_list %]
155 [% IF ( profile_lis.selected ) %]
156 <option value="[% profile_lis.profile_id | html %]" selected="selected">
157 [% ELSE %]
158 <option value="[% profile_lis.profile_id | html %]">
159 [% END %]
160                                         [% profile_lis.printer_name | html %]/[% profile_lis.paper_bin | html %]
161                                         </option>
162                                         [% END %]
163                                         </select>
164                                         [% END %]
165                                         [% IF ( profile_list.size == 1 ) %]
166                                         <br>
167                                         <a href="/cgi-bin/koha/labels/label-edit-profile.pl?op=new">Make a new printer profile.</a>
168                                         [% END %]
169                                     </li>
170                                 </ol>
171                             </fieldset>
172                         </div>
173                     </div>
174                         <fieldset class="action">
175                             <input type="submit" class="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/labels/label-manage.pl?label_element=template">Cancel</a>
176                             <input type="hidden" name="op" value="save" />
177                             [% IF ( template_id ) %]
178                             <input type="hidden" name="template_id" value="[% template_id | html %]" />
179                             [% END %]
180                         </fieldset>
181                 </form>
182
183             </main>
184         </div> <!-- /.col-sm-10.col-sm-push-2 -->
185
186         <div class="col-sm-2 col-sm-pull-10">
187             <aside>
188                 [% INCLUDE 'tools-menu.inc' %]
189             </aside>
190         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
191      </div> <!-- /.row -->
192
193 [% MACRO jsinclude BLOCK %]
194     [% Asset.js("js/tools-menu.js") | $raw %]
195     <script>
196         $(document).ready(function(){
197             var selectedUnit = $("#units option:selected").attr("value");
198             var unitfields = $("#page_height,#page_width,#label_width,#label_height,#top_margin,#left_margin,#top_text_margin,#left_text_margin,#col_gap,#row_gap");
199             $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>");
200             $("#units").change(function(){
201                 $(".unit").html(getUnit($(this).val()));
202             });
203         });
204         function getUnit(unit){
205             switch(unit){
206                 case "POINT":
207                     var unit = " pt";
208                     break;
209                 case "AGATE":
210                     var unit = " ag";
211                     break;
212                 case "INCH":
213                     var unit = " in";
214                     break;
215                 case "MM":
216                     var unit = " mm";
217                     break;
218                 case "CM":
219                     var unit = " cm";
220                     break;
221                 default:
222                     var unit = "";
223             }
224             return unit;
225         }
226     </script>
227 [% END %]
228
229 [% INCLUDE 'intranet-bottom.inc' %]