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