]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates-bootstrap/opac/parts/result/copy_counts.tt2
LP#1778972: Tweaks and fixes to Bootstrap 4 template
[Evergreen.git] / Open-ILS / src / templates-bootstrap / opac / parts / result / copy_counts.tt2
1 [%- depths = attrs.copy_counts.size;
2     depth = 0;
3     displayed_ous = {};
4     hiding_disabled = ctx.org_hiding_disabled();
5     WHILE depth < depths;
6         org_unit = ctx.get_aou(attrs.copy_counts.$depth.org_unit);
7         ou_name = org_unit.name;
8         displayed_ous.$ou_name = 1;
9         IF attrs.copy_counts.$depth.count > 0 AND (
10             hiding_disabled OR ctx.org_within_hiding_scope(org_unit.id));
11 %]
12 <div class="result_count">
13 [% IF ctx.get_aou(attrs.copy_counts.$depth.org_unit).opac_visible == 't' %]
14     [% l('[_1] of [quant,_2,copy,copies] available at [_3].',
15         attrs.copy_counts.$depth.available,
16         attrs.copy_counts.$depth.count,
17         ou_name) | html
18     %]
19 [% END %]
20 </div>
21 [%-     END;
22     depth = depth + 1;
23     END;
24
25     depth = attrs.plib_copy_counts.size - 1;
26     org_unit = ctx.get_aou(attrs.plib_copy_counts.$depth.org_unit);
27     ou_name = org_unit.name;
28     UNLESS displayed_ous.exists(ou_name);
29
30 %]
31 [%- IF attrs.plib_copy_counts.$depth.count > 0 AND (
32         hiding_disabled OR ctx.org_within_hiding_scope(org_unit.id)) %]
33 <div class="result_count preferred">[%
34      l('[_1] of [quant,_2,copy,copies] available at [_3].',
35         attrs.plib_copy_counts.$depth.available,
36         attrs.plib_copy_counts.$depth.count,
37         ou_name) | html
38     %]
39 </div>
40 [%- END %]
41 [%- END %]