1 <?xml version="1.0" encoding="Windows-1252"?>
3 Template for printing item labels (spine, pocket, etc.).
5 Like receipt slip templates, this template uses AngularJS
6 which fuses HTML and code together. The code portion is
7 mostly used to bind data for the item labels being printed
8 to various HTML elements, but you can also use code to
9 perform conditional logic, transform the data, etc.
14 The <style> section is for holding most of our CSS, which
15 is a language for controlling the appearance of HTML markup.
17 The {{ and }} markers are similar to HTML's < and > characters,
18 but are for separating AngularJS variables and code from the
23 /* The .spine here defines a CSS "class", which in this case, is used by our
27 /* this pulls from the "Item Print Label Font Family" setting, but will
28 default to 'monospace' */
29 font-family: {{settings['webstaff.cat.label.font.family'] || 'monospace'}};
31 /* this pulls from the "Item Print Label Font Size" setting, but will
32 default to 'normal' */
33 font-size: {{settings['webstaff.cat.label.font.size'] || '10'}};
35 /* this pulls from the "Item Print Label Font Weight" setting, but will
36 default to 'normal' */
37 font-weight: {{settings['webstaff.cat.label.font.weight'] || 'normal'}};
39 /* this pulls from the "Item Print Label - Height for Left Label"
40 setting, but will default to '1.25in' */
41 height: {{settings['webstaff.cat.label.left_label.height'] || '1.25in'}};
42 min-height: {{settings['webstaff.cat.label.left_label.height'] || '1.25in'}};
43 max-height: {{settings['webstaff.cat.label.left_label.height'] || '1.25in'}};
45 /* this pulls from the "Item Print Label - Width for Left Label"
46 setting, but will default to '1in' */
47 width: {{settings['webstaff.cat.label.left_label.width'] || '1in'}};
48 min-width: {{settings['webstaff.cat.label.left_label.width'] || '1in'}};
49 max-width: {{settings['webstaff.cat.label.left_label.width'] || '1in'}};
51 /* this pulls from the "Item Print Label - Left Margin for Left Label"
52 setting, but will default to '0in' */
53 margin-left: {{settings['webstaff.cat.label.left_label.left_margin'] || '0in'}};
56 /* This CSS class is used by our right label */
59 /* this pulls from the "Item Print Label Font Family" setting, but will
60 default to 'monospace' */
61 font-family: {{settings['webstaff.cat.label.font.family'] || 'monospace'}};
63 /* this pulls from the "Item Print Label Font Size" setting, but will
64 default to 'normal' */
65 font-size: {{settings['webstaff.cat.label.font.size'] || '10'}};
67 /* this pulls from the "Item Print Label Font Weight" setting, but will
68 default to 'normal' */
69 font-weight: {{settings['webstaff.cat.label.font.weight'] || 'normal'}};
71 /* this pulls from the "Item Print Label - Height for Left Label"
72 setting, but will default to '1.25in' */
73 height: {{settings['webstaff.cat.label.right_label.height'] || '1.25in'}};
74 min-height: {{settings['webstaff.cat.label.right_label.height'] || '1.25in'}};
75 max-height: {{settings['webstaff.cat.label.right_label.height'] || '1.25in'}};
77 /* this pulls from the "Item Print Label - Width for Left Label"
78 setting, but will default to '2.625in' */
79 width: {{settings['webstaff.cat.label.right_label.width'] || '2.625in'}};
80 min-width: {{settings['webstaff.cat.label.right_label.width'] || '2.625in'}};
81 max-width: {{settings['webstaff.cat.label.right_label.width'] || '2.625in'}};
83 /* this pulls from the "Item Print Label - Left Margin for Left Label"
84 setting, but will default to '0in' */
85 margin-left: {{settings['webstaff.cat.label.right_label.left_margin'] || '0in'}};
89 /* This is to help mitigate artifacts in the Preview pane which don't
91 .labels ::-webkit-scrollbar {
95 /* This pulls from the "Item Print Label - Inline CSS" setting */
96 {{settings['webstaff.cat.label.inline_css']||''}}
100 <!-- Here we are implementing our combined label as 2-column HTML <table>, with
101 each table containing a <pre> tag for preserving whitespace and linefeeds.
103 The ng-repeat attribute is from AngularJS, and in this case is looping
104 through a list of all the items that were selected when the Print Label
105 interface was invoked. Each iteration puts item data into the variable
106 "copy", which may be referenced in the HTML by escaping it with {{ and }}
108 The following are available, and you may treat these similar to the
109 "macros" in earlier versions of Evergreen:
113 copy['alert_message']
115 copy['call_number.copies']
116 copy['call_number.create_date']
117 copy['call_number.deleted']
118 copy['call_number.edit_date']
119 copy['call_number.id']
120 copy['call_number.label']
121 copy['call_number.label_class']
122 copy['call_number.label_sortkey']
123 copy['call_number.notes']
124 copy['call_number.owning_lib']
125 copy['call_number.owning_lib.id']
126 copy['call_number.owning_lib.shortname']
127 copy['call_number.owning_lib.name']
128 copy['call_number.prefix.id']
129 copy['call_number.prefix.label']
130 copy['call_number.prefix.label_sortkey']
131 copy['call_number.prefix.owning_lib']
132 copy['call_number.record.active']
133 copy['call_number.record.author_field_entries']
134 copy['call_number.record.call_numbers']
135 copy['call_number.record.create_date']
136 copy['call_number.record.creator.ws_ou']
137 copy['call_number.record.deleted']
138 copy['call_number.record.edit_date']
139 copy['call_number.record.fingerprint']
140 copy['call_number.record.fixed_fields']
141 copy['call_number.record.full_record_entries']
142 copy['call_number.record.id']
143 copy['call_number.record.identifier_field_entries']
144 copy['call_number.record.keyword_field_entries']
145 copy['call_number.record.language']
146 copy['call_number.record.last_xact_id']
147 copy['call_number.record.marc']
148 copy['call_number.record.metarecord']
149 copy['call_number.record.notes']
150 copy['call_number.record.owner']
151 copy['call_number.record.quality']
152 copy['call_number.record.series_field_entries']
153 copy['call_number.record.share_depth']
154 copy['call_number.record.simple_record.author']
155 copy['call_number.record.simple_record.fingerprint']
156 copy['call_number.record.simple_record.id']
157 copy['call_number.record.simple_record.isbn']
158 copy['call_number.record.simple_record.issn']
159 copy['call_number.record.simple_record.pubdate']
160 copy['call_number.record.simple_record.publisher']
161 copy['call_number.record.simple_record.quality']
162 copy['call_number.record.simple_record.tcn_source']
163 copy['call_number.record.simple_record.tcn_value']
164 copy['call_number.record.simple_record.title']
165 copy['call_number.record.source']
166 copy['call_number.record.subject_field_entries']
167 copy['call_number.record.tcn_source']
168 copy['call_number.record.tcn_value']
169 copy['call_number.record.title_field_entries']
170 copy['call_number.suffix.id']
171 copy['call_number.suffix.label']
172 copy['call_number.suffix.label_sortkey']
173 copy['call_number.suffix.owning_lib']
174 copy['call_number.uri_maps']
175 copy['call_number.uris']
179 copy['circ_lib.shortname']
180 copy['circ_lib.name']
181 copy['circ_modifier']
188 copy['deposit_amount']
197 copy['loan_duration']
198 copy['location.checkin_alert']
199 copy['location.circulate']
200 copy['location.copies']
201 copy['location.deleted']
202 copy['location.holdable']
203 copy['location.hold_verify']
205 copy['location.label_prefix']
206 copy['location.label_suffix']
207 copy['location.name']
208 copy['location.opac_visible']
209 copy['location.orders']
210 copy['location.owning_lib']
211 copy['mint_condition']
215 copy['status_changed_time']
216 copy['status.copy_active']
217 copy['status.holdable']
219 copy['status.is_available']
221 copy['status.opac_visible']
222 copy['status.restrict_copy_delete']
224 There are also two functions available. The following pulls manually
225 edited call numbers for a given item:
229 And this one pulls bibliographic data for a given item:
233 It returns a data structure similar to "copy" that has the following fields:
235 get_bib_for(copy)['author']
236 get_bib_for(copy)['copy_count']
237 get_bib_for(copy)['doc_id']
238 get_bib_for(copy)['doc_type']
239 get_bib_for(copy)['edition']
240 get_bib_for(copy)['isbn']
241 get_bib_for(copy)['physical_description']
242 get_bib_for(copy)['pubdate']
243 get_bib_for(copy)['publisher']
244 get_bib_for(copy)['series.0']
245 get_bib_for(copy)['synopsis']
246 get_bib_for(copy)['tcn']
247 get_bib_for(copy)['title']
248 get_bib_for(copy)['toc']
249 get_bib_for(copy)['types_of_resource.0']
251 Finally, there are filter functions which can be used to modify or transform
252 data being outputted. For example, consider the following:
254 get_bib_for(copy)['title'] | limitTo:28
256 This would show up to the first 28 characters for an item's title and
257 truncate the rest. Now, this:
259 get_bib_for(copy)['title'] | wrap:28
261 This would try to the wrap the item's title every 28 characters.
263 get_bib_for(copy)['title'] | wrap:28:multi:' '
265 This does the same thing but indents subsequent lines with 2 spaces each.
267 get_bib_for(copy)['title'] | wrap:28:once:' '
269 This wraps the title just once, prefixes the second line with two spaces,
270 and truncates anything after the 2nd line.
274 <table class="labels" style="page-break-after: always;" ng-repeat="copy in copies"><tr valign="top"><td>
276 <!-- Spine Label contents -->
277 <pre class="spine" style="border:none" ng-show="true">
283 <!-- Pocket Label contents -->
284 <pre class="pocket" style="border:none" ng-show="true">
286 {{copy['call_number.label']}}
287 {{get_bib_for(copy).author }}
288 {{get_bib_for(copy).title | wrap:28:'once':' '}}