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