# Extract the copy count summary
count_type = (ctx.is_staff) ? 'staff' : 'public';
+
+ # Consortial copy count summary first
xpath = '//*[local-name()="counts"]/*[local-name()="count"][@type="' _ count_type _ '"]';
+ args.copy_counts = {};
FOR node IN xml.findnodes(xpath);
- args.copy_counts = {};
- FOR attr IN ['count', 'available', 'unshadow', 'transcendant'];
- args.copy_counts.$attr = node.getAttribute(attr);
+ FOR attr IN ['count', 'available', 'unshadow', 'transcendant', 'org_unit'];
+ depth = node.getAttribute('depth');
+ args.copy_counts.$depth.$attr = node.getAttribute(attr);
END;
END;
[%- IF ctx.copy_summary.0.count %]
<div id='rdetail_copies'>
<h2>[% l('Copies') %]</h2>
-<div class="rdetail_copy_counts">
+<ul>
+<li class="rdetail_copy_counts">
<span>
[%- l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].",
ctx.record_hold_count, ctx.copy_summary.0.count) %]
</span>
- <span>[% l('[quant,_1,copy,copies] currently available.', ctx.copy_summary.0.available) %]</span>
-</div>
+ <span>[% l('[quant,_1,copy,copies] currently available at [_2].',
+ ctx.copy_summary.0.available,
+ ctx.get_aou(ctx.copy_summary.$depth.org_unit).name) | html %]
+ </span>
+</li>
+[%- depths = ctx.copy_summary.size;
+ depth = 1;
+ WHILE depth < depths;
+%]
+<li class="rdetail_copy_counts">
+[% l('[quant,_1,copy,copies] currently available at [_2].',
+ ctx.copy_summary.$depth.available,
+ ctx.get_aou(ctx.copy_summary.$depth.org_unit).name)
+ | html %]
+</li>
+[%- depth = depth + 1; END %]
+</ul>
<table cellpadding="0" cellspacing="0" border="0" width="100%" id="rdetails_status">
<thead>
<tr>
[% END %]
[% END %] <!-- END detail_record_view -->
</table>
- <div>
- [% l('[_1] of [quant,_2,copy,copies] available',
- attrs.copy_counts.available, attrs.copy_counts.count) # XXX s/count/nshadow/ ?
- #rec.copy_counts.available, rec.copy_counts.visible)
+ [%- depths = attrs.copy_counts.size;
+ depth = 0;
+ WHILE depth < depths;
+ %]
+ <div class="result_count">
+ [% l('[_1] of [quant,_2,copy,copies] available at [_3].',
+ attrs.copy_counts.$depth.available,
+ attrs.copy_counts.$depth.count,
+ ctx.get_aou(attrs.copy_counts.$depth.org_unit).name) | html
%]
</div>
+ [%- depth = depth + 1; END %]
</div>
</td>