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