Bug 28438: Capitalization: Various corrections
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / label-edit-layout.tt
1 [% USE raw %]
2 [% SET footerjs = 1 %]
3 [%- BLOCK translate_label_types -%]
4     [%-  SWITCH type -%]
5         [%- CASE 'BIB' -%] Only the bibliographic data is printed
6         [%- CASE 'BARBIB'-%] Barcode proceeds bibliographic data
7         [%- CASE 'BIBBAR'-%] Bibliographic data proceeds barcode
8         [%- CASE 'ALT' -%] Barcode and bibliographic data are printed on alternating labels
9         [%- CASE 'BAR' -%] Only the barcode is printed
10     [%- END -%]
11 [%- END -%]
12     [% INCLUDE 'doc-head-open.inc' %]
13     <title>[% IF ( layout_id ) %]Edit label layout [% layout_id | html %] [% ELSE %] New label layout [% END %] &rsaquo; Layouts &rsaquo; Label creator &rsaquo; Tools &rsaquo; Koha</title>
14     [% INCLUDE 'doc-head-close.inc' %]
15 </head>
16
17 [% BLOCK translate_justification_types %]
18 [%  SWITCH type %]
19 [%   CASE 'L' %]Left
20 [%   CASE 'C' %]Center
21 [%   CASE 'R' %]Right
22 [%  END %]
23 [% END %]
24 <body id="labels_label-edit-layout" class="tools labels">
25     [% INCLUDE 'header.inc' %]
26     [% INCLUDE 'cat-search.inc' %]
27
28     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
29         <ol>
30             <li>
31                 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
32             </li>
33             <li>
34                 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
35             </li>
36             <li>
37                 <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a>
38             </li>
39             <li>
40                 <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=layout">Layouts</a>
41             </li>
42
43             [% IF ( layout_id ) %]
44                 <li>
45                     <a href="#" aria-current="page">
46                         Edit label layout [% layout_id | html %]
47                     </a>
48                 </li>
49             [% ELSE %]
50                 <li>
51                     <a href="#" aria-current="page">
52                         New label layout
53                     </a>
54                 </li>
55             [% END %]
56         </ol>
57     </nav>
58
59     <div class="main container-fluid">
60         <div class="row">
61             <div class="col-sm-10 col-sm-push-2">
62                 <main>
63
64                     [% INCLUDE 'labels-toolbar.inc' %]
65
66                     [% IF ( layout_id ) %]
67                         <h1>Edit label layout [% layout_id | html %]</h1>
68                     [% ELSE %]
69                         <h1>New label layout</h1>
70                     [% END %]
71
72                     <form name="input" action="/cgi-bin/koha/labels/label-edit-layout.pl" method="get">
73                         <fieldset class="rows">
74                             <ol>
75                                 <li>
76                                     <label for="layout_name">Layout name: </label>
77                                     <input type="text" name="layout_name" id="layout_name" size="20" value="[% layout_name | html %]" />
78                                 </li>
79                                 <li>
80                                     <label for="barcode_type">Choose barcode type (encoding): </label>
81                                     <select name="barcode_type" id="barcode_type">
82                                     [% FOREACH barcode_type IN barcode_types %]
83                                     [% IF ( barcode_type.selected ) %]
84                                     <option value="[% barcode_type.type | html %]" selected="selected">[% barcode_type.name | html %]</option>
85                                     [% ELSE %]
86                                     <option value="[% barcode_type.type | html %]">[% barcode_type.name | html %]</option>
87                                     [% END %]
88                                     [% END %]
89                                     </select>
90                                 </li>
91                                 <li>
92                                     <label for="printing_type">Choose layout type: </label>
93                                     <select name="printing_type" id="printing_type">
94                                     [% FOREACH label_type IN label_types %]
95                                     [% IF ( label_type.selected ) %]
96                                     <option value="[% label_type.type | html %]" selected="selected">[% PROCESS translate_label_types type=label_type.type %]</option>
97                                     [% ELSE %]
98                                     <option value="[% label_type.type | html %]">[% PROCESS translate_label_types type=label_type.type %]</option>
99                                     [% END %]
100                                     [% END %]
101                                     </select>
102                                 </li>
103                                 <li>
104                                     <fieldset>
105                                         <legend>Bibliographic data to print</legend>
106                                                                                 <ol>
107                                         <li class="radio">[% IF ( layout_string ) %]
108                                         <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>
109                                         [% ELSE %]
110                                         <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>
111                                         [% END %]
112                                                                                                 <div id="layout_table">
113                                                     <p>
114                                             [% FOREACH text_field IN fields %]
115                                                         <select name="[% text_field.field_name | html %]" id="[% text_field.field_name |url %]">
116                                                             <option value=""></option>
117                                                             [% FOREACH orde IN [1..field_count] %]
118                                                                 [% IF ( orde == text_field.order ) %]
119                                                             <option value="[% orde | html %]" selected="1">[% orde | html %]</option>
120                                                                 [% ELSE %]
121                                                             <option value="[% orde | html %]">[% orde | html %]</option>
122                                                                 [% END %]
123                                                             [% END %]
124                                                         </select>&nbsp;<label for="[% text_field.field_name |url %]">[% text_field.field_label | html %]</label>
125
126                                                         &nbsp;&nbsp;
127
128                                             [% END %]
129                                                     </p>
130                                                                                         </div>
131                                             </li>
132                                             [% UNLESS ( layout_string ) %]
133                                             <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>
134                                             [% ELSE %]
135                                             <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>
136                                             [% END %]
137                                            <li> <fieldset id="layout_string" class="brief">
138                                                 <label for="format_string">Data fields</label>
139                                                 <input type="text" name="format_string" id="format_string" size="80" value="[% format_string | html %]" />
140                                                 <div class="hint">
141                                                     <p>Enter a comma separated list of fields to print.  You may include any <em>Koha field</em> or MARC subfield.</p>
142                                                     <p>See online help for advanced options</p>
143                                                     <p>ex: barcode, itemcallnumber, title, "050a 050b", 300a </p>
144                                                     <p>Fields homebranch_description, holdingbranch_description, ccode_description, location_description and permanent_location_description show description instead of code.</p>
145                                                 </div>
146                                             </fieldset></li>
147                                                                                         </ol>
148                                     </fieldset>
149                                 </li>
150                                 <li>
151                                     <label for="guidebox">Draw guide boxes: </label>
152                                     [% IF ( guidebox ) %]
153                                     <input type="checkbox" name="guidebox" id="guidebox" value="1"  checked="checked" />
154                                     [% ELSE %]
155                                     <input type="checkbox" name="guidebox" id="guidebox" value="1" />
156                                     [% END %]
157                                 </li>
158                                 <li>
159                                     <label for="callnum_split">Split call numbers: </label>
160                                     [% IF ( callnum_split ) %]
161                                     <input type="checkbox" name="callnum_split" id="callnum_split" value="1"  checked="checked" />
162                                     [% ELSE %]
163                                     <input type="checkbox" name="callnum_split" id="callnum_split" value="1" />
164                                     [% END %]
165                                 </li>
166                                 <li>
167                                     <label for="text_justify">Text justification: </label>
168                                     <select name="text_justify" id="text_justify">
169                                         [% FOREACH text_justification_type IN text_justification_types %]
170                                         [% IF ( text_justification_type.selected ) %]
171                                         <option value="[% text_justification_type.type | html %]" selected="selected">[% PROCESS translate_justification_types type=text_justification_type.type %]</option>
172                                         [% ELSE %]
173                                         <option value="[% text_justification_type.type | html %]">[% PROCESS translate_justification_types type=text_justification_type.type %]</option>
174                                         [% END %]
175                                         [% END %]
176                                     </select>
177                                 </li>
178                                 <li>
179                                     <label for="font">Font: </label>
180                                     <select name="font" id="font">
181                                         [% FOREACH font_type IN font_types %]
182                                         [% IF ( font_type.selected ) %]
183                                         <option value="[% font_type.type | html %]" selected="selected">[% font_type.name | html %]</option>
184                                         [% ELSE %]
185                                         <option value="[% font_type.type | html %]">[% font_type.name | html %]</option>
186                                         [% END %]
187                                         [% END %]
188                                     </select>
189                                 </li>
190                                 <li>
191                                     <label for="font_size">Font size: </label>
192                                     <input type="text" name="font_size" id="font_size" size="2" value="[% font_size | html %]" />
193                                 </li>
194                                 <li>
195                                     <label for="oblique_title">Oblique title: </label>
196                                     [% IF ( oblique_title ) %]
197                                     <input type="checkbox" name="oblique_title" id="oblique_title" value="1"  checked="checked" />
198                                     [% ELSE %]
199                                     <input type="checkbox" name="oblique_title" id="oblique_title" value="1" />
200                                     [% END %]
201                                 </li>
202                             </ol>
203                         </fieldset>
204                         <fieldset class="action">
205                             <input type="submit" value="Save" />
206                             <a class="cancel" href="/cgi-bin/koha/labels/label-manage.pl?label_element=layout">Cancel</a>
207                             <input type="hidden" name="op" value="save" />
208                             <input type="hidden" name="layout_id" value="[% layout_id | html %]" />
209                         </fieldset>
210                     </form>
211             </main>
212         </div> <!-- /.col-sm-10.col-sm-push-2 -->
213
214         <div class="col-sm-2 col-sm-pull-10">
215             <aside>
216                 [% INCLUDE 'tools-menu.inc' %]
217             </aside>
218         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
219      </div> <!-- /.row -->
220
221 [% MACRO jsinclude BLOCK %]
222     [% Asset.js("js/tools-menu.js") | $raw %]
223     <script>
224         $(document).ready(function() {
225             $("input[name='layout_choice']").change( function() { layout_method() } );
226             layout_method();
227             $("#font").on("change",function(){
228                  checkOblique();
229             });
230         });
231         function layout_method() {
232             if( $("input[name='layout_choice']:checked").val() == 'layout_string' ) {
233                 $('#layout_table').hide();
234                 $('#layout_string').show();
235             } else {
236                 $('#layout_table').show();
237                 $('#layout_string').hide();
238             }
239         }
240         function checkOblique() {
241             var font = document.getElementById("font");
242             var selectedfont = font.options[font.selectedIndex].value;
243             if ( selectedfont.match("I$") || selectedfont.match("O$") ) {
244                 document.getElementById("oblique_title").disabled = true;
245             } else {
246                 document.getElementById("oblique_title").disabled = false;
247             }
248         }
249     </script>
250 [% END %]
251
252 [% INCLUDE 'intranet-bottom.inc' %]