Bug 34889: Convert PatronSelfRegistrationAdditionalInstructions system preference...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patroncards / 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             [% t("Edit printer profile") | html %] ([% profile_id | html %])
8         [% ELSE %]
9             [% t("New printer profile") | html %]
10         [% END %] &rsaquo;
11         [% t("Profiles") | html %] &rsaquo;
12         [% t("Patron card creator") | html %] &rsaquo;
13         [% t("Tools") | html %] &rsaquo;
14         [% t("Koha") | html %]
15     [% END %]</title>
16     [% INCLUDE 'doc-head-close.inc' %]
17 </head>
18
19 <body id="pcard_edit-profile" class="tools pcard">
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/tools/tools-home.pl">Tools</a>
28             [% END %]
29             [% WRAPPER breadcrumb_item %]
30                 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a>
31             [% END %]
32             [% WRAPPER breadcrumb_item %]
33                 <a href="/cgi-bin/koha/patroncards/manage.pl?card_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 'patroncards-toolbar.inc' %]
51
52                             <h1>
53                                 [% IF (profile_id) %]
54                                     <span>Edit printer profile ([% profile_id | html %])</span>
55                                 [% ELSE %]
56                                     <span>New printer profile</span>
57                                 [% END%]
58                             </h1>
59                                     <form name="input" action="/cgi-bin/koha/patroncards/edit-profile.pl" method="get">
60                                     <fieldset class="rows"><legend>Profile settings</legend>
61                                         <ol>
62                                             <li>
63                                                 [% IF ( profile_id ) %]
64                                                  <span class="label">Printer name:</span>[% printer_name | html %]
65                                                 <input type="hidden" name="printer_name" value="[% printer_name | html %]" />
66                                                 [% ELSE %]
67                                                 <label for="printer_name">Printer name:</label><input type="text"  size="20" name="printer_name" id="printer_name" />
68                                                 [% END %]
69                                             </li>
70                                             <li>
71                                                 [% IF ( profile_id ) %]
72                                                 <span class="label">Paper bin:</span> [% paper_bin | html %]
73                                                 <input type="hidden" name="paper_bin" value="[% paper_bin | html %]" />
74                                                 [% ELSE %]
75                                                 <label for="paper_bin">Paper bin:</label><input type="text"  size="20" name="paper_bin" id="paper_bin" />
76                                                 [% END %]
77                                             </li>
78                                             <li>
79                                                 [% IF ( label_template ) %]
80                                                  <label for="template_name">Template name:</label> [% label_template | html %]
81                                                 [% ELSE %]
82                                                  <span class="label">Template name:</span> Profile unassigned
83                                                 [% END %]
84                                             </li>
85                                             <li>
86                                                 <label for="units">Units: </label>
87                                                 <select id="units" name="units">
88                                                     [% FOREACH unit IN units %]
89                                                     [% IF ( unit.selected ) %]
90                                                     <option value="[% unit.type | html %]" selected="selected">
91                                                     [% ELSE %]
92                                                     <option value="[% unit.type | html %]">
93                                                     [% END %]
94                                                     [% unit.desc | html %]
95                                                     </option>
96                                                     [% END %]
97                                                 </select>
98                                             </li>
99                                          </ol>
100                                         </fieldset>
101
102                                         <fieldset class="rows"><legend>Offset:</legend>
103                                         <ol>
104                                             <li>
105                                                 <label for="offset_horz">Horizontal: </label><input type="text"  size="4" name="offset_horz" id="offset_horz" value="[% offset_horz | html %]" />
106                                             </li>
107                                             <li>
108                                                 <label for="offset_vert">Vertical: </label><input type="text" size="4" name="offset_vert" id="offset_vert" value="[% offset_vert | html %]" />
109                                             </li>
110                                          </ol>
111                                         </fieldset>
112
113                                         <fieldset class="rows"><legend>Creep:</legend>
114                                         <ol>
115                                             <li>
116                                                 <label for="creep_horz">Horizontal: </label><input type="text"  size="4" name="creep_horz" id="creep_horz" value="[% creep_horz | html %]" />
117                                             </li>
118                                             <li>
119                                                 <label for="creep_vert">Vertical: </label><input type="text" size="4" name="creep_vert" id="creep_vert" value="[% creep_vert | html %]" />
120                                             </li>
121                                         </ol>
122                                     </fieldset>
123                                     <fieldset class="action">
124                                         <input type="submit" class="btn btn-primary" value="Save" />
125                                         <a href="/cgi-bin/koha/patroncards/manage.pl?card_element=profile" class="cancel">Cancel</a>
126                                         <input type="hidden" name="op" value="save" />
127                                         <input type="hidden" name="profile_id" value="[% profile_id | html %]" />
128                                     </fieldset>
129                     </form>
130
131             </main>
132         </div> <!-- /.col-sm-10.col-sm-push-2 -->
133
134         <div class="col-sm-2 col-sm-pull-10">
135             <aside>
136                 [% INCLUDE 'tools-menu.inc' %]
137             </aside>
138         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
139      </div> <!-- /.row -->
140
141 [% MACRO jsinclude BLOCK %]
142     <script>
143         $(document).ready(function(){
144             var selectedUnit = $("#units option:selected").val();
145             var unitfields = $("#offset_horz,#offset_vert,#creep_horz,#creep_vert");
146             $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>");
147             $("#units").change(function(){
148                 $(".unit").html(getUnit($(this).val()));
149             });
150             function getUnit(unit){
151                 switch(unit){
152                     case "POINT":
153                         var unit = " pt";
154                         break;
155                     case "AGATE":
156                         var unit = " ag";
157                         break;
158                     case "INCH":
159                         var unit = " in";
160                         break;
161                     case "MM":
162                         var unit = " mm";
163                         break;
164                     case "CM":
165                         var unit = " cm";
166                         break;
167                     default:
168                         var unit = "";
169                 }
170                 return unit;
171             }
172         });
173     </script>
174 [% END %]
175
176 [% INCLUDE 'intranet-bottom.inc' %]