Bug 29002: (follow-up) Use $patron_to_html function
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / label-edit-profile.tt
1 [% USE raw %]
2 [% PROCESS 'i18n.inc' %]
3 [% SET footerjs = 1 %]
4     [% INCLUDE 'doc-head-open.inc' %]
5     <title>[% FILTER collapse %]
6         [% IF( profile_id ) %]
7             [% tx("Edit printer profile {profile_id}", { profile_id = profile_id }) | html %]
8         [% ELSE %]
9             [% t("New printer profile") | html %]
10         [% END%] &rsaquo;
11         [% t("Profiles") | html %] &rsaquo;
12         [% t("Label creator") | html %] &rsaquo;
13         [% t("Cataloging") | html %] &rsaquo;
14         [% t("Koha") | html %]
15     [% END %]</title>
16     [% INCLUDE 'doc-head-close.inc' %]
17 </head>
18
19 <body id="labels_label-edit-profile" class="tools labels">
20     [% WRAPPER 'header.inc' %]
21     [% INCLUDE 'cat-search.inc' %]
22 [% END %]
23
24 [% WRAPPER 'sub-header.inc' %]
25     [% WRAPPER breadcrumbs %]
26         [% WRAPPER breadcrumb_item %]
27             <a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a>
28         [% END %]
29         [% WRAPPER breadcrumb_item %]
30             <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a>
31         [% END %]
32         [% WRAPPER breadcrumb_item %]
33                 <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=profile">Profiles</a>
34         [% END %]
35         [% WRAPPER breadcrumb_item bc_active= 1 %]
36             [% IF ( profile_id ) %]
37                 <span>Edit printer profile [% profile_id | html %]</span>
38             [% ELSE %]
39                 <span>New printer profile</span>
40             [% END%]
41         [% END %]
42     [% END #/ WRAPPER breadcrumbs %]
43 [% END #/ WRAPPER sub-header.inc %]
44
45     <div class="main container-fluid">
46         <div class="row">
47             <div class="col-sm-10 col-sm-push-2">
48                 <main>
49
50                     [% INCLUDE 'labels-toolbar.inc' %]
51
52                     [% IF ( profile_id ) %]
53                         <h1>Edit printer profile [% profile_id | html %]</h1>
54                     [% ELSE %]
55                         <h1>New printer profile</h1>
56                     [% END%]
57
58                     <form name="input" action="/cgi-bin/koha/labels/label-edit-profile.pl" method="get">
59                                     <fieldset class="rows"><legend>Profile settings</legend>
60                                         <ol>
61                                             <li>
62                                                 [% IF ( profile_id ) %]
63                                                  <span class="label">Printer name:</span>[% printer_name | html %]
64                                                 <input type="hidden" name="printer_name" value="[% printer_name | html %]" />
65                                                 [% ELSE %]
66                                                 <label for="printer_name">Printer name:</label><input type="text"  size="20" name="printer_name" id="printer_name" />
67                                                 [% END %]
68                                             </li>
69                                             <li>
70                                                 [% IF ( profile_id ) %]
71                                                                                                 <span class="label">Paper bin:</span> [% paper_bin | html %]
72                                                 <input type="hidden" name="paper_bin" value="[% paper_bin | html %]" />
73                                                 [% ELSE %]
74                                                 <label for="paper_bin">Paper bin:</label><input type="text"  size="20" name="paper_bin" id="paper_bin" />
75                                                 [% END %]
76                                             </li>
77                                             <li>
78                                                 [% IF ( label_template ) %]
79                                                  <label for="template_name">Template name:</label> [% label_template | html %]
80                                                 [% ELSE %]
81                                                  <span class="label">Template name:</span> Profile unassigned
82                                                 [% END %]
83                                             </li>
84                                             <li>
85                                                 <label for="units">Units: </label>
86                                                 <select id="units" name="units">
87                                                     [% FOREACH unit IN units %]
88                                                     [% IF ( unit.selected ) %]
89                                                     <option value="[% unit.type | html %]" selected="selected">
90                                                     [% ELSE %]
91                                                     <option value="[% unit.type | html %]">
92                                                     [% END %]
93                                                     [% SWITCH unit.type %]
94                                                     [%   CASE 'POINT' %]
95                                                         <span>PostScript points</span>
96                                                     [%   CASE 'AGATE' %]
97                                                         <span>Agates</span>
98                                                     [%   CASE 'INCH' %]
99                                                         <span>US Inches</span>
100                                                     [%   CASE 'MM' %]
101                                                         <span>SI Millimeters</span>
102                                                     [%   CASE 'CM' %]
103                                                         <span>SI Centimeters</span>
104                                                     [% END %]
105                                                     </option>
106                                                     [% END %]
107                                                 </select>
108                                             </li>
109                                          </ol>
110                                                                                 </fieldset>
111
112                                                                                 <fieldset class="rows"><legend>Offset:</legend>
113                                                                                 <ol>
114                                             <li>
115                                                 <label for="offset_horz">Horizontal: </label><input type="text"  size="4" name="offset_horz" id="offset_horz" value="[% offset_horz | html %]" />
116                                             </li>
117                                             <li>
118                                                 <label for="offset_vert">Vertical: </label><input type="text" size="4" name="offset_vert" id="offset_vert" value="[% offset_vert | html %]" />
119                                             </li>
120                                          </ol>
121                                                                                 </fieldset>
122
123                                                                                 <fieldset class="rows"><legend>Creep:</legend>
124                                                                                 <ol>
125                                             <li>
126                                                 <label for="creep_horz">Horizontal: </label><input type="text"  size="4" name="creep_horz" id="creep_horz" value="[% creep_horz | html %]" />
127                                             </li>
128                                             <li>
129                                                 <label for="creep_vert">Vertical: </label><input type="text" size="4" name="creep_vert" id="creep_vert" value="[% creep_vert | html %]" />
130                                             </li>
131                                         </ol>
132                                     </fieldset>
133                                     <fieldset class="action">
134                                         <input type="submit" class="btn btn-primary" value="Save" />
135                                         <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=profile" class="cancel">Cancel</a>
136                                         <input type="hidden" name="op" value="save" />
137                                         <input type="hidden" name="profile_id" value="[% profile_id | html %]" />
138                                     </fieldset>
139                     </form>
140
141             </main>
142         </div> <!-- /.col-sm-10.col-sm-push-2 -->
143
144         <div class="col-sm-2 col-sm-pull-10">
145             <aside>
146                 [% INCLUDE 'cat-menu.inc' %]
147             </aside>
148         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
149      </div> <!-- /.row -->
150
151 [% MACRO jsinclude BLOCK %]
152     <script>
153         $(document).ready(function(){
154             $('#navmenulist a[href$="/cgi-bin/koha/labels/label-home.pl"]').addClass("current");
155             var selectedUnit = $("#units option:selected").val();
156             var unitfields = $("#offset_horz,#offset_vert,#creep_horz,#creep_vert");
157             $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>");
158             $("#units").change(function(){
159                 $(".unit").html(getUnit($(this).val()));
160             });
161         });
162         function getUnit(unit){
163             switch(unit){
164                 case "POINT":
165                     var unit = " pt";
166                     break;
167                 case "AGATE":
168                     var unit = " ag";
169                     break;
170                 case "INCH":
171                     var unit = " in";
172                     break;
173                 case "MM":
174                     var unit = " mm";
175                     break;
176                 case "CM":
177                     var unit = " cm";
178                     break;
179                 default:
180                     var unit = "";
181             }
182             return unit;
183         }
184     </script>
185 [% END %]
186
187 [% INCLUDE 'intranet-bottom.inc' %]