LP#1704873 webstaff: label printing
[working/Evergreen.git] / Open-ILS / src / templates / staff / cat / printlabels / t_view.tt2
1 <style>
2   /* TODO: move me */
3   .print-template-text {
4     height: 36em;
5     width: 100%;
6   }
7   .cn-template-text {
8     height: 12em;
9     width: 100%;
10   }
11 </style>
12
13 <h2>[% l('Print Item Labels') %]</h2>
14
15 <div class="row bg-info">
16     <div class="col-md-6">
17         <div class="row">
18             <div class="col-md-1">
19                 <span class="h4">[% l('Template') %]</span>
20             </div>
21             <div class="col-md-5">
22                 <eg-basic-combo-box list="template_name_list" selected="template_name"></eg-basic-combo-box>
23             </div>
24             <div class="col-md-1">
25                 <button class="btn btn-default" ng-click="applyTemplate(template_name)">[% l('Apply') %]</button>
26             </div>
27             <div class="col-md-1">
28                 <span class="h4">[% l('Printer') %]</span>
29             </div>
30             <div class="col-md-4">
31                 <select class="form-control" ng-model="print.template_context">
32                   <option value="default">[% l('Default') %]</option>
33                   <option value="receipt">[% l('Receipt') %]</option>
34                   <option value="label">[% l('Label') %]</option>
35                   <option value="mail">[% l('Mail') %]</option>
36                   <option value="offline">[% l('Offline') %]</option>
37                 </select>
38             </div>
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()">[% l('Default') %]</button>
59         </div>
60     </div>
61     <div class="col-md-1 pull-right">
62         <button class="btn btn-default" ng-click="print_labels()">[% l('Print') %]</button>
63     </div>
64 </div>
65
66 <hr/>
67
68 <div class="row">
69   <div class="col-md-5">
70     <ul class="nav nav-tabs">
71         <li ng-class="{active : current_tab == 'cn_template'}">
72             <a ng-click="set_tab('cn_template')">
73                 [% l('Call Number Template') %]
74             </a>
75         </li>
76         <li ng-class="{active : current_tab == 'call_numbers'}">
77             <a ng-click="set_tab('call_numbers')">
78                 [% l('Call Numbers') %]
79             </a>
80         </li>
81         <li ng-class="{active : current_tab == 'settings'}">
82             <a ng-click="set_tab('settings')">
83                 [% l('Settings') %]
84             </a>
85         </li>
86         <li ng-class="{active : current_tab == 'template'}">
87             <a ng-click="set_tab('template')">
88                 [% l('Label Template') %]
89             </a>
90         </li>
91     </ul>
92     <div class="tab-content">
93         <div class="tab-pane active">
94             <div ng-show="current_tab == 'cn_template'">
95                 <h4>
96                     [% l('Call Number Preview') %]
97                 </h4>
98                 <div eg-print-template-output ng-show="true"
99                     content="print.cn_template_content"
100                     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>
101                 <h4>
102                     [% l('Call Number Template') %]
103                 </h4>
104                 <div><span>[% l('Changes here will wipe out manual changes in the Call Numbers tab.') %]<br/></span></div>
105                 <textarea ng-model="print.cn_template_content" class="print-template-text">
106                 </textarea>
107                 <div ng-repeat="copy in preview_scope.copies">
108                     <div id="cn_for_copy_{{copy.id}}" eg-print-template-output ng-show="false"
109                         content="print.cn_template_content"
110                         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>
111                 </div>
112             </div>
113             <div ng-show="current_tab == 'call_numbers'">
114                 <h4>
115                     [% l('Formatted Call Numbers') %]
116                 </h4>
117                 <div><span>[% l('Manual adjustments may be made here. These do not get saved with templates.') %]<br/></span></div>
118                 <div ng-repeat="cn in rendered_call_number_set">
119                     <textarea ng-model="cn.value" class="cn-template-text">
120                     </textarea>
121                 </div>
122             </div>
123             <div ng-show="current_tab == 'settings'">
124                 <div><span>[% l('These settings do get saved with templates and will override corresponding Library Settings.') %]<br/></span></div>
125                 <div ng-repeat="s in org_unit_settings">
126                     <div class="row" style="margin-top: 5mm; border-top: solid thin black">
127                         <div class="col-md-6" style="font-weight: bold">{{s.label}}</div>
128                         <div class="col-md-6"><input type="text" ng-model="preview_scope.settings[s.name]"></input></div>
129                     </div>
130
131                     <div class="row">
132                         <div>{{s.description}}</div>
133                     </div>
134                 </div>
135
136             </div>
137             <div ng-show="current_tab == 'template'">
138                 <div ng-if="print.load_failed" class="alert alert-danger">
139                   [% l(
140                     "Unable to load template '[_1]'.  The web server returned an error.",
141                     '{{print.template_name}}')
142                   %]
143                 </div>
144                 <div>
145                   <textarea ng-model="print.template_content" class="print-template-text">
146                   </textarea>
147                 </div>
148             </div>
149         </div>
150     </div>
151   </div>
152   <div class="col-md-7">
153     <h3>
154         [% l('Label Preview') %]
155     </h3>
156     <div eg-print-template-output
157       content="print.template_content"
158       context="preview_scope"></div>
159   </div> <!-- col -->
160 </div>
161