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