059d88f7ba69920c2547f52b3ef2cdd4e76c0307
[Evergreen.git] / Open-ILS / src / templates / staff / cat / printlabels / t_view.tt2
1 <style>
2   /* TODO: move me */
3
4   body {
5
6   }
7
8   table.page-break {
9   page-break-before: always;
10   }
11
12 </style>
13
14 <div class="container-fluid" style="text-align:center">
15     <div class="alert alert-info alert-less-pad strong-text-2">
16         [% l('Print Item Labels') %]
17     </div>
18 </div>
19 <div class="row">
20     <div class="col-md-3">
21        <div class="input-group">
22             <span class="input-group-addon">[% l('Template') %]</span>
23             <eg-basic-combo-box list="template_name_list" selected="template_name"></eg-basic-combo-box>
24        </div>
25     </div>
26     <div class="col-md-1">
27         <button class="btn btn-default" ng-click="applyTemplate(template_name)">[% l('Apply') %]</button>
28     </div>
29     <div class="col-md-2">
30        <div class="input-group">
31             <span class="input-group-addon">[% l('Printer') %]</span>
32             <select class="form-control" ng-model="print.template_context">
33                 <option value="default">[% l('Default') %]</option>
34                 <option value="receipt">[% l('Receipt') %]</option>
35                 <option value="label">[% l('Label') %]</option>
36                 <option value="mail">[% l('Mail') %]</option>
37                 <option value="offline">[% l('Offline') %]</option>
38             </select>
39         </div>
40     </div>
41     <div class="col-md-2">
42         <div class="btn-group">
43             <button class="btn btn-default" ng-click="saveTemplate(template_name)">[% l('Save') %]</button>
44             <button class="btn btn-default" ng-click="deleteTemplate(template_name)">[% l('Delete') %]</button>
45         </div>
46     </div>
47     <div class="col-md-3">
48         <div class="btn-group">
49             <span class="btn btn-default btn-file">
50                 [% l('Import') %]
51                 <input type="file" eg-file-reader container="imported_templates.data">
52             </span>
53             <label class="btn btn-default"
54                 eg-json-exporter container="templates"
55                 default-file-name="'[% l('exported_label_templates.json') %]'">
56                 [% l('Export') %]
57             </label>
58             <label class="btn btn-default" ng-click="reset_to_default()">
59                 [% l('Default') %]</button>
60             </div>
61     </div>
62     <div class="col-md-1 pull-right">
63         <button class="btn btn-default" ng-click="print_labels()">[% l('Print') %]</button>
64     </div>
65 </div>
66
67 <hr/>
68
69 <div class="row">
70     <div class="col-md-5">
71         <ul class="nav nav-tabs">
72             <li ng-class="{active : current_tab == 'cn_template'}">
73                 <a ng-click="set_tab('cn_template')">
74                     [% l('Call Number Template') %]
75                 </a>
76             </li>
77             <li ng-class="{active : current_tab == 'call_numbers'}">
78                 <a ng-click="set_tab('call_numbers')">
79                     [% l('Call Numbers') %]
80                 </a>
81             </li>
82             <li ng-class="{active : current_tab == 'settings'}">
83                 <a ng-click="set_tab('settings')">
84                     [% l('Settings') %]
85                 </a>
86             </li>
87             <li ng-class="{active : current_tab == 'template'}">
88                 <a ng-click="set_tab('template')">
89                     [% l('Label Template') %]
90                 </a>
91             </li>
92         </ul>
93         <div class="tab-content">
94             <div class="tab-pane active">
95                 <div ng-show="current_tab == 'cn_template'">
96                     <h4>
97                         [% l('Call Number Preview') %]
98                     </h4>
99                     <div eg-print-template-output ng-show="true"
100                         content="print.cn_template_content"
101                         context="{ copy : preview_scope.copies[0], get_cn_and_location_prefix : preview_scope.get_cn_and_location_prefix, get_cn_and_location_suffix : preview_scope.get_cn_and_location_suffix, settings : preview_scope.settings }"></div>
102                     <h4>
103                         [% l('Call Number Template') %]
104                     </h4>
105                     <div>
106                         <span>
107                             [% l('Changes here will wipe out manual changes in the Call Numbers tab.') %]<br/>
108                         </span>
109                     </div>
110                     <textarea ng-model="print.cn_template_content" class="print-template-text">
111                     </textarea>
112                     <div ng-repeat="copy in preview_scope.copies">
113                         <div id="cn_for_copy_{{copy.id}}" eg-print-template-output ng-show="false"
114                             content="print.cn_template_content"
115                             context="{ copy : copy, get_cn_and_location_prefix : preview_scope.get_cn_and_location_prefix, get_cn_and_location_suffix : preview_scope.get_cn_and_location_suffix, settings : preview_scope.settings }"></div>
116                     </div>
117                 </div>
118                 <div ng-show="current_tab == 'call_numbers'">
119                     <h4>
120                         [% l('Formatted Call Numbers') %]
121                     </h4>
122                     <div>
123                         <span>
124                             [% l('Manual adjustments may be made here. These do not get saved with templates.') %]<br/>
125                         </span>
126                     </div>
127                     <div ng-repeat="cn in rendered_call_number_set">
128                         <textarea ng-model="cn.value" class="cn-template-text">
129                         </textarea>
130                     </div>
131                 </div>
132                 <div ng-show="current_tab == 'settings'">
133                     <div>
134                         <span>
135                           <b>[% l('*All settings will be saved with templates') %]</b>
136                         </span>
137                     </div>
138                     <form id="print_label_form" name="print_label_form">
139                         <div class="print-label-toolbox">
140                           <div class="eg-print-label-group">
141                             <div class="eg-print-label-section">
142                                 <h4>[% l('Print Feed Option') %]</h4>
143                                 <ul>
144                                     <li ng-repeat="x in preview_scope.toolbox_settings.feed_option.options">
145                                         <label>{{x.label}}:</label>
146                                         <input name="label-feed-option" ng-model="preview_scope.toolbox_settings.feed_option.selected" ng-change="redraw_label_table()" type="radio" value="{{x.value}}" />
147                                     </li>
148                                 </ul>
149                               </div>
150                               <div class="eg-print-label-section">
151                                 <h4>[% l('Print Option') %]</h4>
152                                 <ul>
153                                     <li ng-repeat="x in preview_scope.toolbox_settings.mode.options">
154                                         <label>{{x.label}}:</label>
155                                         <input name="label-output-mode" ng-model="preview_scope.toolbox_settings.mode.selected" type="radio" value="{{x.value}}" />
156                                     </li>
157                                 </ul>
158                               </div>
159                             </div>
160                             <div class="eg-print-label-group">
161                             <h4>[% l('Page Settings') %]</h4>
162                               <div class="eg-print-label-section">
163                                 <p><strong>[% l('Page Margins') %]</strong>
164                                 <eg-help-popover help-text="[% l('Must be in format &quot;0.25in&quot;, &quot;2.5cm&quot;, &quot;1.5in&quot;, etc. (units of measurement must be valid CSS)') %]"></p>
165                                 <ul>
166                                     <li ng-repeat="(x, y) in preview_scope.toolbox_settings.page.margins">
167                                         <label>{{y.label}}:</label>
168                                         <input type="text" eg-print-label-valid-css ng-model="preview_scope.toolbox_settings.page.margins[x].size" required />
169                                     </li>
170                                 </ul>
171                               </div>
172                               <div class="eg-print-label-section">
173                                 <p><strong>[% l('Print Grid Size') %]</strong>
174                                         <span ng-if="preview_scope.toolbox_settings.feed_option.selected === 'sheet'"><eg-help-popover help-text="[% l('Please specify the number of columns and rows on the print medium. This setting is only used to control page layouts and breaks. It will not limit the number of rows printed, which is determined by the number of selected copies. The column count should include each label in a row. For example, if you have a row with two sets of labels that include one spine and one pocket, the count is four.') %]"></span>
175                                          <span ng-if="preview_scope.toolbox_settings.feed_option.selected === 'continuous'"><eg-help-popover help-text="[% l('Please specify the number of columns on the print medium. The column count should include each label on your medium. For example, if your medium has a spine and pocket label, the count is two.') %]"></span></p>
176                                 <ul>
177                                     <li ng-if="preview_scope.toolbox_settings.feed_option.selected === 'sheet'">
178                                         <label>[% l('Rows') %]:</label>
179                                         <input type="number" ng-model="preview_scope.toolbox_settings.page.dimensions.rows" ng-min="1" required />
180                                     </li>
181                                     <li>
182                                         <label>[% l('Columns') %]:</label>
183                                         <input type="number" ng-model="preview_scope.toolbox_settings.page.dimensions.columns" ng-min="1" required />
184                                     </li>
185                                 </ul>
186                               </div>
187                               <div class="eg-print-label-section" ng-if="preview_scope.toolbox_settings.feed_option.selected === 'sheet'">
188                                 <p><label>[% l('Gap Between Rows') %]</label>
189                                 <eg-help-popover help-text="[%l ('Must be in format &quot;0.25in&quot;, &quot;2.5cm&quot;, &quot;1.5in&quot;, etc. (units of measurement must be valid CSS)') %]"></p>
190                                 <p><input type="text" ng-model="preview_scope.toolbox_settings.page.space_between_labels.vertical.size" ng-min="0" eg-print-label-valid-css required /></p>
191                                </div>
192                                <div class="eg-print-label-section" ng-if="preview_scope.toolbox_settings.feed_option.selected === 'sheet'">
193                                 <p><label>[% l('Gap Between Columns') %]</label>
194                                 <eg-help-popover help-text="[% l('Gap between each label set (spine/pocket combo) or, when using only one type of label, between each
195 label. Use pocket label left margin to identify how much space to provide between labels within one set. Must be in format &quot;0.25in&quot;, &quot;2.5cm&quot;, &quot;1.5in&quot;, etc. (units of measurement must be valid CSS)') %]"></p>
196                               <p><input type="text" ng-model="preview_scope.toolbox_settings.page.label.gap.size" ng-min="0" eg-print-label-valid-css required /></p>
197                               </div>
198                               <div class="eg-print-label-section" ng-if="preview_scope.toolbox_settings.feed_option.selected === 'sheet'">
199                                 <p><strong>[% l('Starting Position on Label Grid') %]</strong>
200                                 <eg-help-popover help-text="[% l('Specify the starting row and column where labels should begin printing. Values must not exceed the respective row and column size specified in &quot;Print Grid Size&quot;') %]"></p>
201                                 <ul>
202                                     <li>
203                                         <label>[% l('Row') %]:</label>
204                                         <input type="number" eg-print-label-valid-int eg-print-label-row-bounds ng-model="preview_scope.toolbox_settings.page.start_position.row" ng-min="1" required />
205                                     </li>
206                                     <li>
207                                         <label>[% l('Column') %]:</label>
208                                         <input type="number" eg-print-label-valid-int="" eg-print-label-column-bounds ng-model="preview_scope.toolbox_settings.page.start_position.column" ng-min="1"  required />
209                                     </li>
210                                 </ul>
211                                 </div>
212                               </div> 
213                               <div class="eg-print-label-group" class="eg-print-label-section" ng-if="preview_scope.valid_print_label_start_column() && preview_scope.valid_print_label_start_row() && preview_scope.toolbox_settings.page.dimensions.columns > 1">
214                                 <div>
215                                 <h4>[% l('Label Set Configuration') %]
216                                 <eg-help-popover help-text="[% l('A label set is a group of labels that should print data from the same bibliographic record. In this
217 section, identify the number of labels contained in each set, which columns should print spine label data, and which columns should print pocket label data.') %]"></h4>
218                                 <label>[% l('Number of Labels in Set') %]:</label>
219                               <input type="number" eg-print-label-valid-int="" ng-min="1" ng-model="preview_scope.toolbox_settings.page.label.set.size" />
220                                 <ul>
221                                     <li ng-repeat="i in preview_scope.toolbox_settings.page.label.set.size | columnRowRange">
222                                         <label>[% l('Column') %] {{i + 1}}</label>
223                                         <select id="eg_print_label_column_spec_{{i}}" ng-model="preview_scope.toolbox_settings.page.column_class[i]" ng-change="redraw_label_table()">
224                                             <option value="spine">[% l('Spine Label') %]</option>
225                                             <option value="pocket">[% l('Pocket Label') %]</option>
226                                         </select>
227                                     </li>
228                                 </ul>
229                               <br />
230                               </div>
231                             </div>                          
232                         </div>                
233                     </form>
234                     <div class="eg-print-label-group">
235                       <div>
236                        <h4>Font & Label Settings</h4>
237                         <span>
238                             [% l('These settings do get saved with templates and will override corresponding Library Settings.') %]<br/>
239                         </span>
240                       </div>
241                       <div ng-repeat="s in org_unit_settings">
242                         <div class="row" style="margin-top: 5mm;">
243                         <div class="col-md-6"><label>{{s.label}} <eg-help-popover help-text="{{s.description}}"></label></div>
244                             <div class="col-md-6">
245                                 <input type="text" ng-model="preview_scope.settings[s.name]"></input>
246                             </div>
247                          </div>
248                       </div>
249                      </div>
250                 </div>
251                 <div ng-show="current_tab == 'template'">
252                     <div ng-if="print.load_failed" class="alert alert-danger">
253                         [% l(
254                         "Unable to load template '[_1]'.  The web server returned an error.",
255                         '{{print.template_name}}')
256                         %]
257                     </div>
258                     <div>
259                         <textarea ng-model="print.template_content" class="print-template-text">
260                         </textarea>
261                     </div>
262                 </div>
263             </div>
264         </div>
265     </div>
266     <div class="col-md-7">
267         <h3>
268             [% l('Label Preview') %]
269         </h3>
270         <div eg-print-template-output
271           content="print.template_content"
272           context="preview_scope"></div>
273     </div>
274     <!-- col -->
275 </div>
276