[%-
# If being used in serial mode, flatten list of units so that they can be
# used like one long list of copies without changing so much code below.
IF serial_holdings;
copies = [];
FOREACH h IN serial_holdings;
units = h.units.slice(0); # copy
FOREACH unit IN units;
unit.holding_label = h.label;
END;
copies = copies.merge(units);
END;
END;
FOREACH copy_info IN copies;
IF copy_info.call_number_label != '##URI##';
has_copies = 'true';
END;
IF copy_info.part_label != '';
has_parts = 'true';
END;
IF has_parts && has_copies;
LAST;
END;
END;
-%]
[%- MACRO display_ou_distance(ou) BLOCK;
km = ctx.ou_distances.$ou;
IF km && km != '-1';
IF ctx.get_org_setting(ctx.physical_loc || ctx.search_ou, 'opac.geographic_proximity_in_miles');
distance = l('[_1] mi', POSIX.sprintf('%.01f', km / 1.609));
ELSE;
distance = l('[_1] km', POSIX.sprintf('%.01f', km));
END;
ELSE;
distance = '-';
END;
%]
[% distance %]
[%- END %]
[%-
IF has_copies or ctx.foreign_copies;
depth = CGI.param('copy_depth').defined ? CGI.param('copy_depth') : CGI.param('depth').defined ? CGI.param('depth') : ctx.copy_summary.last.depth;
total_copies = ctx.copy_summary.$depth.count;
%]
[% use_courses = (ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1) ? 1 : 0 %]
[% IF ctx.geo_sort %]