--- /dev/null
+<span id="rdetail_copy_counts">
+ <h2>[% l('Available copies') %]</h2>
+ <ul>
+ [%- depths = ctx.copy_summary.size;
+ depth = 1;
+ displayed_ous = {};
+ WHILE depth < depths;
+ ou_avail = ctx.copy_summary.$depth.available;
+ ou_id = ctx.copy_summary.$depth.org_unit;
+ cp_org_unit = ctx.get_aou(ou_id);
+ IF cp_org_unit.opac_visible == 'f' AND !ctx.is_staff;
+ depth = depth + 1;
+ NEXT;
+ END;
+ ou_name = cp_org_unit.name;
+ displayed_ous.$ou_name = 1;
+ %]
+ <li>
+ [% l('[quant,_1,copy,copies] at [_2].', ou_avail, ou_name) | html %]
+ [%- this_depth = ctx.get_aou(ou_id).ou_type.depth;
+ IF ou_avail > 0 && this_depth != ctx.copy_depth %]
+ <a href="[% mkurl('', {copy_depth => this_depth}, ['copy_offset']); %]"
+ title="[% l('Show copies at [_1]', ou_name); %]">
+ [%- l('(Show)'); %]</a>
+ [%- END; %]
+ </li>
+ [%- depth = depth + 1;
+ END;
+
+ depth = attrs.plib_copy_counts.size - 1;
+ ou_name = ctx.get_aou(attrs.plib_copy_counts.$depth.org_unit).name;
+ ou_id = attrs.plib_copy_counts.$depth.org_unit;
+ UNLESS depth < 0 || displayed_ous.exists(ou_name);
+ %]
+ [%- IF attrs.plib_copy_counts.$depth.count > 0; %]
+ <li class="preferred">[%
+ l('[_1] of [quant,_2,copy,copies] available at [_3].',
+ attrs.plib_copy_counts.$depth.available,
+ attrs.plib_copy_counts.$depth.count,
+ ou_name) | html
+ %] <a href="[% mkurl('', {locg => ou_id}, ['copy_offset']); %]"
+ title="[% l('Show copies at [_1]', ou_name); %]">[%
+ l('(Show preferred library)');
+ %]</a></li>
+ [%- END %]
+ [%- END %]
+ </ul>
+</span>
--- /dev/null
+[%- depths = attrs.copy_counts.size;
+ depth = 1;
+ displayed_ous = {};
+ WHILE depth < depths;
+ ou_name = ctx.get_aou(attrs.copy_counts.$depth.org_unit).name;
+ displayed_ous.$ou_name = 1;
+ IF attrs.copy_counts.$depth.count > 0;
+%]
+<div class="result_count">
+[% IF ctx.get_aou(attrs.copy_counts.$depth.org_unit).opac_visible == 't' %]
+ [% l('[_1] of [quant,_2,copy,copies] available at [_3].',
+ attrs.copy_counts.$depth.available,
+ attrs.copy_counts.$depth.count,
+ ou_name) | html
+ %]
+[% END %]
+</div>
+[%- END;
+ depth = depth + 1;
+ END;
+
+ depth = attrs.plib_copy_counts.size - 1;
+ ou_name = ctx.get_aou(attrs.plib_copy_counts.$depth.org_unit).name;
+ UNLESS displayed_ous.exists(ou_name);
+
+%]
+[%- IF attrs.plib_copy_counts.$depth.count > 0; %]
+<div class="result_count preferred">[%
+ l('[_1] of [quant,_2,copy,copies] available at [_3].',
+ attrs.plib_copy_counts.$depth.available,
+ attrs.plib_copy_counts.$depth.count,
+ ou_name) | html
+ %]
+</div>
+[%- END %]
+[%- END %]