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