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