Bug 14667: UI/UX improvements for the Label creator
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / label-edit-layout.tt
1 [% BLOCK translate_label_types %]
2 [%  SWITCH type %]
3 [%   CASE 'BIB'    %]Biblio
4 [%   CASE 'BARBIB' %]Barcode/Biblio
5 [%   CASE 'BIBBAR' %]Biblio/Barcode
6 [%   CASE 'ALT'    %]Alternating
7 [%   CASE 'BAR'    %]Barcode
8 [%  END %]
9 [% END %]
10     [% INCLUDE 'doc-head-open.inc' %]
11     <title>Koha &rsaquo; Tools &rsaquo; Labels</title>
12     [% INCLUDE 'doc-head-close.inc' %]
13     <script type="text/JavaScript" language="JavaScript">
14         //<![CDATA[
15             $(document).ready(function() {
16                 $("input[name='layout_choice']").change( function() { layout_method() } );
17                 layout_method();
18             });
19             function layout_method() {
20                 if( $("input[name='layout_choice']:checked").val() == 'layout_string' ) {
21                     $('#layout_table').hide();
22                     $('#layout_string').show();
23                 } else {
24                     $('#layout_table').show();
25                     $('#layout_string').hide();
26                 }
27             }
28         //]]>
29     </script>
30 </head>
31 [% BLOCK translate_justification_types %]
32 [%  SWITCH type %]
33 [%   CASE 'L' %]Left
34 [%   CASE 'C' %]Center
35 [%   CASE 'R' %]Right
36 [%  END %]
37 [% END %]
38 <body id="labels_label-edit-layout" class="tools labels">
39     [% INCLUDE 'header.inc' %]
40     [% INCLUDE 'cat-search.inc' %]
41     <div id="breadcrumbs">
42         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
43         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
44         <a href="/cgi-bin/koha/labels/label-home.pl">Labels home</a> &rsaquo;
45         <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=layout">Manage label layouts</a> &rsaquo;
46         [% IF ( layout_id ) %]Edit[% ELSE %]Create[% END %] Label layout
47     </div>
48     <div id="doc3" class="yui-t2">
49         <div id="bd">
50             <div id="yui-main">
51                 <div class="yui-b">
52                     <div class="yui-g">
53                     [% INCLUDE 'labels-toolbar.inc' %]
54                         <div class="yui-u first">
55
56                         </div>
57                     </div>
58                     <form name="input" action="/cgi-bin/koha/labels/label-edit-layout.pl" method="get">
59                         <fieldset class="rows">
60                             <legend>[% IF ( layout_id ) %]Edit[% ELSE %]Create[% END %] Label layout</legend>
61                             <ol>
62                                 <li>
63                                     <label for="layout_name">Layout name: </label>
64                                     <input type="text" name="layout_name" id="layout_name" size="20" value="[% layout_name %]" />
65                                 </li>
66                                 <li>
67                                     <label for="barcode_type">Choose barcode type (encoding): </label>
68                                     <select name="barcode_type" id="barcode_type">
69                                     [% FOREACH barcode_type IN barcode_types %]
70                                     [% IF ( barcode_type.selected ) %]
71                                     <option value="[% barcode_type.type %]" selected="selected">[% barcode_type.name %]</option>
72                                     [% ELSE %]
73                                     <option value="[% barcode_type.type %]">[% barcode_type.name %]</option>
74                                     [% END %]
75                                     [% END %]
76                                     </select>
77                                 </li>
78                                 <li>
79                                     <label for="printing_type">Choose layout type: </label>
80                                     <select name="printing_type" id="printing_type">
81                                     [% FOREACH label_type IN label_types %]
82                                     [% IF ( label_type.selected ) %]
83                                     <option value="[% label_type.type %]" selected="selected">[% PROCESS translate_label_types type=label_type.type %]</option>
84                                     [% ELSE %]
85                                     <option value="[% label_type.type %]">[% PROCESS translate_label_types type=label_type.type %]</option>
86                                     [% END %]
87                                     [% END %]
88                                     </select>
89                                 </li>
90                                 <li>
91                                     <fieldset>
92                                         <legend>Bibliographic data to print</legend>
93                                                                                 <ol>
94                                         <li class="radio">[% IF ( layout_string ) %]
95                                         <input type="radio" name="layout_choice" id="layout_choice_order" value="layout_table" checked="checked" /><label for="layout_choice_order">Choose order of text fields to print</label>
96                                         [% ELSE %]
97                                         <input type="radio" name="layout_choice" id="layout_choice_order" value="layout_table" /><label for="layout_choice_order">Choose Order Of Text Fields to Print</label>
98                                         [% END %]
99                                                                                                 <div id="layout_table">
100                                                     <p>
101                                             [% FOREACH text_field IN fields %]
102                                                         <select name="[% text_field.field_name %]" id="[% text_field.field_name |url %]">
103                                                             <option value=""></option>
104                                                             [% FOREACH orde IN [1..field_count] %]
105                                                                 [% IF ( orde == text_field.order ) %]
106                                                             <option value="[% orde %]" selected="1">[% orde %]</option>
107                                                                 [% ELSE %]
108                                                             <option value="[% orde %]">[% orde %]</option>
109                                                                 [% END %]
110                                                             [% END %]
111                                                         </select>&nbsp;<label for="[% text_field.field_name |url %]">[% text_field.field_label %]</label>
112
113                                                         &nbsp;&nbsp;
114
115                                             [% END %]
116                                                     </p>
117                                                                                         </div>
118                                             </li>
119                                             [% UNLESS ( layout_string ) %]
120                                             <li class="radio"><input type="radio" id="layout_choice_list" name="layout_choice" value="layout_string" checked="checked" /> <label for="layout_choice_list">List fields</label></li>
121                                             [% ELSE %]
122                                             <li class="radio"><input type="radio" id="layout_choice_list" name="layout_choice" value="layout_string" /> <label for="layout_choice_list">List Fields</label></li>
123                                             [% END %]
124                                            <li> <fieldset id="layout_string" class="brief">
125                                                 <label for="format_string">Data fields</label>
126                                                 <input type="text" name="format_string" id="format_string" size="80" value="[% format_string |html %]" />
127                                                 <div class="hint">
128                                                     <p>Enter a comma separated list of fields to print.  You may include any <em>Koha field</em> or MARC subfield.</p>
129                                                     <p>See online help for advanced options</p>
130                                                     <p>ex: barcode, itemcallnumber, title, "050a 050b", 300a </p>
131                                                     <p>Fields homebranch_description, holdingbranch_description, ccode_description, location_description and permanent_location_description show description instead of code.</p>
132                                                 </div>
133                                             </fieldset></li>
134                                                                                         </ol>
135                                     </fieldset>
136                                 </li>
137                                 <li>
138                                     <label for="guidebox">Draw guide boxes: </label>
139                                     [% IF ( guidebox ) %]
140                                     <input type="checkbox" name="guidebox" id="guidebox" value="1"  checked="checked" />
141                                     [% ELSE %]
142                                     <input type="checkbox" name="guidebox" id="guidebox" value="1" />
143                                     [% END %]
144                                 </li>
145                                 <li>
146                                     <label for="callnum_split">Split call numbers: </label>
147                                     [% IF ( callnum_split ) %]
148                                     <input type="checkbox" name="callnum_split" id="callnum_split" value="1"  checked="checked" />
149                                     [% ELSE %]
150                                     <input type="checkbox" name="callnum_split" id="callnum_split" value="1" />
151                                     [% END %]
152                                 </li>
153                                 <li>
154                                     <label for="text_justify">Text justification: </label>
155                                     <select name="text_justify" id="text_justify">
156                                         [% FOREACH text_justification_type IN text_justification_types %]
157                                         [% IF ( text_justification_type.selected ) %]
158                                         <option value="[% text_justification_type.type %]" selected="selected">[% PROCESS translate_justification_types type=text_justification_type.type %]</option>
159                                         [% ELSE %]
160                                         <option value="[% text_justification_type.type %]">[% PROCESS translate_justification_types type=text_justification_type.type %]</option>
161                                         [% END %]
162                                         [% END %]
163                                     </select>
164                                 </li>
165                                 <li>
166                                     <label for="font">Font: </label>
167                                     <select name="font" id="font">
168                                         [% FOREACH font_type IN font_types %]
169                                         [% IF ( font_type.selected ) %]
170                                         <option value="[% font_type.type %]" selected="selected">[% font_type.name %]</option>
171                                         [% ELSE %]
172                                         <option value="[% font_type.type %]">[% font_type.name %]</option>
173                                         [% END %]
174                                         [% END %]
175                                     </select>
176                                 </li>
177                                 <li>
178                                     <label for="font_size">Font size: </label>
179                                     <input type="text" name="font_size" id="font_size" size="2" value="[% font_size |html %]" />
180                                 </li>
181                             </ol>
182                         </fieldset>
183                         <fieldset class="action">
184                             <input type="submit" value="Save" />
185                             <a class="cancel" href="/cgi-bin/koha/labels/label-manage.pl?label_element=layout">Cancel</a>
186                             <input type="hidden" name="op" value="save" />
187                             <input type="hidden" name="layout_id" value="[% layout_id %]" />
188                         </fieldset>
189                     </form>
190                 </div>
191             </div>
192             <div class="yui-b">
193                 [% INCLUDE 'labels-menu.inc' %]
194             </div>
195         </div>
196         [% INCLUDE 'intranet-bottom.inc' %]