[%- depths = attrs.copy_counts.size; depth = 0; displayed_ous = {}; hiding_disabled = ctx.org_hiding_disabled(); WHILE depth < depths; org_unit = ctx.get_aou(attrs.copy_counts.$depth.org_unit); ou_name = org_unit.name; displayed_ous.$ou_name = 1; IF attrs.copy_counts.$depth.count > 0 AND ( hiding_disabled OR ctx.org_within_hiding_scope(org_unit.id)); %]
[% 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 %]
[%- END; depth = depth + 1; END; depth = attrs.plib_copy_counts.size - 1; org_unit = ctx.get_aou(attrs.plib_copy_counts.$depth.org_unit); ou_name = org_unit.name; UNLESS displayed_ous.exists(ou_name); %] [%- IF attrs.plib_copy_counts.$depth.count > 0 AND ( hiding_disabled OR ctx.org_within_hiding_scope(org_unit.id)) %]
[% 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 %]
[%- END %] [%- END %]